OWASP टॉप 10

OWASP Top 10 OWASP Foundation का एक awareness document है जो web applications में security risk की दस सबसे गंभीर categories को रैंक करता है। मौजूदा edition OWASP Top 10:2025 है। हर category का एक identifier है, जैसे A01:2025, एक नाम, वे weaknesses जो वह समेटती है (CWE entries से mapped), prevention की सलाह और example attack scenarios।

टेस्टर के लिए यह एक test basis है: किसी भी feature के बारे में पूछने के दस सवाल। "क्या customer A id बदलकर customer B का invoice download कर सकता है?" A01:2025 Broken Access Control के पीछे का सवाल है, और ग़लत user के token से भेजा एक request उसका जवाब दे देता है।

यह क्यों ज़रूरी है

Security defects functional tests में कम ही दिखते हैं, क्योंकि ईमानदार user के लिए application ठीक वैसा ही व्यवहार करता है जैसा specified है। वे तब दिखते हैं जब कोई ऐसा request भेजता है जो UI कभी नहीं भेजता: दूसरे user की id, admin path, logout के बाद का token, field के अंदर एक quote। Top 10 weakness की उन categories के नाम बताता है जिन्हें testing data व्यापक दिखाता है, और उन्हें इस हिसाब से तौलता है कि वे कितनी आसानी से exploit होती हैं और कितना नुक़सान करती हैं, इसलिए इसे cover करना आम और गंभीर, दोनों तरह की failures को cover करता है।

यह एक साझा भाषा भी है: developers, security specialists और auditors जानते हैं कि "A01 finding" का क्या मतलब है, इसलिए category का नाम लेने वाली report जल्दी समझी और prioritize की जाती है। और यह तय करता है कि QA टेस्टर क्या cover करता है, इससे पहले कि specialist penetration test उन्हीं categories में और गहराई तक जाए।

Top 10 क्या है, और क्या नहीं है

OWASP हर कुछ साल में नया edition निकालता है; 2025 ने 2021 की जगह ली। दस में से आठ categories applications टेस्ट करने वाली organisations के contributed testing data से आती हैं, और एक ऐसे score से रैंक होती हैं जो यह जोड़ता है कि हर weakness कितनी बार मिलती है (उसका incidence rate) और उसकी exploitability और impact कितना है; practitioners का एक community survey बाक़ी दो जोड़ता है, उन risks के लिए जिन्हें data कम दिखाता है (2025 का A09 पेज कहता है कि वह vote से आई, और A03 survey में सबसे ऊपर रैंक हुई concern थी)। 2025 में तीन बदलाव मायने रखते हैं: A10 Mishandling of Exceptional Conditions नई है; A03 2021 की Vulnerable and Outdated Components से बढ़कर पूरी build, distribution और update chain तक पहुँची; A09 का नाम बदला ताकि सिर्फ़ logging नहीं, alerting पर ज़ोर हो। हर category CWEs की एक सूची से mapped है: Common Weakness Enumeration (CWE) weakness के प्रकारों का MITRE का catalogue है (इसके उलट, एक CVE किसी एक product की एक vulnerability का नाम है), और कई scanners अपनी findings पर CWE ids लगाते हैं।

यह न तो standard है, न पूरी checklist। Application Security Verification Standard (ASVS) security को verifiable requirements में बदलता है, Web Security Testing Guide (WSTG) step-by-step test procedures देता है, और OWASP API Security Top 10 (2023) API-specific risks cover करता है। Top 10 से तय करें कहाँ पहले देखना है; ASVS और WSTG से तय करें कितनी गहराई तक।

  • साल हमेशा लिखें: editions के बीच positions बदलती हैं, और A03 का मतलब 2021 में Injection था पर 2025 में Software Supply Chain Failures है।
  • सिर्फ़ वही systems टेस्ट करें जो आपके हैं या जिनके लिए लिखित अनुमति है। इस lesson का हर check एक non-destructive observation है, exploit नहीं।

2025 की दस categories और टेस्टर का पहला check

