Black Friday sale: an extra 40% off every course until Monday, November 30.New Year sale: an extra 30% off every course until Friday, January 1.Memorial Day sale: an extra 25% off every course until Monday, May 31.SysAdmin Day sale: an extra 25% off every course until Sunday, August 1.Back to School sale: an extra 25% off every course until Sunday, August 22.Labor Day sale: an extra 25% off every course until Monday, September 6.Black Friday sale: an extra 40% off every course until Monday, November 29.New Year sale: an extra 30% off every course until Saturday, January 1.Choose your certification →

Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

3.3.1. Application and Web Vulnerabilities

💡 First Principle: Most application vulnerabilities stem from one root cause: the application trusts user input that it shouldn't. When an application fails to validate, sanitize, or properly handle external input, attackers can inject malicious data that changes the application's behavior.

SQL injection (SQLi) — inserting SQL commands into input fields to manipulate the database. A login form vulnerable to SQLi might accept ' OR 1=1 -- as a username, bypassing authentication entirely because the injected SQL always evaluates as true.

Cross-site scripting (XSS) — injecting malicious scripts into web pages viewed by other users. Stored XSS persists in the database; reflected XSS arrives via crafted URLs. Both execute in the victim's browser, potentially stealing session cookies or credentials.

Buffer overflow — writing more data to a memory buffer than it can hold, overwriting adjacent memory. This can crash applications or allow arbitrary code execution. Buffer overflows are among the oldest and most dangerous vulnerability classes.

Race conditions — occur when a system's behavior depends on the timing of events. An attacker might exploit the gap between a security check and the action it authorizes (time-of-check/time-of-use, or TOCTOU). Example: checking if a user has sufficient funds, then deducting the funds — if the user can trigger two transactions simultaneously, they might overdraw.

Unrestricted file upload — the application accepts uploads without validating file type, content, or destination. An uploaded script (a web shell) disguised with an image extension can be executed by the server, giving the attacker remote code execution. Defenses: allow-list permitted types and verify the actual content, rename files, and store uploads outside the web root with execute permission disabled.

Broken access control / insecure direct object reference (IDOR) — the application exposes an identifier (such as a record number in a URL) but never checks that the requester is authorized for that object, so changing the identifier returns someone else's data. The fix is a server-side authorization check on every request (OWASP Top 10 A01:2021, Broken Access Control).

Improper error handling — error messages that reveal internal details (database structure, file paths, stack traces) give attackers reconnaissance information. A detailed error message is a roadmap for exploitation.

Race condition terms: the time-of-check (TOC) is the moment a program verifies something (the file is safe to open, the balance is sufficient, the user may access this path); the time-of-use (TOU) is the moment it acts on that result. If the condition can change in between — a file swapped for a symbolic link to /etc/shadow, a second withdrawal processed in parallel — the action runs on a decision that is no longer true. The fix is to make check and use atomic: locks, database transactions, or opening a file once and validating the open handle rather than the path name.

Malicious update — the application's own update mechanism is the vulnerability when it installs code without verifying it. An updater that downloads over plain HTTP or skips signature checks will install whatever an on-path attacker or a hijacked update server supplies. Code-signed updates, verified before installation with a well-protected signing key, are the control. When the vendor's build or signing process itself is compromised, the update arrives validly signed and it becomes a supply chain attack (section 3.2.3).

Code-level weaknesses:
  • Hardcoded secrets — passwords, API keys, or encryption keys written into source code or binaries. Anyone who gets the code (a repository leak, a decompiled app) has the secret, every installation shares it, and it can't be rotated without shipping a new release. Load secrets at runtime from a secrets manager.
  • Unsafe exception handling — what the code does when something goes wrong. An exception that is caught and ignored can skip the authorization check that should have followed (fail open); an unhandled exception can crash the service (denial of service); and an exception printed to the user leaks stack traces and queries (the improper error handling above). Handle errors so the default outcome is denial (fail closed) and log the details internally.

⚠️ Exam Trap: SQL injection and XSS are the most frequently tested web vulnerabilities. SQLi targets the database (server-side). XSS targets other users' browsers (client-side). This distinction determines the correct answer when both are offered as choices.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•26 professional certifications earned