انتقل إلى المحتوى
أمين أبوزيد
JNR-041

الثغرات الشائعة

  • 7 درس
  • 2.5 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • OWASP Top 10
  • الحقن (Injection)
  • كسر التحكم في الوصول (Broken access control)
  • XSS
  • CSRF
  • مقدمة في SSRF

تعلّم أولًا

2.5 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Explain the current OWASP Top 10 categories with a backend example of each.
  2. Demonstrate and fix SQL/JPQL injection, broken access control, and mass assignment.
  3. Explain stored vs reflected XSS and the backend's role (output encoding, content types).
  4. Explain SSRF and protect a URL-fetching feature with an allow-list.

الدروس

  1. 01جولة في OWASP Top 10
  2. 02الحقن إلى ما هو أبعد من SQL
  3. 03الإسناد الجماعي (Mass assignment)
  4. 04XSS من منظور الواجهة الخلفية
  5. 05نظرة ثانية على CSRF
  6. 06SSRF
  7. 07عرض عملي: استغلال وإصلاح الإسناد الجماعي وSSRF

المختبر والتمارين

Lab

JNR-041-LAB1 · Vulnerable Shop

Outcomes: 1–4 · Time: ~2.5 h On a deliberately vulnerable branch with six planted flaws, find each, exploit it locally, fix it, and add a regression test for it. Acceptance: 5 of 6 found and fixed, each with a regression test.

Exercises (assessment: the lab, graded on fixes and tests)

IDOutcomeTask
JNR-041-EX011Name six OWASP Top 10 categories and give one Shop example for each.
JNR-041-EX022Exploit and fix a JPQL query built by string concatenation.
JNR-041-EX032Register with "role":"ADMIN", then fix it with a DTO.
JNR-041-EX042Fix a broken-access-control bug where a customer can update another's profile.
JNR-041-EX053Explain stored vs reflected XSS and state two things a JSON backend does to reduce the risk.
JNR-041-EX064Explain SSRF with one example for an "import from URL" feature.
JNR-041-EX074Write an allow-list check for a URL-fetching feature and a test that rejects an internal address.
أظهر الحلول
  • EX01 For example: access control (IDOR), injection (JPQL concatenation), cryptographic failures (MD5 passwords), security misconfiguration (open Actuator), vulnerable components (old library), SSRF (URL import). Verify names against the current edition.
  • EX02 Attack name=' or '1'='1; fix with :name and setParameter, or a Spring Data derived query.
  • EX03 Use a RegisterRequest(email, password) record and set the role server-side to CUSTOMER.
  • EX04 Take the user from the principal and update only that user's record; return 404 for other ids.
  • EX05 Stored: payload saved and shown to others; reflected: echoed from the request. Backend: correct Content-Type and no unencoded HTML; encode output for HTML and set nosniff/CSP headers.
  • EX06 The attacker supplies http://localhost:8080/actuator/env or a cloud metadata address and the server fetches it for them.
  • EX07 Parse the URL, require https, check host is in an allow-list, resolve the address and reject loopback/private ranges; test with http://127.0.0.1/.

الاختبار

Outcomes: O1 OWASP Top 10 · O2 injection, access control, mass assignment · O3 XSS · O4 SSRF.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1OWASP publishes:O1
  2. 2An IDOR belongs to:O1
  3. 3The reliable defense against SQL injection is:O2
  4. 4Sort-column names that cannot be parameters should be:O2
  5. 5Mass assignment happens when:O2
  6. 6The best fix for mass assignment is:O2
  7. 7Stored XSS means the payload is:O3
  8. 8For a JSON API, XSS risk is reduced by:O3
  9. 9SSRF means the:O4
  10. 10The best protection for a URL-fetching feature:O4

الجزء العملي

The lab is the assessment: six planted flaws, each found, exploited, fixed, and covered by a regression test. Pass: 5 of 6 fixed with tests, plus quiz 8 of 10.

أخطاء شائعة

Binding request bodies directly to entities; fetching user-provided URLs unrestricted.

التقييم

The lab, graded on fixes and tests.

الصلة بالمسار الوظيفي

OWASP API Security (MID-052).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.