हर category के लिए: वह क्या समेटती है, फिर टेस्टर का पहला check। इस module के बाद के lessons हर area में गहराई तक जाते हैं; यहाँ लक्ष्य है हर category को पहचानना और जानना कि कहाँ देखना है।

  • A01:2025 Broken Access Control: अपनी permissions से बाहर काम करना, जैसे id बदलकर दूसरे user का record पढ़ना। Check: ग़लत user और ग़लत role के valid token से request दोहराएँ; 403 या 404 की अपेक्षा रखें।
  • A02:2025 Security Misconfiguration: default accounts, ज़रूरत से ज़्यादा features, verbose errors, missing security headers, ढीली permissions। Check: response headers पढ़ें, एक error page trigger करें, test environment पर documented default credentials आज़माएँ।
  • A03:2025 Software Supply Chain Failures: vulnerable, unmaintained, untracked या compromised components, build tools और update channels। Check: versions के साथ dependency inventory माँगें और पूछें कि हर release से पहले advisories देखी जाती हैं या नहीं।
  • A04:2025 Cryptographic Failures: बिना encryption भेजा या रखा गया sensitive data, कमज़ोर algorithms, hard-coded keys। Check: हर endpoint पर TLS की पुष्टि करें; clear text में stored या logged passwords, card numbers या tokens खोजें।
  • A05:2025 Injection: untrusted input बिना escaping किसी interpreter (SQL, OS command, template, HTML) तक पहुँचना; cross-site scripting (XSS), जहाँ input किसी दूसरे user के browser में script बनकर चल जाता है, यहीं आती है। Check: हर field में एक quote, angle bracket या semicolon; errors, बदले results या rendered markup पर नज़र रखें।
  • A06:2025 Insecure Design: business logic सही code के साथ भी दुरुपयोग की इजाज़त देता है, जैसे coupon दो बार लगना। Check: बेईमान user की तरह flow पर चलें और बिना किसी technical trick के rule तोड़ने की कोशिश करें।
  • A07:2025 Authentication Failures: कमज़ोर passwords स्वीकार, lockout या throttling नहीं, user enumeration, logout के बाद भी चलती sessions। Check: ग़लत-password attempts, मौजूद और अनजान accounts के लिए अलग messages, logout के बाद पुराना token।
  • A08:2025 Software or Data Integrity Failures: बिना verification भरोसा किया गया code या data: untrusted CDN से scripts, unsigned updates, असुरक्षित CI/CD pipeline। Check: पूछें कि build artefacts और updates कैसे verify होते हैं, और client जो data वापस भेजता है, जैसे cookie में एक serialised object, वह बिना integrity check स्वीकार होता है या नहीं।
  • A09:2025 Security Logging and Alerting Failures: logins, failed logins और high-value transactions log नहीं होते, logs monitor नहीं होते, alerts नहीं उठते। Check: अपने tests के बाद पूछें कि आपके forbidden requests logs में दिखे या नहीं और किसी को alert मिला या नहीं।
  • A10:2025 Mishandling of Exceptional Conditions: errors वहाँ handle नहीं होते जहाँ होते हैं, failing open (जब check ख़ुद error दे तब action की इजाज़त दे देना), दिखते हुए stack traces, failure के बाद inconsistent state। Check: missing parameter, बहुत बड़ी value या ग़लत type भेजें; साफ़ error और बंद दरवाज़े की अपेक्षा रखें।
