Application Attacks and Database Security
Common application attacks
- Injection (SQL, command, LDAP) — untrusted input reaches an interpreter. Defense: parameterized queries and input validation.
- Cross-site scripting (XSS) — attacker script runs in a victim's browser. Defense: output encoding and a content security policy.
- Cross-site request forgery (CSRF) — the victim's browser is tricked into sending an authenticated request. Defense: anti-CSRF tokens and SameSite cookies.
- Buffer overflow — writing past an allocated boundary. Defense: bounds checking, safe languages, ASLR and DEP.
- TOCTOU — a race between check and use. Defense: atomic operations and locking.
Always validate input on the server. Client-side validation is a usability feature, never a security control, because the client is under the attacker's control.
Database security
- ACID properties — atomicity, consistency, isolation, durability — keep transactions trustworthy.
- Aggregation — combining low-sensitivity records to derive sensitive information.
- Inference — deducing restricted information from what you can legitimately see. Defense: polyinstantiation, cell suppression, noise.
- Views, granular permissions, and encryption at the column level limit exposure.
Malware vocabulary
A virus needs a host and user action; a worm self-propagates; a Trojan hides in something desirable; a logic bomb triggers on a condition; a rootkit hides at a privileged level; ransomware encrypts for extortion.