Skip to content
The Chat Archive
gpt-3.5-turbo-0613· OpenAI WildChat-4.8M (AI2)

Websites often need to automatically redirect their users. For example, this scenario…

  1. User

    Websites often need to automatically redirect their users. For example, this scenario commonly occurs when unauthenticated users try to access a page that requires logging in. The website will usually redirect those users to the login page, and then return them to their original location after they’re ترجم عربي

  2. Assistant

    من المعتاد أن تحتاج المواقع إلى إعادة توجيه المستخدمين تلقائيًا. على سبيل المثال، يحدث هذا السيناريو بشكل شائع عندما يحاول المستخدمون غير المصادق عليهم الوصول إلى صفحة تتطلب تسجيل الدخول. عادةً ما تعيد المواقع إعادة توجيه هؤلاء المستخدمين إلى صفحة تسجيل الدخول، ثم تعيدهم إلى الموقع الأصلي بعد تسجيل الدخول.

  3. User

    To later redirect users to their previous location, the site needs to remember which page they intended to access before they were redirected to the login page. Therefore, the site uses some sort of redirect URL parameter appended to the URL to keep track of the user’s original location. This parameter determines where to redirect the user after login. For example, the URL https://example.com/login?redirect=https://example.com/dashboard will redirect to the user’s dashboard, located at https://example.com/dashboard, after login. ترجم

  4. Assistant

    لكي تقوم الموقع بإعادة توجيه المستخدمين إلى الموقع السابق لهم، يجب أن يتذكر الموقع الصفحة التي كان المستخدمون ينوون الوصول إليها قبل أن يتم إعادة توجيههم إلى صفحة تسجيل الدخول. لذلك، يستخدم الموقع نوعًا ما من معلمة URL لإعادة التوجيه الملحقة بالرابط لتتبع موقع المستخدم الأصلي. تحدد هذه المعلمة المكان الذي سيتم إعادة توجيه المستخدم إليه بعد تسجيل الدخول. على سبيل المثال، ستقوم الرابط https://example.com/login?redirect=https://example.com/dashboard بإعادة التوجيه إلى لوحة المعلومات الخاصة بالمستخدم الموجودة على https://example.com/dashboard بعد تسجيل الدخول.

  5. User

    Or if the user was originally trying to browse their account settings page, the site would redirect the user to the settings page after login, and the URL would look like this: https://example.com/login?redirect=https://example.com/settings. Redirecting users automatically saves them time and improves their experience, so you’ll find many applications that implement this functionality ترجم

  6. Assistant

    أو إذا كان المستخدم يحاول في الأصل تصفح صفحة إعدادات حسابه، سيقوم الموقع بتوجيه المستخدم إلى صفحة الإعدادات بعد تسجيل الدخول، وسيكون الرابط كالتالي: https://example.com/login?redirect=https://example.com/settings. إعادة توجيه المستخدمين تلقائيًا يوفر لهم الوقت ويعزز تجربتهم، لذا ستجد العديد من التطبيقات التي تنفذ هذه الميزة.

  7. User

    During an open-redirect attack, an attacker tricks the user into visiting an external site by providing them with a URL from the legitimate site that redirects somewhere else, like this: https://example.com/login?redirect=https:// attacker.com. A URL like this one could trick victims into clicking the link, because they’ll believe it leads to a page on the legitimate site, example.com. But in reality, this page automatically redirects to a malicious page. Attackers can then launch a social engineering attack and trick users into entering their example.com credentials on the attacker’s site. In the cybersecurity world, social engineering refers to attacks that deceive the victim. Attacks that use social engineering to steal credentials and private information are called phishing. ترجم

  8. Assistant

    أثناء هجوم إعادة التوجيه المفتوحة، يخدع المهاجم المستخدم لزيارة موقع خارجي عن طريق توفير عنوان URL لهم من الموقع الشرعي يعيد التوجيه إلى مكان آخر، مثل هذا العنوان: https://example.com/login?redirect=https://attacker.com. يمكن أن يخدع مثل هذا الرابط الضحايا للنقر على الرابط، لأنهم يعتقدون أنه يؤدي إلى صفحة على الموقع الشرعي example.com. ولكن في الواقع، تقوم هذه الصفحة بإعادة التوجيه تلقائيًا إلى صفحة خبيثة. يمكن للمهاجمين بعدها تنفيذ هجوم هندسة اجتماعية وخداع المستخدمين لإدخال بيانات اعتماد example.com الخاصة بهم على موقع المهاجم. في عالم الأمان السيبراني، تشير الهندسة الاجتماعية إلى الهجمات التي تخدع الضحية. وتسمى الهجمات التي تستخدم الهندسة الاجتماعية لسرقة بيانات الاعتماد والمعلومات الخاصة هجمات الصيد الاحتيالية (Phishing).

  9. User

    Another common open-redirect technique is referer-based open redirect. The referer is an HTTP request header that browsers automatically include. It tells the server where the request originated from. Referer headers are a common way of determining the user’s original location, since they contain the URL that linked to the current page. Thus, some sites will redirect to the page’s referer URL automatically after certain user actions, like login or logout. In this case, attackers can host a site that links to the victim site to set the referer header of the request, using HTML like the following ترجم

  10. Assistant

    تقنية إعادة التوجيه المفتوحة الأخرى الشائعة هي إعادة التوجيه المفتوحة بناءً على المرجعية (referer-based open redirect). المرجعية هي رأس طلب HTTP يتم تضمينه بشكل تلقائي من قبل المتصفحات، وتخبر الخادم من أين بدأ الطلب. تعتبر رؤوس المرجعية وسيلة شائعة لتحديد الموقع الأصلي للمستخدم، حيث تحتوي على عنوان URL الذي ربط بالصفحة الحالية. وبالتالي، يقوم بعض المواقع بإعادة التوجيه إلى عنوان URL للمرجعية تلقائيًا بعد بعض إجراءات المستخدم، مثل تسجيل الدخول أو تسجيل الخروج. في هذه الحالة، يمكن للمهاجمين استضافة موقع يربط بموقع الضحية لتعيين رأس المرجعية للطلب، باستخدام HTML مماثل للمثال التالي:

  11. User

    To prevent open redirects, the server needs to make sure it doesn’t redirect users to malicious locations. Sites often implement URL validators to ensure that the user-provided redirect URL points to a legitimate location. These validators use either a blocklist or an allowlist. ترجم

  12. Assistant

    لمنع إعادة التوجيه المفتوحة، يحتاج الخادم إلى التأكد من عدم إعادة توجيه المستخدمين إلى مناطق خبيثة. غالبًا ما تقوم المواقع بتنفيذ أدوات التحقق من صحة عنوان URL لضمان أن عنوان URL الذي قدمه المستخدم يشير إلى موقع شرعي. تستخدم هذه الأدوات إما قائمة حظر أو قائمة سماح.

    • قائمة الحظر (Blocklist): تحتوي على قائمة بالعناوين URL التي يجب حظرها أو عدم إعادة توجيه المستخدمين إليها. إذا كانت عناوين URL التي تقدمها المستخدم تتطابق مع قائمة الحظر، يتم رفض إعادة التوجيه.

    • قائمة السماح (Allowlist): تحتوي على قائمة بالعناوين URL المشروعة المسموح بها فقط. يتم فقط إعادة توجيه المستخدمين إلى العناوين URL الموجودة في قائمة السماح.

    استخدام قوائم الحظر أو السماح يساعد في منع إعادة التوجيه إلى عناوين URL ضارة وضمان أمان التصفح للمستخدمين.

  13. User

    When a validator implements a blocklist, it will check whether the redirect URL contains certain indicators of a malicious redirect, and then block those requests accordingly. For example, a site may blocklist known malicious hostnames or special URL characters often used in open-redirect attacks. When a validator implements an allowlist, it will check the hostname portion of the URL to make sure that it matches a predetermined list of allowed hosts. If the hostname portion of the URL matches an allowed hostname, the redirect goes through. Otherwise, the server blocks the redirect. ترجم

  14. Assistant

    عندما ينفذ محقق الصحة قائمة الحظر، فإنه سيتحقق مما إذا كان عنوان URL لإعادة التوجيه يحتوي على مؤشرات معينة لإعادة التوجيه الضار، ثم يمنع هذه الطلبات بناءً على ذلك. على سبيل المثال، قد يقوم موقع ما بإدراج أسماء مضيفين ضارة معروفة أو علامات URL الخاصة المستخدمة في كثير من الأحيان في هجمات إعادة التوجيه المفتوحة على قائمة الحظر. عندما ينفذ محقق الصحة قائمة السماح، فإنه سيتحقق من جزء اسم المضيف لعنوان URL للتأكد من أنه يتطابق مع قائمة محددة مسبقًا من المضيفين المسموح بهم. إذا كان جزء اسم المضيف من عنوان URL يتطابق مع اسم مضيف مسموح به، فإن إعادة التوجيه يتم تنفيذها. وإلا، يقوم الخادم بحظر إعادة التوجيه. باستخدام قوائم الحظر والسماح، يمكن لمحققي الصحة حماية المواقع من إعادة التوجيه إلى أماكن ضارة ومنع الهجمات على سلامة المستخدمين.

  15. User

    These defense mechanisms sound straightforward, but the reality is that parsing and decoding a URL is difficult to get right. Validators often have a hard time identifying the hostname portion of the URL. This makes open redirects one of the most common vulnerabilities in modern web applications. We’ll talk about how attackers can exploit URL validation issues to bypass open-redirect protection later in this chapter. ترجم

  16. Assistant

    تبدو هذه الآليات الدفاعية مبسطة، ولكن الواقع هو أن معالجة وفك شيفرة عنوان URL أمر صعب في التنفيذ الصحيح. غالبًا ما يواجه المحققون صعوبة في تحديد جزء اسم المضيف من عنوان URL. وهذا يجعل إعادة التوجيه المفتوحة أحد أكثر الثغرات شيوعًا في تطبيقات الويب الحديثة. سنتحدث لاحقًا في هذا الفصل عن كيفية استغلال المهاجمين لمشكلات التحقق من صحة عنوان URL لتجاوز حماية إعادة التوجيه المفتوحة.