Web Security & Input Handling Flashcards
(6 cards)
Common API Vulnerabilities
Broken Authentication — tokens not validated
Excessive Data Exposure — API sends more data than needed
Examples:
API returns full user profile, not just username
Login token not verified on every request
Input Validation & Sanitisation
Validation: Check input format before processing (e.g., only numbers)
Sanitisation: Remove harmful parts (e.g., strip )
Prevents:
SQL Injection
Cross-Site Scripting (XSS)
Secure Error Handling
Why: Prevent leaks of system info (e.g., stack traces, DB errors)
Principles:
Show generic errors to users (“Something went wrong”)
Log detailed errors privately for developers
Session Handling & Memory Security
Session Handling: Secure tokens, expiry, regeneration
Example: Auto-logout after inactivity
Memory Security: Avoid leaving passwords in memory; clear variables
Example: Zero out memory used by sensitive info
Broken Authentication
When login mechanisms are flawed
Vulnerabilities:
Weak passwords
Session IDs in URLs
No MFA
Prevention:
Enforce strong password policies
Use secure session tokens
Add multi-factor authentication
What are Token
In software development, a token is a small, indivisible unit of data that has meaning within a programming language or system