← Back to libraryQuestion 194 of 273
🌐API TestingAdvanced

API Security Testing

📌 Definition:

Comprehensive testing to identify security vulnerabilities and ensure APIs protect against attacks.

📖 Detailed Explanation:

APIs are security-critical because they handle sensitive data and provide direct access to functions. Common vulnerabilities include missing authentication, weak authorization, SQL injection, and insecure data transmission. Security testing requires thinking like an attacker.

📎 Security Areas:
AreaTest
AuthenticationCan I access API without token or with invalid token?
AuthorizationCan I access another user's data by changing user ID?
Input ValidationWhat happens with SQL injection or special characters?
Data EncryptionIs HTTPS enforced? Are credentials transmitted securely?
Rate LimitingCan I overload API with rapid requests?
🎯 Scenario-Based Interview Question:

Scenario: Your banking API handles sensitive financial transactions. A security audit reveals several vulnerabilities. You have 3 critical issues to fix: (1) User A can see User B's account balance by changing account_id in request, (2) Passwords are transmitted over HTTP (not HTTPS), (3) API has no rate limiting - attacker can brute force login 10,000 times/second. Prioritize these and explain your fixing approach with testing strategy.