दस categories, दस पहले सवाल: OWASP Top 10:2025 एक checklist के रूप में, हर category के लिए क्या पूछना है और कौन-सा evidence रखना है।
Category (OWASP Top 10:2025)टेस्टर का पहला सवालरिकॉर्ड करने का evidence
Broken Access ControlA01:2025क्या user A user B के record या admin action तक पहुँच सकता है?ग़लत user के रूप में request और उसका status (403 या 404 अपेक्षित)
Security MisconfigurationA02:2025क्या defaults, headers, errors और permissions hardened हैं?Response headers, एक error page, default-credentials की कोशिश
Software Supply Chain FailuresA03:2025क्या components tracked, supported और trusted sources से हैं?Versions वाली dependency inventory और देखी गई advisories
Cryptographic FailuresA04:2025क्या sensitive data transit और rest में encrypted है?हर endpoint पर TLS; clear text में stored या logged कोई secret
InjectionA05:2025क्या untrusted input बिना escaping SQL, command या HTML तक पहुँचता है?Field, input और error या बदला व्यवहार
Insecure DesignA06:2025क्या business rule का बिना किसी bug के दुरुपयोग हो सकता है?Flow, rule और उसे bypass करने वाला scenario
Authentication FailuresA07:2025क्या passwords guess, accounts enumerate या logout के बाद tokens reuse हो सकते हैं?Lockout व्यवहार, अलग messages, logout के बाद token lifetime
Software or Data Integrity FailuresA08:2025क्या code या data बिना signature या integrity check स्वीकार होता है?Artefacts और updates कैसे verify होते हैं; जैसा है वैसा स्वीकार serialised data
Security Logging and Alerting FailuresA09:2025क्या logins, failures और high-value actions log होते हैं और alert उठता है?हर test event की log line और alert किसे मिला
Mishandling of Exceptional ConditionsA10:2025कुछ ग़लत होने पर क्या system fail closed होता है और कम बताता है?दिखाया गया error, बची हुई state, log entry

आज़माएँ: सिक्योरिटी हेडर एनालाइज़र आज़माएँ: API ऑथेंटिकेशन टेस्टर आज़माएँ: कुकी एनालाइज़र

Worked example: एक endpoint, दस categories

एक customer portal logged-in customer को अपना invoice PDF में download करने देता है। इस request को list से गुज़ारने में कुछ ही मिनट लगते हैं और test conditions का एक छोटा, prioritized set मिलता है।

  • A01: customer A के invoice 8812 के लिए customer B के token से request दोहराएँ। Expected: 403 या 404, PDF कभी नहीं। यह भी पूछें कि stored PDF का कोई predictable direct URL तो नहीं जो इस check को skip कर दे। पहली priority: invoices में personal और financial data होता है।
  • A07 और A04: बिना token के request को 401 मिलना चाहिए; logout और expiry के बाद token काम करना बंद करे; response TLS पर जाए और किसी shared cache में cacheable न हो (Cache-Control: no-store या private)।
  • A02 और A10: /api/invoices/abc/pdf और /api/invoices/99999999/pdf request करें। Expected: सही status वाला छोटा error, कोई stack trace नहीं, headers में framework version नहीं।
  • A05 और A09: id numeric है, इसलिए quote वाली id भी भेजें, 8812'; response में database error exploitation के बिना भी finding है। Run के बाद developer से कहें कि आपके forbidden requests log में खोजें।
  • A03, A06 और A08 team के लिए सवाल हैं: कौन-सी PDF library और version invoice बनाती है (A03), क्या unpaid order का invoice बन सकता है (A06), और PDF server के अपने records से बनता है या client के भेजे values, जैसे amount, से बिना verification (A08)।
GET /api/invoices/8812/pdf HTTP/1.1
Host: portal.example.com
Authorization: Bearer <access token of customer A>
Accept: application/pdf

आज़माएँ: API रिक्वेस्ट बिल्डर आज़माएँ: JWT क्लेम एनालाइज़र आज़माएँ: स्पेशल कैरेक्टर डेटासेट जनरेटर

आम गलतियाँ

  • Top 10 को पूरा security test plan मानना; यह दस high-risk categories बताता है, हर weakness नहीं, और ASVS और WSTG इससे कहीं आगे जाते हैं।
  • Category को उसके साल के बिना लिखना, जिससे A03 दो पाठकों के लिए दो अलग चीज़ें हो जाए।
  • Scanner output बिना पढ़े report करना; scanner finding एक lead है जिसे टेस्टर reproduce करता है, classify करता है और false positives से साफ़ करता है।
  • सिर्फ़ UI से टेस्ट करना, जबकि ज़्यादातर checks को ऐसा request चाहिए जो UI कभी नहीं भेजता: दूसरी id, missing token, बदला हुआ role।
  • एक missing security header को confirmed cross-user data read से ऊपर रेट करना; impact से classify करें, जैसे risk-based testing में।
  • ऐसे system पर payloads भेजना जो आपका नहीं है या जिसके लिए लिखित अनुमति नहीं है।

QA का नज़रिया

टीम में यह list तीन मौक़ों पर आती है। Refinement में टेस्टर story पढ़कर पूछता है कि वह किन categories को छूती है: URL में id A01 को छूती है, नया input A05 और A10 को, login या token A07 को; ये functional conditions के बगल में test conditions बन जाती हैं। Execution में हर check request, response और verdict के रूप में रिकॉर्ड होता है, किसी भी test case की तरह, title में identifier के साथ।

Finding को category, exact request, expected और actual response, और exposed data या action पर आधारित severity के साथ report किया जाता है: personal data पर confirmed A01 finding आम तौर पर critical या blocker होती है। Release से पहले team बताती है कि कौन-सी categories जाँची गईं, कौन-सी out of scope थीं (A03 अक्सर build pipeline की होती है) और specialist penetration test को आगे क्या देखना चाहिए।

अभ्यास

Photo upload feature को Top 10 से map करें

आपका काम

Profile page logged-in user को POST /api/users/{id}/avatar से profile photo upload करने देता है: JPEG या PNG, अधिकतम 5 MB, object storage में stored और server के लौटाए URL पर user के profile में दिखती है।

OWASP Top 10:2025 की दस categories पर चलें। हर एक के लिए तय करें कि वह इस feature पर लागू होती है या नहीं, और अगर हाँ, तो पहला check लिखें जो आप करेंगे। फिर पहले चलाने वाले तीन checks चुनें और क्रम का कारण दें।

चरण
  1. दस categories उनके identifiers के साथ लिखें।
  2. हर एक को mark करें: लागू, आंशिक रूप से लागू, या team के लिए सवाल।
  3. हर लागू category के लिए एक check लिखें, request या observation के रूप में।
  4. Risk में पड़े data या action के हिसाब से top three को rank करें।
मॉडल उत्तर दिखाएँ
मॉडल उत्तर

A01: user A के token से user B की {id} पर upload करें; 403 या 404 और B की photo अपरिवर्तित रहने की अपेक्षा। ../ वाला file name भी आज़माएँ (path traversal, जिसे OWASP A01 से map करता है): file A की अपनी storage location से बाहर नहीं पहुँचनी चाहिए। A07: वही request बिना token और expired token के साथ; 401 और कुछ stored न होने की अपेक्षा। A05 और A10: 6 MB की file, .png नाम दी गई HTML file, quote वाला file name; extension नहीं बल्कि असली content के आधार पर साफ़ rejection, कोई stack trace नहीं, कुछ stored नहीं।

A02: लौटाए image URL के headers, और क्या storage bucket अपनी contents list करता है। A04: upload और image URL, दोनों पर HTTPS। A08: क्या request में कोई ऐसी value है जो server को ख़ुद तय करनी चाहिए, जैसे storage path या दिखाने वाला URL, और server उसे बिना verification मान लेता है। A09: क्या rejected uploads और cross-user attempts log होते हैं। A03 और A06 team के लिए सवाल: कौन-सी image library और version, और क्या private profile की photo उसका URL guess करने या सँभालकर रखने वाले किसी भी व्यक्ति को मिलती रहती है।

पहले तीन: A01 (दूसरे user की photo बदली जा सकती है), फिर A05 के तहत disguised HTML file (stored content दूसरे users के browsers में चल सकता है), फिर A07 (कोई भी बिना sign in किए upload कर सकता है)। हर एक दूसरे users को exposed करता है, सिर्फ़ टेस्टर का अपना account नहीं; A10 के तहत oversized file उसके बाद आती है, क्योंकि वह किसी दूसरे user के data को नहीं, बल्कि storage और availability को ख़तरे में डालती है।

अक्सर पूछे जाने वाले सवाल

क्या OWASP Top 10 और OWASP API Security Top 10 एक ही हैं?

नहीं। Top 10 web applications को आम तौर पर cover करता है; API Security Top 10 (2023) APIs के लिए अलग list है, जिसका पहला item broken object-level authorization है। APIs बनाने वाली teams दोनों इस्तेमाल करती हैं।

क्या Top 10 इस्तेमाल करने के लिए penetration-testing skills चाहिए?

नहीं। ज़्यादातर पहले checks बदली हुई id, token या input value वाले साधारण requests हैं, साथ में headers, errors और logs पढ़ना। Specialist penetration test उन्हीं categories में गहराई तक जाता है; आपके checks उसे सस्ता और ज़्यादा focused बनाते हैं।

कौन-सी category पहले टेस्ट करूँ?

जहाँ भी feature id से data या actions expose करता है, A01:2025 Broken Access Control से शुरू करें, फिर authentication और input handling। List की position से नहीं, बल्कि जो expose हो सकता है उसके impact से क्रम तय करें, जैसे risk-based testing में।

List 2021 और 2025 के बीच बदली। कौन-सी इस्तेमाल करूँ?

2025 edition इस्तेमाल करें और identifiers साल के साथ लिखें। अगर आपकी organisation की policy या tooling अभी भी 2021 categories बताती है, तो update होने तक findings को दोनों से map करें।

संदर्भ

  • OWASP Top 10:2025OWASP Foundation · 2025वेब एप्लिकेशन की दस सबसे गंभीर सुरक्षा जोखिम, हर एक की जाँच और रोकथाम के साथ।
  • OWASP Web Security Testing Guide (WSTG)OWASP Foundationवेब एप्लिकेशन और API की सुरक्षा कमज़ोरियों को परखने की संदर्भ कार्यप्रणाली, एक-एक टेस्ट के रूप में।
  • OWASP Application Security Verification Standard (ASVS)OWASP Foundationवेब एप्लिकेशन के लिए सत्यापन-योग्य सुरक्षा आवश्यकताओं की चेकलिस्ट, तीन एश्योरेंस स्तरों में।
  • OWASP API Security Top 10 (2023)OWASP Foundation · 2023API की दस सबसे आम कमज़ोरियाँ: ऑब्जेक्ट-लेवल ऑथराइज़ेशन का टूटना, ऑथेंटिकेशन का टूटना, अनियंत्रित रिसोर्स खपत और अन्य।

Mutqan tools से अभ्यास करें

पेस्ट किए गए हेडर या किसी सार्वजनिक URL से HTTP सुरक्षा हेडर (CSP, HSTS, X-Frame-Options, Referrer-Policy, Permissions-Policy, COOP/CORP) को ग्रेड दें।

वैलिडेशन

किसी endpoint पर Bearer, Basic, API-key और कस्टम-हेडर प्रमाणीकरण टेस्ट करें और अधिकृत बनाम अनधिकृत रिस्पॉन्स की तुलना करें।

API टेस्टिंग

Set-Cookie हेडर पार्स करें और Secure, HttpOnly, SameSite, Domain, Path, एक्सपायरी तथा साइज़ की सर्वोत्तम प्रथाएँ जाँचें।

वैलिडेशन

JWT क्लेम में गायब, जोखिम भरी या ग़ैर-मानक वैल्यू जाँचें और सुरक्षा संबंधी सुझाव पाएँ।

सुरक्षा

HTTP रिक्वेस्ट (method, URL, हेडर, auth, बॉडी) बनाएँ और भेजें, फिर रिस्पॉन्स जाँचें — आपके ब्राउज़र में हल्का-फुल्का Postman।

API टेस्टिंग

और गहराई से

इस topic में आपकी प्रगति

QA रोडमैप का हिस्सा