Application, API, and Cloud Attacks with Mitigation Mapping

Key Takeaways

  • Application attacks often exploit input handling, authorization, session management, insecure design, or exposed components.
  • Injection sends untrusted input to an interpreter; XSS runs attacker-controlled script in a user browser.
  • Broken access control includes IDOR, privilege escalation, and missing object-level authorization.
  • API attacks commonly target weak authentication, excessive data exposure, mass assignment, and missing rate limits.
  • Cloud attacks often abuse misconfiguration, exposed storage, overly permissive IAM, metadata services, and leaked keys.
Last updated: April 2026

Application, API, and Cloud Attacks with Mitigation Mapping

For application and cloud questions, identify the failed control: input validation, output encoding, authorization, authentication, session protection, secret handling, or configuration management.

Application Attack Map

AttackWhat the attacker doesExample cluePrimary mitigations
SQL injectionSends input that changes database query logic' OR '1'='1 in login fieldParameterized queries, input validation, least-privilege DB account
Command injectionRuns OS commands through app input; cat /etc/passwdAvoid shell calls, allow lists, sandboxing
XSSRuns script in another user's browserStored comment executes JavaScriptOutput encoding, sanitization, CSP, HttpOnly cookies
CSRFTricks authenticated browser into unwanted actionHidden form submits transferAnti-CSRF tokens, SameSite cookies, reauthentication
Directory traversalAccesses files outside intended path../../etc/passwdCanonicalize paths, allow lists, least privilege
SSRFServer is tricked into making internal requestApp fetches metadata URLEgress filtering, metadata protections, URL allow lists
Race conditionTiming issue changes expected resultDouble-spend or duplicate redemptionLocking, atomic operations, idempotency
Insecure deserializationMalicious object triggers code or logic abuseTampered serialized tokenSafe formats, signing, validation
Buffer overflowInput exceeds memory boundaryCrash or code execution in native appMemory-safe languages, bounds checks, DEP/ASLR

API Attack Map

API weaknessScenario clueMitigation
Broken object-level authorization/api/users/1001 changed to /api/users/1002 worksCheck authorization for each object
Excessive data exposureAPI returns SSN though UI hides itReturn only required fields
Mass assignmentUser sets "isAdmin": true in JSONBind allowed fields only
Missing rate limitsToken endpoint hammered by botsPer-user and per-IP throttling
Weak token handlingLong-lived bearer token in local storageShort-lived scoped tokens, secure storage, rotation
Poor versioningOld vulnerable API remains exposedInventory, deprecate, gateway controls

Cloud Attack Map

Cloud issueAttack pathMitigation
Public object storageAnonymous users read sensitive filesBlock public access, bucket policy review
Overly permissive IAMCompromised user can administer accountLeast privilege, permission boundaries, access reviews
Leaked access keyKey in repo or image is used externallySecret scanning, rotation, workload identity
Metadata service abuseSSRF retrieves temporary credentialsIMDS protections, egress allow lists, SSRF fixes
Open security groupManagement port exposed to internetRestrict source, VPN or bastion, just-in-time access
Insecure container imageKnown vulnerable package deployedImage scanning, patching, signed images
Misconfigured loggingAttack leaves little traceEnable audit logs, centralize, protect retention

Mitigation Selection Worked Example

An API endpoint lets an authenticated user request /api/invoices/8571. Changing the ID to 8572 returns another customer's invoice. This is not SQL injection unless database syntax is involved. It is broken object-level authorization, often called IDOR. The fix is to check that the authenticated principal is authorized for the requested invoice object every time.

Wrong fixWhy it is incomplete
Hide invoice IDs in the UIAttackers can still modify requests
Encrypt transport with TLSTLS protects the request in transit but does not enforce authorization
Add a WAF onlyWAF may reduce obvious attacks but cannot know business ownership reliably
Rename the endpointSecurity through obscurity does not fix missing authorization

Common Traps

TrapBetter exam reasoning
XSS versus CSRFXSS executes script in the browser; CSRF abuses an authenticated browser to submit an action
Injection versus IDORInjection changes interpreter commands; IDOR bypasses object authorization
WAF as the only answerWAF is compensating; fix code or configuration when possible
Cloud provider blamed for customer IAM mistakesIn cloud, customer configuration and identity choices are often customer responsibility

Quick Drill

  1. User input becomes part of a SQL WHERE clause: use parameterized queries.
  2. API returns another user's record after changing only an ID: enforce object-level authorization.
  3. Web app can request http://169.254.169.254 and reveal credentials: SSRF plus metadata service risk.
  4. Storage bucket permits public read of confidential files: remove public access and review policy.
Test Your Knowledge

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

A
B
C
D
Test Your Knowledge

Which mitigation best prevents SQL injection in application code?

A
B
C
D
Test Your KnowledgeMulti-Select

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

Select all that apply

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