3.4. Controls to Mitigate Attacks and Software Vulnerabilities
💡 First Principle: Software vulnerabilities follow patterns — the same classes of flaws (injection, overflow, access control failures) appear across different languages, frameworks, and applications because they stem from the same fundamental programming mistakes. Understanding the class of vulnerability tells you both why it exists and what category of control prevents it.
The OWASP Top 10 organizes the most common web application vulnerability classes. It is a ranked awareness document of the most critical web application security risk categories (Broken Access Control, Injection and so on), not a list of CVEs or threat actors and not a compliance standard, although standards such as PCI DSS reference it. Analysts use it to check that application testing covers every category and to prioritize remediation. CS0-004 no longer lists these attacks as a catalogue of their own; it tests them through secure coding best practices (objective 2.3, mitigation) and application security testing — SAST and DAST (objective 2.4). So for each class below, know three things: what the attacker does, which coding practice prevents it, and what kind of testing tends to find it. For each vulnerability type, analysts need to understand: what the attacker does, what the impact is, and what control prevents it. The exam presents scenarios requiring you to identify the vulnerability type and the appropriate mitigation.
| Flaw class | Secure coding control (2.3) | Typically found by (2.4) |
|---|---|---|
| SQL / command injection | Parameterized queries; allow-list input validation | SAST (untrusted data reaching a query or shell) and DAST |
| Cross-site scripting (XSS) | Context-aware output encoding; Content Security Policy | SAST and DAST |
| Cross-site request forgery (CSRF) | Anti-CSRF tokens; SameSite cookies | DAST and manual review |
| Buffer overflow | Bounds checking; memory-safe languages and APIs | SAST and fuzzing |
| Directory traversal, LFI/RFI | Canonicalize paths; allow-list files; never pass input to include/open calls | SAST and DAST |
| Broken access control (e.g. IDOR) | Server-side authorization check on every request | Manual testing and authenticated DAST — scanners rarely understand who should see what |
| Hard-coded secrets | Secrets management (vault), never in source | SAST / secret scanning |
| Vulnerable third-party components | Dependency management, SBOM | Software composition analysis (SCA) |
⚠️ Common Misconception: Input validation alone prevents SQL injection. Parameterized queries (prepared statements) are the primary defense — they separate SQL code from user-supplied data at the database driver level, making injection structurally impossible regardless of what data is supplied. Input validation is a secondary defense that reduces attack surface but can be bypassed.