← All Cheatsheets
Security
OWASP Top 10
2021 Edition · Web Application Security Risks · Quick Reference
#1 risk. Restrictions on authenticated users not properly enforced. Users act outside intended permissions — view others' data, access admin functions.
IDOR Example
GET /api/users/1234/orders ← change to 1235✓ Enforce: user.id == resource.owner_idFormerly "Sensitive Data Exposure." Weak or missing encryption exposes passwords, PII, financial data in transit or at rest.
Anti-patterns
MD5/SHA1 for passwords ← brokenHTTP transmitting sensitive forms✓ bcrypt/Argon2 · TLS 1.2+ · AES-GCMUser-supplied data sent to an interpreter as part of a command or query. Includes SQL, NoSQL, OS command, LDAP, XSS injection.
Classic SQLi
' OR '1'='1 → dumps entire table✓ Parameterized: WHERE id = ?New in 2021. Missing or ineffective security controls by design — not implementation bugs. No amount of patching fixes a broken design.
Design Failure Examples
Secure Design Practices
Framework
Design → Threat Model → Review→ Implement → Verify → Monitor90% of apps tested had misconfiguration. Default creds, verbose errors, unnecessary features, cloud storage public ACLs, missing security headers.
Libraries, frameworks, OS components with known CVEs. Log4Shell, Equifax breach (Apache Struts), Heartbleed — all component vulns.
Weaknesses in auth and session management. Credential stuffing, brute force, weak passwords, exposed session IDs, broken logout.
Session Hijack
JSESSIONID in URL → logged, stolen✓ HttpOnly Secure cookies · short TTLCode and infrastructure without integrity verification. Insecure deserialization, CI/CD pipeline compromise, auto-updates without signature checks. SolarWinds is a real-world example.
What to Log
App fetches a remote resource from attacker-supplied URL without validation. Can reach internal services, cloud metadata APIs, or bypass firewalls.
AWS Metadata Exfil
url=http://169.254.169.254/latest/meta-data/iam/security-credentials/✓ Block 169.254.x.x at egress · IMDSv2Exploitability vs Impact Score
Key Statistics
94%
apps tested had broken access control
3.7M
CWEs mapped to injection alone
500K+
apps analysed for 2021 edition
207d
avg days to detect breach (IBM)
DevSecOps Quick Wins