Application, API, and Cloud Attacks with Mitigation Mapping

Key Takeaways

  • Application attacks exploit a failed control: input validation, output encoding, authorization, authentication, session protection, secret handling, or configuration.
  • Injection sends untrusted input to an interpreter; cross-site scripting runs attacker-controlled script in a victim's browser.
  • Broken access control covers IDOR, privilege escalation, and missing object-level authorization - the top web risk on current OWASP guidance.
  • API attacks commonly target broken object-level authorization, excessive data exposure, mass assignment, and missing rate limits.
  • Cloud attacks abuse misconfiguration, public storage, overly permissive IAM, instance metadata services, and leaked access keys.
Last updated: June 2026

Identify the Failed Control

For application and cloud questions, name the control that failed: input validation, output encoding, authorization, authentication, session protection, secret handling, or configuration management. The right mitigation almost always restores that specific control rather than bolting on a generic device.

Application Attack Map

AttackWhat the attacker doesExample cluePrimary mitigation
SQL injectionAlters database query logic via input' OR '1'='1 in a login fieldParameterized queries, input validation, least-privilege DB account
Command injectionRuns OS commands through app input; cat /etc/passwdAvoid shell calls, allow-lists, sandboxing
Cross-site scripting (XSS)Runs script in another user's browserStored comment executes JavaScriptOutput encoding, sanitization, Content Security Policy, HttpOnly cookies
Cross-site request forgery (CSRF)Forces an authenticated browser to actHidden form submits a fund transferAnti-CSRF tokens, SameSite cookies, re-auth
Directory traversalReads files outside the web root../../etc/passwdCanonicalize paths, allow-lists, least privilege
Server-side request forgery (SSRF)Server makes attacker-chosen requestsApp fetches 169.254.169.254 metadataEgress filtering, metadata protections, URL allow-lists
Race condition (TOCTOU)Timing gap changes the resultCoupon redeemed twice (double-spend)Locking, atomic operations, idempotency keys
Insecure deserializationMalicious object triggers code/logicTampered serialized tokenSafe formats, signing, type validation
Buffer overflowInput exceeds a memory boundaryCrash or code execution in native codeMemory-safe languages, bounds checks, DEP/ASLR

Watch the XSS-versus-CSRF distinction: XSS executes attacker script in the victim's browser (a confidentiality/integrity problem on the client), while CSRF rides the victim's already-authenticated session to submit an action they did not intend. They are defended differently - encoding/CSP for XSS, tokens and SameSite cookies for CSRF.

API Attack Map

API weaknessScenario clueMitigation
Broken object-level authorization (IDOR)/api/users/1001 changed to 1002 returns dataAuthorize the principal for each object, every request
Excessive data exposureAPI returns SSN even though the UI hides itReturn only required fields server-side
Mass assignmentClient adds "isAdmin": true to the JSON bodyBind only an allow-list of fields
Missing rate limitsToken endpoint hammered by botsPer-user and per-IP throttling
Weak token handlingLong-lived bearer token in browser local storageShort-lived scoped tokens, secure storage, rotation
Poor versioningOld vulnerable API version stays exposedInventory, deprecate, enforce at the gateway

Cloud Attack Map

The shared responsibility model is the lens here: the provider secures the cloud (hardware, hypervisor), but the customer secures in the cloud (data, IAM, network rules, OS patching). Most cloud breaches in this domain are customer misconfigurations.

Cloud issueAttack pathMitigation
Public object storageAnonymous users read sensitive filesBlock public access, review bucket policy
Overly permissive IAMOne compromised user administers the accountLeast privilege, permission boundaries, access reviews
Leaked access keyA key in a repo or image is reused externallySecret scanning, rotation, workload identity
Metadata service abuseSSRF retrieves temporary instance credentialsIMDSv2, egress allow-lists, fix the SSRF
Open security groupManagement port (e.g., 22/3389) exposed to the internetRestrict source, VPN/bastion, just-in-time access
Insecure container imageKnown-vulnerable package ships to productionImage scanning, patching, signed images
Misconfigured loggingAttack leaves little traceEnable audit logs, centralize, protect retention

Mitigation Selection Worked Example

An authenticated user requests /api/invoices/8571. Changing the ID to 8572 returns another customer's invoice. This is broken object-level authorization (IDOR) - not SQL injection, because no database syntax is being injected. The only real fix is to verify, on every request, that the authenticated principal is authorized for the requested object.

Wrong fixWhy it is incomplete
Hide invoice IDs in the UIAttackers still tamper with the raw request
Encrypt transport with TLSTLS protects data in transit but enforces no authorization
Add a WAF onlyA WAF cannot reliably know business ownership of an object
Rename the endpointSecurity through obscurity does not add authorization

Common Traps

TrapBetter exam reasoning
Injection versus IDORInjection alters interpreter commands; IDOR bypasses object authorization
WAF as the only answerA WAF is compensating; fix the code or configuration when possible
Blame the cloud provider for IAM mistakesCustomer identity and configuration are the customer's responsibility
Treat SSRF as harmlessSSRF can reach the metadata service and steal cloud credentials

Quick Drill

(1) User input lands directly in a SQL WHERE clause - parameterized queries. (2) An API returns another user's record after only an ID change - enforce object-level authorization. (3) An app can fetch http://169.254.169.254 and reveal credentials - SSRF plus metadata-service risk; use IMDSv2 and egress filtering. (4) A storage bucket allows public read of confidential files - block public access and review the policy.

Test Your Knowledge

Changing /api/orders/100 to /api/orders/101 returns another customer's order. Which weakness is most likely?

A
B
C
D
Test Your Knowledge

Which mitigation most directly prevents SQL injection in application code?

A
B
C
D
Test Your KnowledgeMulti-Select

Which controls directly reduce cloud access-key exposure risk? Select two.

Select all that apply

Secret scanning and alerting
Rotating leaked keys promptly
Leaving keys in source control
Disabling audit logs