Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.
Web Vulnerabilities
Web applications sit at the intersection of users, browsers, APIs, databases, cloud services, identity providers, and third-party integrations. That makes them one of the most common places where security fails.This module focuses on the vulnerabilities developers and security professionals must understand first: broken access control, injection, insecure design, misconfiguration, vulnerable dependencies, integrity failures, SSRF, XSS, CSRF, and OAuth/API abuse.
OWASP Top 10 as a Mental Model
The OWASP Top 10 is not a checklist of every possible bug. It is a map of recurring risk categories. Use it to ask better design, code review, and testing questions.
OWASP category
Core question
A01 Broken Access Control
Can users do things they should not be allowed to do?
A02 Cryptographic Failures
Is sensitive data protected in transit and at rest?
A03 Injection
Can input become executable commands or queries?
A04 Insecure Design
Did the design miss necessary security controls?
A05 Security Misconfiguration
Are defaults, headers, cloud settings, or permissions unsafe?
A06 Vulnerable and Outdated Components
Are dependencies known vulnerable or abandoned?
A07 Identification and Authentication Failures
Can users or sessions be impersonated?
A08 Software and Data Integrity Failures
Can trusted code, updates, or data be tampered with?
A09 Logging and Monitoring Failures
Would you notice and investigate an attack?
A10 Server-Side Request Forgery
Can the server be tricked into making unsafe requests?
A01: Broken Access Control
Broken access control occurs when users can act outside their intended permissions.
Common Flaws
IDOR: Changing an ID in a URL or API request to access another user’s object.
Missing server-side authorization: The UI hides a button, but the API endpoint still allows the action.
Privilege escalation: A normal user reaches admin functionality.
Over-permissive roles: Users receive broad admin rights because role design is too coarse.
Tenant isolation failure: One customer can access another customer’s data in a SaaS product.
GET /api/invoices/1001# Attacker changes the ID:GET /api/invoices/1002
Client-side controls are not security controls. Authorization must be enforced on the server for every sensitive action and object.
Defenses
Deny by default.
Check authorization on every request.
Use object-level and function-level authorization.
Using deprecated algorithms such as MD5, SHA-1, DES, or RC4.
Storing passwords in plaintext or fast hashes.
Hardcoding encryption keys.
Misconfigured TLS.
Logging secrets, session tokens, or personal data.
Defenses:
Use TLS 1.2+ or TLS 1.3.
Hash passwords with Argon2id, bcrypt, or scrypt.
Encrypt sensitive data at rest where appropriate.
Store keys in a secret manager or KMS.
Redact secrets from logs.
A03: Injection
Injection happens when untrusted input becomes part of a command, query, template, or interpreter instruction.
SQL Injection
# Vulnerable: user input becomes SQL syntaxquery = "SELECT * FROM users WHERE email = '" + email + "'"# Safer: user input stays datacursor.execute("SELECT * FROM users WHERE email = %s", (email,))
Other Injection Types
Type
Target
Example risk
NoSQL injection
MongoDB, CouchDB
Bypass filters or authentication
Command injection
Operating system shell
Execute system commands
LDAP injection
Directory services
Bypass directory filters
Template injection
Server-side templates
Remote code execution
Prompt injection
AI-enabled workflows
Override tool or data boundaries
Defenses
Use parameterized queries.
Avoid shell execution with user-controlled input.
Validate input with allowlists.
Encode output by context.
Sandbox untrusted template or AI tool execution.
A04: Insecure Design
Insecure design is not a coding typo. It is a missing or flawed control in the system design.Examples:
Password reset allows unlimited attempts.
Checkout trusts client-side prices.
Data export has no rate limits or approval workflow.
Support staff can impersonate users without audit logging.
A low-privilege account type can reach privileged support or admin functions.
Defenses
Threat model before implementation.
Write abuse cases, not only user stories.
Add rate limits and fraud controls.
Make sensitive workflows auditable.
Require approval for bulk export, admin elevation, and key rotation.
A05: Security Misconfiguration
Misconfiguration is one of the most common real-world failure modes.Common examples:
Default credentials.
Public storage buckets.
Verbose stack traces in production.
Missing security headers.
Overly broad CORS.
Debug routes left enabled.
Excessive cloud IAM permissions.
Exposed admin panels.
Important Security Headers
Header
Purpose
Content-Security-Policy
Limits what scripts and resources can load
Strict-Transport-Security
Forces HTTPS for future visits
X-Frame-Options or CSP frame-ancestors
Reduces clickjacking risk
Referrer-Policy
Controls referrer leakage
Permissions-Policy
Restricts browser features
A06: Vulnerable and Outdated Components
Modern applications depend on frameworks, packages, containers, plugins, and build tools. Every dependency is part of your attack surface.Risks:
Known CVEs in old libraries.
Abandoned packages.
Compromised maintainers.
Typosquatted packages.
Malicious install scripts.
Transitive dependencies you never reviewed.
Defenses:
Use dependency scanning in CI.
Pin versions where reproducibility matters.
Review dependency changes in pull requests.
Remove unused packages.
Monitor security advisories.
Prefer packages with healthy maintenance and provenance.
A07: Identification and Authentication Failures
Authentication failures let attackers impersonate users.Common flaws:
Weak password requirements with no breached-password checks.
Missing MFA for admin accounts.
Session tokens that never expire.
Password reset tokens that are guessable or reusable.
MFA bypass on legacy protocols.
Login rate limiting missing or too weak.
Defenses:
Use password managers and breached-password checks.
Support phishing-resistant MFA.
Rotate sessions after privilege changes.
Protect password reset flows.
Log and alert on suspicious login patterns.
A08: Software and Data Integrity Failures
This category covers failures where software updates, CI/CD pipelines, plugins, packages, or data can be tampered with.Recent supply chain incidents involving poisoned developer tools show why this category matters.
Risk Patterns
Auto-updating plugins without review.
CI/CD workflows that run untrusted pull request code with secrets.
Unsigned releases.
Package registry tokens stored on developer machines.
Build scripts that download and execute remote code.
Webhooks that trust unsigned payloads.
Defenses
Require signed releases or provenance for critical artifacts.
Protect CI/CD secrets from untrusted workflows.
Verify webhook signatures.
Use branch protection and review requirements.
Rotate package publishing tokens.
Audit package publishes and release history.
Cross-Site Scripting
XSS occurs when untrusted data is rendered as executable script in a user’s browser.
Type
How it works
Stored XSS
Malicious script is saved and later shown to users
Reflected XSS
Malicious script arrives in a request and is reflected in the response
DOM XSS
Client-side JavaScript writes unsafe data into the page
Defenses
Encode output by context.
Use framework defaults that escape output.
Sanitize HTML when rich text is required.
Use Content Security Policy.
Avoid dangerous APIs such as innerHTML with untrusted data.
Cross-Site Request Forgery
CSRF tricks a user’s browser into sending an unwanted request to a site where they are already authenticated.Defenses:
Use SameSite cookies.
Require anti-CSRF tokens for state-changing requests.
Require re-authentication for sensitive actions.
Do not use GET requests for state changes.
A10: Server-Side Request Forgery
SSRF occurs when an attacker can make the server send requests to destinations of the attacker’s choice.
POST /api/fetch-url{"url": "http://169.254.169.254/latest/meta-data/"}
Impact:
Access internal admin panels.
Reach cloud metadata services.
Steal cloud credentials.
Scan internal networks.
Bypass network restrictions.
Defenses:
Allowlist permitted domains.
Block internal IP ranges and metadata endpoints.
Resolve and validate hostnames safely.
Disable redirects unless needed.
Use cloud metadata protections such as IMDSv2 on AWS.
OAuth and API Abuse
Many modern web incidents involve APIs and delegated access.Common risks:
OAuth apps request broad scopes.
Users grant access to malicious apps.
API tokens never expire.
Data export APIs have weak monitoring.
Service accounts have admin privileges.
Rate limits are missing for sensitive endpoints.
Defenses:
Use least-privilege scopes.
Require admin approval for high-risk OAuth apps.
Rotate API keys.
Monitor bulk exports and unusual API volume.
Use audit logs and alerting.
Separate service accounts by purpose.
Practical Lab Ideas
Build an intentionally vulnerable IDOR endpoint and then fix it with object-level authorization.
Exploit SQL injection in a lab, then replace it with parameterized queries.
Add a strict Content Security Policy to a test app and observe what breaks.
Create a fake webhook and verify it with HMAC signatures.
Simulate SSRF against a local metadata-like endpoint and then block it.
Review a dependency update and identify install scripts, new transitive packages, and permissions.
Key Takeaways
Authorize on the server.
Use parameterized queries.
Design abuse resistance before coding.
Treat dependencies, plugins, and CI/CD as attack surfaces.
Protect OAuth apps and API tokens.
Log enough to investigate, not just enough to debug.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Road To Cybersec","colors":{"primary":"#1E40AF","light":"#3B82F6","dark":"#1E3A8A"},"logo":{"light":"https://mintcdn.com/richardwollyce/cz5aG1aJIgzXgJFU/logo/light.svg?fit=max\u0026auto=format\u0026n=cz5aG1aJIgzXgJFU\u0026q=85\u0026s=fd89814c7dab9c5234e4fc39868eaf99","dark":"https://mintcdn.com/richardwollyce/cz5aG1aJIgzXgJFU/logo/dark.svg?fit=max\u0026auto=format\u0026n=cz5aG1aJIgzXgJFU\u0026q=85\u0026s=0b2b65bab0ded351a66e3464e3df8110"},"favicon":"https://mintcdn.com/richardwollyce/vjW9nh05Vox9FT6V/favicon.svg?fit=max\u0026auto=format\u0026n=vjW9nh05Vox9FT6V\u0026q=85\u0026s=70003e3b2955dca5d45bc9eb5bdfef8e","styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/richard-wollyce/road-to-cybersec"},{"anchor":"License","icon":"book","href":"/license"}]},"languages":[{"language":"en","default":true,"href":""},{"language":"pt-BR","href":"pt-br/essentials/essentials-overview"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"richardwollyce","hasAudioNarration":false,"actualSubdomain":"richardwollyce","customDomains":["roadtocybersec.com"],"gitSource":{"type":"github","owner":"richard-wollyce","repo":"road-to-cybersec","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae95786a9cd2a01522c5d8f:success","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"en","tag":"Advanced Topics","count":9},{"language":"pt-BR","tag":"Tópicos Avançados","count":9},{"language":"en","tag":"Essentials","count":6},{"language":"pt-BR","tag":"Fundamentos","count":6},{"language":"en","tag":"Welcome","count":1},{"language":"en","tag":"Workshop","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles/logo.css","content":"header img[src*=\"/logo/\"],.logo img,.navbar img[src*=\"/logo/\"],.mint-nav img[src*=\"/logo/\"]{height:48px!important;max-height:48px!important;width:auto!important}img[alt*=\"logo\"]{max-height:48px!important}.rtc-home{min-height:calc(100vh - 96px);max-width:760px;margin:0 auto;padding:6rem 1.25rem;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.rtc-home h1{margin:0;font-size:clamp(2.25rem, 7vw, 4.5rem);line-height:1}.rtc-home-description{margin:1.25rem 0 0;max-width:620px;font-size:1.2rem;line-height:1.7}.rtc-home-actions{margin-top:1.75rem;display:flex;flex-wrap:wrap;justify-content:center;gap:0.875rem}.rtc-home-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0.75rem 1rem;border-radius:8px;font-weight:600;text-decoration:none!important;border:1px solid transparent;transition:all 0.2s ease-in-out}.rtc-home-button-primary{border-color:#1e40af;color:#1e40af!important;background:transparent}.rtc-home-button-primary:hover{background:#1e40af;color:#ffffff!important}.rtc-home-button-secondary{border-color:#1e40af;color:#1e40af!important;background:transparent}.rtc-home-button-secondary:hover{background:#1e40af;color:#ffffff!important}html.dark .rtc-home-button-primary{border-color:#1e40af;color:#ffffff!important;background:transparent}html.dark .rtc-home-button-primary:hover{background:#1e40af;color:#ffffff!important}html.dark .rtc-home-button-secondary{border-color:#1e40af;color:#ffffff!important;background:transparent}html.dark .rtc-home-button-secondary:hover{background:#1e40af;color:#ffffff!important}.rtc-home-eyebrow{margin:2rem 0 0.75rem;letter-spacing:0.21em;font-size:0.875rem;font-weight:300;color:var(--primary-color, #252525)}html.dark .rtc-home-eyebrow{margin:2rem 0 0.75rem;letter-spacing:0.21em;font-size:0.875rem;font-weight:300;color:var(--primary-color, #fafafa8e)}"}]}
{"page":{"pagePath":"advanced/web-vulnerabilities","slug":"/advanced/web-vulnerabilities","pageMetadata":{"title":"Web Vulnerabilities","description":"Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.","href":"/advanced/web-vulnerabilities"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`web-vulnerabilities`,children:`Web Vulnerabilities`}),`\n`,_jsx(_components.p,{children:`Web applications sit at the intersection of users, browsers, APIs, databases, cloud services, identity providers, and third-party integrations. That makes them one of the most common places where security fails.`}),`\n`,_jsx(_components.p,{children:`This module focuses on the vulnerabilities developers and security professionals must understand first: broken access control, injection, insecure design, misconfiguration, vulnerable dependencies, integrity failures, SSRF, XSS, CSRF, and OAuth/API abuse.`}),`\n`,_jsx(Heading,{level:`2`,id:`owasp-top-10-as-a-mental-model`,children:`OWASP Top 10 as a Mental Model`}),`\n`,_jsx(_components.p,{children:`The OWASP Top 10 is not a checklist of every possible bug. It is a map of recurring risk categories. Use it to ask better design, code review, and testing questions.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`OWASP category`}),_jsx(_components.th,{children:`Core question`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A01 Broken Access Control`}),_jsx(_components.td,{children:`Can users do things they should not be allowed to do?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A02 Cryptographic Failures`}),_jsx(_components.td,{children:`Is sensitive data protected in transit and at rest?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A03 Injection`}),_jsx(_components.td,{children:`Can input become executable commands or queries?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A04 Insecure Design`}),_jsx(_components.td,{children:`Did the design miss necessary security controls?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A05 Security Misconfiguration`}),_jsx(_components.td,{children:`Are defaults, headers, cloud settings, or permissions unsafe?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A06 Vulnerable and Outdated Components`}),_jsx(_components.td,{children:`Are dependencies known vulnerable or abandoned?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A07 Identification and Authentication Failures`}),_jsx(_components.td,{children:`Can users or sessions be impersonated?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A08 Software and Data Integrity Failures`}),_jsx(_components.td,{children:`Can trusted code, updates, or data be tampered with?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A09 Logging and Monitoring Failures`}),_jsx(_components.td,{children:`Would you notice and investigate an attack?`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`A10 Server-Side Request Forgery`}),_jsx(_components.td,{children:`Can the server be tricked into making unsafe requests?`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`a01-broken-access-control`,children:`A01: Broken Access Control`}),`\n`,_jsx(_components.p,{children:`Broken access control occurs when users can act outside their intended permissions.`}),`\n`,_jsx(Heading,{level:`3`,id:`common-flaws`,children:`Common Flaws`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`IDOR`}),`: Changing an ID in a URL or API request to access another user’s object.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Missing server-side authorization`}),`: The UI hides a button, but the API endpoint still allows the action.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Privilege escalation`}),`: A normal user reaches admin functionality.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Over-permissive roles`}),`: Users receive broad admin rights because role design is too coarse.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Tenant isolation failure`}),`: One customer can access another customer’s data in a SaaS product.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`GET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` /api/invoices/1001`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Attacker changes the ID:`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`GET`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` /api/invoices/1002`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Client-side controls are not security controls. Authorization must be enforced on the server for every sensitive action and object.`})}),`\n`,_jsx(Heading,{level:`3`,id:`defenses`,children:`Defenses`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Deny by default.`}),`\n`,_jsx(_components.li,{children:`Check authorization on every request.`}),`\n`,_jsx(_components.li,{children:`Use object-level and function-level authorization.`}),`\n`,_jsx(_components.li,{children:`Log authorization failures.`}),`\n`,_jsx(_components.li,{children:`Test tenant boundaries and role boundaries.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`a02-cryptographic-failures`,children:`A02: Cryptographic Failures`}),`\n`,_jsx(_components.p,{children:`Cryptographic failures expose sensitive data.`}),`\n`,_jsx(_components.p,{children:`Common flaws:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Sending sensitive data over HTTP.`}),`\n`,_jsx(_components.li,{children:`Using deprecated algorithms such as MD5, SHA-1, DES, or RC4.`}),`\n`,_jsx(_components.li,{children:`Storing passwords in plaintext or fast hashes.`}),`\n`,_jsx(_components.li,{children:`Hardcoding encryption keys.`}),`\n`,_jsx(_components.li,{children:`Misconfigured TLS.`}),`\n`,_jsx(_components.li,{children:`Logging secrets, session tokens, or personal data.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Defenses:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Use TLS 1.2+ or TLS 1.3.`}),`\n`,_jsx(_components.li,{children:`Hash passwords with Argon2id, bcrypt, or scrypt.`}),`\n`,_jsx(_components.li,{children:`Encrypt sensitive data at rest where appropriate.`}),`\n`,_jsx(_components.li,{children:`Store keys in a secret manager or KMS.`}),`\n`,_jsx(_components.li,{children:`Redact secrets from logs.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`a03-injection`,children:`A03: Injection`}),`\n`,_jsx(_components.p,{children:`Injection happens when untrusted input becomes part of a command, query, template, or interpreter instruction.`}),`\n`,_jsx(Heading,{level:`3`,id:`sql-injection`,children:`SQL Injection`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Vulnerable: user input becomes SQL syntax`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`query `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"SELECT * FROM users WHERE email = '\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` email `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"'\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Safer: user input stays data`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`cursor.execute(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SELECT * FROM users WHERE email = `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`%s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, (email,))`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`other-injection-types`,children:`Other Injection Types`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Target`}),_jsx(_components.th,{children:`Example risk`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`NoSQL injection`})}),_jsx(_components.td,{children:`MongoDB, CouchDB`}),_jsx(_components.td,{children:`Bypass filters or authentication`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Command injection`})}),_jsx(_components.td,{children:`Operating system shell`}),_jsx(_components.td,{children:`Execute system commands`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`LDAP injection`})}),_jsx(_components.td,{children:`Directory services`}),_jsx(_components.td,{children:`Bypass directory filters`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Template injection`})}),_jsx(_components.td,{children:`Server-side templates`}),_jsx(_components.td,{children:`Remote code execution`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Prompt injection`})}),_jsx(_components.td,{children:`AI-enabled workflows`}),_jsx(_components.td,{children:`Override tool or data boundaries`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`defenses-2`,children:`Defenses`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Use parameterized queries.`}),`\n`,_jsx(_components.li,{children:`Avoid shell execution with user-controlled input.`}),`\n`,_jsx(_components.li,{children:`Validate input with allowlists.`}),`\n`,_jsx(_components.li,{children:`Encode output by context.`}),`\n`,_jsx(_components.li,{children:`Sandbox untrusted template or AI tool execution.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`a04-insecure-design`,children:`A04: Insecure Design`}),`\n`,_jsx(_components.p,{children:`Insecure design is not a coding typo. It is a missing or flawed control in the system design.`}),`\n`,_jsx(_components.p,{children:`Examples:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Password reset allows unlimited attempts.`}),`\n`,_jsx(_components.li,{children:`Checkout trusts client-side prices.`}),`\n`,_jsx(_components.li,{children:`Data export has no rate limits or approval workflow.`}),`\n`,_jsx(_components.li,{children:`Support staff can impersonate users without audit logging.`}),`\n`,_jsx(_components.li,{children:`A low-privilege account type can reach privileged support or admin functions.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`defenses-3`,children:`Defenses`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Threat model before implementation.`}),`\n`,_jsx(_components.li,{children:`Write abuse cases, not only user stories.`}),`\n`,_jsx(_components.li,{children:`Add rate limits and fraud controls.`}),`\n`,_jsx(_components.li,{children:`Make sensitive workflows auditable.`}),`\n`,_jsx(_components.li,{children:`Require approval for bulk export, admin elevation, and key rotation.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`a05-security-misconfiguration`,children:`A05: Security Misconfiguration`}),`\n`,_jsx(_components.p,{children:`Misconfiguration is one of the most common real-world failure modes.`}),`\n`,_jsx(_components.p,{children:`Common examples:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Default credentials.`}),`\n`,_jsx(_components.li,{children:`Public storage buckets.`}),`\n`,_jsx(_components.li,{children:`Verbose stack traces in production.`}),`\n`,_jsx(_components.li,{children:`Missing security headers.`}),`\n`,_jsx(_components.li,{children:`Overly broad CORS.`}),`\n`,_jsx(_components.li,{children:`Debug routes left enabled.`}),`\n`,_jsx(_components.li,{children:`Excessive cloud IAM permissions.`}),`\n`,_jsx(_components.li,{children:`Exposed admin panels.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`important-security-headers`,children:`Important Security Headers`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Purpose`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Content-Security-Policy`})}),_jsx(_components.td,{children:`Limits what scripts and resources can load`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Strict-Transport-Security`})}),_jsx(_components.td,{children:`Forces HTTPS for future visits`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`X-Frame-Options`}),` or CSP `,_jsx(_components.code,{children:`frame-ancestors`})]}),_jsx(_components.td,{children:`Reduces clickjacking risk`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Referrer-Policy`})}),_jsx(_components.td,{children:`Controls referrer leakage`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Permissions-Policy`})}),_jsx(_components.td,{children:`Restricts browser features`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`a06-vulnerable-and-outdated-components`,children:`A06: Vulnerable and Outdated Components`}),`\n`,_jsx(_components.p,{children:`Modern applications depend on frameworks, packages, containers, plugins, and build tools. Every dependency is part of your attack surface.`}),`\n`,_jsx(_components.p,{children:`Risks:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Known CVEs in old libraries.`}),`\n`,_jsx(_components.li,{children:`Abandoned packages.`}),`\n`,_jsx(_components.li,{children:`Compromised maintainers.`}),`\n`,_jsx(_components.li,{children:`Typosquatted packages.`}),`\n`,_jsx(_components.li,{children:`Malicious install scripts.`}),`\n`,_jsx(_components.li,{children:`Transitive dependencies you never reviewed.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Defenses:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Use dependency scanning in CI.`}),`\n`,_jsx(_components.li,{children:`Pin versions where reproducibility matters.`}),`\n`,_jsx(_components.li,{children:`Review dependency changes in pull requests.`}),`\n`,_jsx(_components.li,{children:`Remove unused packages.`}),`\n`,_jsx(_components.li,{children:`Monitor security advisories.`}),`\n`,_jsx(_components.li,{children:`Prefer packages with healthy maintenance and provenance.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`a07-identification-and-authentication-failures`,children:`A07: Identification and Authentication Failures`}),`\n`,_jsx(_components.p,{children:`Authentication failures let attackers impersonate users.`}),`\n`,_jsx(_components.p,{children:`Common flaws:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Weak password requirements with no breached-password checks.`}),`\n`,_jsx(_components.li,{children:`Missing MFA for admin accounts.`}),`\n`,_jsx(_components.li,{children:`Session tokens that never expire.`}),`\n`,_jsx(_components.li,{children:`Password reset tokens that are guessable or reusable.`}),`\n`,_jsx(_components.li,{children:`MFA bypass on legacy protocols.`}),`\n`,_jsx(_components.li,{children:`Login rate limiting missing or too weak.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Defenses:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Use password managers and breached-password checks.`}),`\n`,_jsx(_components.li,{children:`Support phishing-resistant MFA.`}),`\n`,_jsx(_components.li,{children:`Rotate sessions after privilege changes.`}),`\n`,_jsx(_components.li,{children:`Protect password reset flows.`}),`\n`,_jsx(_components.li,{children:`Log and alert on suspicious login patterns.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`a08-software-and-data-integrity-failures`,children:`A08: Software and Data Integrity Failures`}),`\n`,_jsx(_components.p,{children:`This category covers failures where software updates, CI/CD pipelines, plugins, packages, or data can be tampered with.`}),`\n`,_jsx(_components.p,{children:`Recent supply chain incidents involving poisoned developer tools show why this category matters.`}),`\n`,_jsx(Heading,{level:`3`,id:`risk-patterns`,children:`Risk Patterns`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Auto-updating plugins without review.`}),`\n`,_jsx(_components.li,{children:`CI/CD workflows that run untrusted pull request code with secrets.`}),`\n`,_jsx(_components.li,{children:`Unsigned releases.`}),`\n`,_jsx(_components.li,{children:`Package registry tokens stored on developer machines.`}),`\n`,_jsx(_components.li,{children:`Build scripts that download and execute remote code.`}),`\n`,_jsx(_components.li,{children:`Webhooks that trust unsigned payloads.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`defenses-4`,children:`Defenses`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Require signed releases or provenance for critical artifacts.`}),`\n`,_jsx(_components.li,{children:`Protect CI/CD secrets from untrusted workflows.`}),`\n`,_jsx(_components.li,{children:`Verify webhook signatures.`}),`\n`,_jsx(_components.li,{children:`Use branch protection and review requirements.`}),`\n`,_jsx(_components.li,{children:`Rotate package publishing tokens.`}),`\n`,_jsx(_components.li,{children:`Audit package publishes and release history.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`cross-site-scripting`,children:`Cross-Site Scripting`}),`\n`,_jsx(_components.p,{children:`XSS occurs when untrusted data is rendered as executable script in a user’s browser.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`How it works`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Stored XSS`})}),_jsx(_components.td,{children:`Malicious script is saved and later shown to users`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Reflected XSS`})}),_jsx(_components.td,{children:`Malicious script arrives in a request and is reflected in the response`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`DOM XSS`})}),_jsx(_components.td,{children:`Client-side JavaScript writes unsafe data into the page`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`defenses-5`,children:`Defenses`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Encode output by context.`}),`\n`,_jsx(_components.li,{children:`Use framework defaults that escape output.`}),`\n`,_jsx(_components.li,{children:`Sanitize HTML when rich text is required.`}),`\n`,_jsx(_components.li,{children:`Use Content Security Policy.`}),`\n`,_jsxs(_components.li,{children:[`Avoid dangerous APIs such as `,_jsx(_components.code,{children:`innerHTML`}),` with untrusted data.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`cross-site-request-forgery`,children:`Cross-Site Request Forgery`}),`\n`,_jsx(_components.p,{children:`CSRF tricks a user’s browser into sending an unwanted request to a site where they are already authenticated.`}),`\n`,_jsx(_components.p,{children:`Defenses:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Use SameSite cookies.`}),`\n`,_jsx(_components.li,{children:`Require anti-CSRF tokens for state-changing requests.`}),`\n`,_jsx(_components.li,{children:`Require re-authentication for sensitive actions.`}),`\n`,_jsx(_components.li,{children:`Do not use GET requests for state changes.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`a10-server-side-request-forgery`,children:`A10: Server-Side Request Forgery`}),`\n`,_jsx(_components.p,{children:`SSRF occurs when an attacker can make the server send requests to destinations of the attacker’s choice.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`POST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` /api/fetch-url`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"http://169.254.169.254/latest/meta-data/\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Impact:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Access internal admin panels.`}),`\n`,_jsx(_components.li,{children:`Reach cloud metadata services.`}),`\n`,_jsx(_components.li,{children:`Steal cloud credentials.`}),`\n`,_jsx(_components.li,{children:`Scan internal networks.`}),`\n`,_jsx(_components.li,{children:`Bypass network restrictions.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Defenses:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Allowlist permitted domains.`}),`\n`,_jsx(_components.li,{children:`Block internal IP ranges and metadata endpoints.`}),`\n`,_jsx(_components.li,{children:`Resolve and validate hostnames safely.`}),`\n`,_jsx(_components.li,{children:`Disable redirects unless needed.`}),`\n`,_jsx(_components.li,{children:`Use cloud metadata protections such as IMDSv2 on AWS.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`oauth-and-api-abuse`,children:`OAuth and API Abuse`}),`\n`,_jsx(_components.p,{children:`Many modern web incidents involve APIs and delegated access.`}),`\n`,_jsx(_components.p,{children:`Common risks:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`OAuth apps request broad scopes.`}),`\n`,_jsx(_components.li,{children:`Users grant access to malicious apps.`}),`\n`,_jsx(_components.li,{children:`API tokens never expire.`}),`\n`,_jsx(_components.li,{children:`Data export APIs have weak monitoring.`}),`\n`,_jsx(_components.li,{children:`Service accounts have admin privileges.`}),`\n`,_jsx(_components.li,{children:`Rate limits are missing for sensitive endpoints.`}),`\n`]}),`\n`,_jsx(_components.p,{children:`Defenses:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Use least-privilege scopes.`}),`\n`,_jsx(_components.li,{children:`Require admin approval for high-risk OAuth apps.`}),`\n`,_jsx(_components.li,{children:`Rotate API keys.`}),`\n`,_jsx(_components.li,{children:`Monitor bulk exports and unusual API volume.`}),`\n`,_jsx(_components.li,{children:`Use audit logs and alerting.`}),`\n`,_jsx(_components.li,{children:`Separate service accounts by purpose.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`practical-lab-ideas`,children:`Practical Lab Ideas`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Build an intentionally vulnerable IDOR endpoint and then fix it with object-level authorization.`}),`\n`,_jsx(_components.li,{children:`Exploit SQL injection in a lab, then replace it with parameterized queries.`}),`\n`,_jsx(_components.li,{children:`Add a strict Content Security Policy to a test app and observe what breaks.`}),`\n`,_jsx(_components.li,{children:`Create a fake webhook and verify it with HMAC signatures.`}),`\n`,_jsx(_components.li,{children:`Simulate SSRF against a local metadata-like endpoint and then block it.`}),`\n`,_jsx(_components.li,{children:`Review a dependency update and identify install scripts, new transitive packages, and permissions.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`key-takeaways`,children:`Key Takeaways`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Authorize on the server`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Use parameterized queries`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Design abuse resistance before coding`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Treat dependencies, plugins, and CI/CD as attack surfaces`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Protect OAuth apps and API tokens`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Log enough to investigate, not just enough to debug`}),`.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Web Vulnerabilities","description":"Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.","href":"/advanced/web-vulnerabilities"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Web Vulnerabilities","slug":"web-vulnerabilities","depth":1,"children":[]},{"title":"OWASP Top 10 as a Mental Model","slug":"owasp-top-10-as-a-mental-model","depth":2,"children":[]},{"title":"A01: Broken Access Control","slug":"a01-broken-access-control","depth":2,"children":[{"title":"Common Flaws","slug":"common-flaws","depth":3,"children":[]},{"title":"Defenses","slug":"defenses","depth":3,"children":[]}]},{"title":"A02: Cryptographic Failures","slug":"a02-cryptographic-failures","depth":2,"children":[]},{"title":"A03: Injection","slug":"a03-injection","depth":2,"children":[{"title":"SQL Injection","slug":"sql-injection","depth":3,"children":[]},{"title":"Other Injection Types","slug":"other-injection-types","depth":3,"children":[]},{"title":"Defenses","slug":"defenses-2","depth":3,"children":[]}]},{"title":"A04: Insecure Design","slug":"a04-insecure-design","depth":2,"children":[{"title":"Defenses","slug":"defenses-3","depth":3,"children":[]}]},{"title":"A05: Security Misconfiguration","slug":"a05-security-misconfiguration","depth":2,"children":[{"title":"Important Security Headers","slug":"important-security-headers","depth":3,"children":[]}]},{"title":"A06: Vulnerable and Outdated Components","slug":"a06-vulnerable-and-outdated-components","depth":2,"children":[]},{"title":"A07: Identification and Authentication Failures","slug":"a07-identification-and-authentication-failures","depth":2,"children":[]},{"title":"A08: Software and Data Integrity Failures","slug":"a08-software-and-data-integrity-failures","depth":2,"children":[{"title":"Risk Patterns","slug":"risk-patterns","depth":3,"children":[]},{"title":"Defenses","slug":"defenses-4","depth":3,"children":[]}]},{"title":"Cross-Site Scripting","slug":"cross-site-scripting","depth":2,"children":[{"title":"Defenses","slug":"defenses-5","depth":3,"children":[]}]},{"title":"Cross-Site Request Forgery","slug":"cross-site-request-forgery","depth":2,"children":[]},{"title":"A10: Server-Side Request Forgery","slug":"a10-server-side-request-forgery","depth":2,"children":[]},{"title":"OAuth and API Abuse","slug":"oauth-and-api-abuse","depth":2,"children":[]},{"title":"Practical Lab Ideas","slug":"practical-lab-ideas","depth":2,"children":[]},{"title":"Key Takeaways","slug":"key-takeaways","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"richardwollyce","siteName":"Road To Cybersec","title":"Web Vulnerabilities - Road To Cybersec","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/advanced/web-vulnerabilities","matchLevel":0},"pt-BR":{"href":"/pt-br/advanced/web-vulnerabilities","matchLevel":1}}},"lastModified":"2026-05-24T04:28:44.232Z","originalFileLocation":"advanced/web-vulnerabilities.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Road To Cybersec\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Web Vulnerabilities - Road To Cybersec\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Road To Cybersec\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://roadtocybersec.com/advanced/web-vulnerabilities\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://richardwollyce.mintlify.site/_mintlify/api/og/v2?division=Advanced+Topics\u0026amp;title=Web+Vulnerabilities\u0026amp;description=Learn+the+OWASP+Top+10%2C+access+control%2C+injection%2C+XSS%2C+SSRF%2C+software+integrity+failures%2C+OAuth+abuse%2C+API+risks%2C+and+secure+web+defenses.\u0026amp;theme=13e12c4fba3ae563774d290f\u0026amp;signature=cd4c4247460c35239ed2cd426844fd0e4ba7a207b69d1c0ffc971df04c021cc0\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Web Vulnerabilities - Road To Cybersec\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://richardwollyce.mintlify.site/_mintlify/api/og/v2?division=Advanced+Topics\u0026amp;title=Web+Vulnerabilities\u0026amp;description=Learn+the+OWASP+Top+10%2C+access+control%2C+injection%2C+XSS%2C+SSRF%2C+software+integrity+failures%2C+OAuth+abuse%2C+API+risks%2C+and+secure+web+defenses.\u0026amp;theme=13e12c4fba3ae563774d290f\u0026amp;signature=cd4c4247460c35239ed2cd426844fd0e4ba7a207b69d1c0ffc971df04c021cc0\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/richardwollyce/zW2Tc3K73A_SSlMw/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Road To Cybersec\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1E40AF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://roadtocybersec.com/advanced/web-vulnerabilities\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/advanced/web-vulnerabilities.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://roadtocybersec.com/advanced/web-vulnerabilities\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt-BR\" href=\"https://roadtocybersec.com/pt-br/advanced/web-vulnerabilities\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://roadtocybersec.com/advanced/web-vulnerabilities\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://roadtocybersec.com/#organization\",\"name\":\"Road To Cybersec\",\"url\":\"https://roadtocybersec.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/richardwollyce/cz5aG1aJIgzXgJFU/logo/light.svg?fit=max\u0026auto=format\u0026n=cz5aG1aJIgzXgJFU\u0026q=85\u0026s=fd89814c7dab9c5234e4fc39868eaf99\"}},{\"@type\":\"WebSite\",\"@id\":\"https://roadtocybersec.com#website\",\"name\":\"Road To Cybersec\",\"url\":\"https://roadtocybersec.com\",\"publisher\":{\"@id\":\"https://roadtocybersec.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://roadtocybersec.com/advanced/web-vulnerabilities#webpage\",\"url\":\"https://roadtocybersec.com/advanced/web-vulnerabilities\",\"name\":\"Web Vulnerabilities\",\"description\":\"Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.\",\"dateModified\":\"2026-05-24T04:28:44.232Z\",\"isPartOf\":{\"@id\":\"https://roadtocybersec.com#website\"},\"breadcrumb\":{\"@id\":\"https://roadtocybersec.com/advanced/web-vulnerabilities#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://roadtocybersec.com/advanced/web-vulnerabilities#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Advanced Topics\",\"item\":\"https://roadtocybersec.com/advanced/network-security\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Vulnerabilities\",\"item\":\"https://roadtocybersec.com/advanced/web-vulnerabilities\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://roadtocybersec.com/advanced/web-vulnerabilities#article\",\"headline\":\"Web Vulnerabilities\",\"name\":\"Web Vulnerabilities\",\"description\":\"Learn the OWASP Top 10, access control, injection, XSS, SSRF, software integrity failures, OAuth abuse, API risks, and secure web defenses.\",\"url\":\"https://roadtocybersec.com/advanced/web-vulnerabilities\",\"mainEntityOfPage\":{\"@id\":\"https://roadtocybersec.com/advanced/web-vulnerabilities#webpage\"},\"dateModified\":\"2026-05-24T04:28:44.232Z\",\"publisher\":{\"@id\":\"https://roadtocybersec.com/#organization\"},\"isPartOf\":{\"@id\":\"https://roadtocybersec.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Road To Cybersec\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Road To Cybersec\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/advanced/web-vulnerabilities.md","siteName":"Road To Cybersec","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/richard-wollyce/road-to-cybersec"},{"anchor":"License","icon":"book","href":"/license"}]},"languages":[{"language":"en","default":true,"groups":[{"group":"Welcome","pages":[{"title":"Introduction","mode":"custom","href":""}]},{"group":"Essentials","pages":[{"title":"Essentials Overview","href":"/essentials/essentials-overview"},{"title":"Threats and Attacks","href":"/essentials/threats-and-attacks"},{"title":"Password Security and MFA","href":"/essentials/password-security"},{"title":"Safe Browsing","href":"/essentials/safe-browsing"},{"title":"Device Hygiene","href":"/essentials/device-hygiene"},{"title":"What to Do If Hacked","href":"/essentials/what-to-do-if-hacked"}]},{"group":"Advanced Topics","pages":[{"title":"Network Security","href":"/advanced/network-security"},{"title":"Cryptography","description":"Understand encryption, hashing, digital signatures, TLS, key exchange, certificate chains, password hashing, signing, provenance, and post-quantum cryptography.","href":"/advanced/cryptography"},{"title":"Web Vulnerabilities","href":"/advanced/web-vulnerabilities"},{"title":"Secure Coding Practices","description":"Build secure software with input validation, output encoding, authorization, secrets management, dependency security, CI/CD hardening, provenance, and threat modeling.","href":"/advanced/secure-coding-practices"},{"title":"Advanced Supply Chain Security","href":"/advanced/supply-chain-security"},{"title":"AI Security and LLM Risks","href":"/advanced/ai-security"},{"title":"Penetration Testing","href":"/advanced/penetration-testing"},{"title":"The Cypherpunks","href":"/advanced/cypherpunks"},{"title":"The GitHub Issue: CI/CD Supply Chain Attack","href":"/advanced/github-issue"}]},{"group":"Workshop","pages":[{"title":"Workshop","href":"/workshop/get-in-touch"}]}]},{"language":"pt-BR","pages":[{"title":"pt-BR","href":"/pt-br/advanced/web-vulnerabilities"}]}]},"basePath":"","title":"Web Vulnerabilities - Road To Cybersec","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":[],"chunks":[]}