Prompt
security testing for REST APIs
Latest observation
Oct 8, 2026
OpenAI APIWeb search: off
Security testing for REST APIs focuses on finding vulnerabilities in endpoints, auth flows, data handling, and business logic before attackers do. Here’s a practical checklist you can use.
1) Authentication testing
Check how users prove identity.
- Missing authentication: Can any endpoint be called without a token/session?
- Weak password policy: Short passwords, no lockout, no MFA.
- Credential stuffing/brute force: Rate limiting and account lockout.
- Token issues:
- Token reuse after logout
- Long-lived tokens
- Predictable tokens
- JWT weaknesses: weak signing keys,
alg=none, bad audience/issuer checks
- Session management:
- Session fixation
- Session leakage in logs/URLs
- Tokens exposed in browser storage without need
2) Authorization testing
Check what authenticated users can access.
- Broken object-level authorization (BOLA/IDOR):
- Change
/users/123to/users/124 - Access another user’s records by changing IDs
- Change
- Broken function-level authorization:
- Regular user calling admin endpoints
- Privilege escalation:
- Modify role fields in requests
- Use hidden endpoints or methods
- Tenant isolation:
- In multi-tenant systems, ensure one tenant cannot access another’s data
3) Input validation and injection
Test all parameters: path, query, headers, body, and file uploads.
- SQL/NoSQL injection
- Command injection
- LDAP/XPath injection
- Template injection
- CRLF/header injection
- Mass assignment / overposting
- Add fields like
role=admin,isApproved=true
- Add fields like
- Prototype pollution in JavaScript-based APIs
- Deserialization flaws if objects are accepted from clients
4) Rate limiting and abuse protection
Prevent abuse and resource exhaustion.
- No rate limits on login, OTP, password reset, search, or export endpoints
- Bypass through:
- rotating IPs
- different usernames
- changing headers
- Check for:
- throttling on sensitive endpoints
- API quota enforcement
- pagination limits
- request body size limits
5) Data exposure
Look for over-sharing and sensitive data leaks.
- Excessive data in responses
- PII, secrets, internal IDs, stack traces, debug flags
- Verbose error messages
- Predictable resource IDs
- Sensitive data in:
- response headers
- logs
- pagination metadata
- cache headers
6) HTTP method and endpoint security
Test how the API behaves with different methods.
- Unsupported methods returning useful data
GETendpoints that change statePUT/PATCHallowing unrestricted updatesOPTIONSrevealing attack surface- CORS misconfiguration:
Access-Control-Allow-Origin: *with credentials- overly permissive origins
7) Business logic testing
These bugs often bypass technical controls.
- Negative quantities, invalid discounts, repeated redemption
- Skipping steps in a workflow
- Reusing one-time tokens
- Race conditions:
- double spending
- duplicate orders
- parallel password reset or coupon use
- Manipulating sequence/order of requests
8) Transport and security headers
- Enforce HTTPS only
- Check TLS configuration
- HSTS if applicable
- Secure headers as relevant:
Content-Security-Policyfor browser-facing APIsX-Content-Type-Options- proper
Cache-Controlfor sensitive data
- Ensure no secrets in redirects or referrers
9) File upload testing
If the API accepts files:
- File type validation
- Extension/content mismatch
- Malware scanning
- Path traversal via filenames
- Oversized uploads
- Uploading active content where it shouldn’t be allowed
10) API documentation and discovery
- Hidden/debug/admin endpoints
- OpenAPI/Swagger exposure
- Stale docs vs. actual implementation
- Deprecated endpoints still active
- Unauthenticated schema discovery
11) Logging and monitoring
- Sensitive data in logs
- Missing audit logs for critical actions
- Log injection
- Alerts for suspicious activity
- Correlate failed auth, enumeration, and abuse patterns
12) Common standards and frameworks
Use these as references:
- OWASP API Security Top 10
- OWASP ASVS
- OWASP Testing Guide
- NIST guidance for authentication and logging
13) Example test cases
A few practical checks:
- Try requests with:
- no auth
- expired token
- wrong user token
- modified object IDs
- extra fields in JSON
- invalid methods
- oversized payloads
- repeated rapid requests
- Compare:
- status codes
- response bodies
- timing differences
- error messages
14) Tools often used
- Burp Suite
- OWASP ZAP
- Postman / Insomnia
- curl
- jwt.io for inspection
- Nmap for surface discovery
- fuzzers and custom scripts
- OpenAPI validators
If you want, I can also give you:
- a step-by-step REST API security test plan,
- a checklist mapped to OWASP API Top 10, or
- example test cases with curl/Burp-style requests.