Skillpedia
الأمان75k · #3091

x-frame-options

ما الذي تفعله

تتحقق هذه المهارة من أن الموقع يمنع المواقع الأخرى من تضمين صفحاته في إطارات. وهي مخصصة للمطورين وفريق الأمان الذين يحمون المواقع التي يسجّل فيها المستخدمون الدخول أو ينفذون إجراءات.

متى تستخدمها

  • ✓عندما يحتوي موقع فيه تسجيل دخول أو مدفوعات على ترويسة حماية من التضمين غير موجودة.
  • ✓عندما يُبلغ فحص أمني عن خطر النقر المخفي.
  • ✓عندما يجب أن يُضمَّن الموقع على نطاقه فقط.

رابط المهارة

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-frame-options/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-frame-options/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“يقول فحص أمني إن صفحة تسجيل الدخول في موقعي يمكن وضعها داخل إطار موقع آخر. كيف أمنع ذلك؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يضيف الوكيل ترويسة تمنع المواقع الأخرى من تضمين الصفحات، أو تحصر التضمين في النطاق نفسه. ويمكنه أيضا اقتراح إعداد CSP الأحدث frame-ancestors.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Set an X-Frame-Options header

Without framing protection, an attacker can embed your banking login page in a transparent iframe on a malicious site and trick users into clicking buttons they cannot see — transferring money, changing settings, or leaking credentials.

Quick Reference

  • Use X-Frame-Options: DENY to prevent all framing, or SAMEORIGIN to allow framing only from your own domain
  • ALLOWFROM is obsolete and unsupported in modern browsers — use CSP frame-ancestors instead
  • The modern equivalent is Content-Security-Policy: frame-ancestors 'none' — prefer CSP for new sites
  • Both headers can coexist: X-Frame-Options for older browsers, frame-ancestors for modern ones
  • Clickjacking attacks trick users into clicking invisible iframe buttons — DENY eliminates this entirely

Check

Check whether the server sends an X-Frame-Options header (DENY or SAMEORIGIN) or a Content-Security-Policy header with frame-ancestors directive to prevent clickjacking.

Fix

Add X-Frame-Options: DENY to all responses if the site does not need to be embedded anywhere. If legitimate framing is needed on the same origin, use SAMEORIGIN. For fine-grained control, use CSP frame-ancestors instead.

Explain

Explain what a clickjacking attack is, how X-Frame-Options and CSP frame-ancestors prevent it, and the difference between DENY and SAMEORIGIN values.

Code Review

Review server config, headers, forms, and integration points related to Set an X-Frame-Options header. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/x-frame-options

الأسئلة الشائعة

ما النقر المخفي؟

هو هجوم يستخدم إطارا مخفيا لخداع المستخدمين كي ينقروا أزرارا لا يرونها.

ما الفرق بين DENY وSAMEORIGIN؟

تمنع DENY كل تضمين، بينما تسمح SAMEORIGIN بالتضمين من نطاقك فقط.

هل ما زالت ALLOWFROM مدعومة؟

لا. تقول المهارة إنها قديمة وغير مدعومة في المتصفحات الحديثة.

التفاصيل

الوصف الأصلي من المؤلف

Use when reviewing HTTP response headers for clickjacking protection on any web application with authenticated user actions.

repo: thedaviddias/Front-End-Checklist

الشعبية

نجوم GitHub
75k
الترتيب
#3091
الترخيص
MIT
آخر تحديث
31‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة