-
Side Notes
-
Threat modeling
- process used to map out the threats to an API provider.
-
Threat actor
- adversary or attacker of the API.
-
Token handling
- The storage of tokens, the method of transmitting tokens across a network, the presence of hardcoded tokens.
-
BOLA
- Access the information of other accounts, such as payment histories, usernames, email addresses, and account numbers.
-
BFLA
- Transfer money and actually update the account information.
-
API bug bounties
- BugCrowd
- Twitter
- Apple
- Microsoft
- Google
- Hackerone
-
Information Disclosure
- /wp-json/wp/v2/user
-
Broken Object Level Authorization (BOLA)
- unauthorized access
- GET /api/resource/1
GET /user/account/find?user_id=15
POST /company/account/Apple/balance
POST /admin/pwreset/account/90
- GET /api/resource/3
GET /user/account/find?user_id=23
POST /company/account/Google/balance
POST /admin/pwreset/account/111
-
Broken User Authentication
- API keys, tokens, and credentials used in URLs
- Rate-limit restrictions when authenticating
- Verbose error messaging
-
Excessive Data Exposure
- Test the target API endpoints and review the information sent in response.
-
Lack of Resources and Rate Limiting
- Send a barrage of requests to the API.
- If rate limiting is functioning, you should receive some sort of response informing you that you’re no longer able to make additional requests.
- HTTP 429 status code
-
Broken Function Level Authorization (BFLA)
- unauthorized actions
- When a user of one role or group is able to access the API functionality of another role or group.
-
Accounts types
- administrators
- partners
- merchants
- public users
-
Functions
- altering user accounts
- accessing user resources
- gaining access to restricted endpoints
-
Mass Assignment
- Occurs when an API consumer includes more parameters in their requests than the application intended and the application adds these parameters to code variables or internal objects
- guess parameters or fuzz them in API requests
- Look for parameters involved in user account properties, critical funcs, administrative actions.
-
EX
- "User": "scuttleph1sh",
"Password": "GreatPassword123"
- "User": "scuttleph1sh",
"Password": "GreatPassword123",
"isAdmin": true
-
Injections
-
SQLI
- "Lname": "Hacker",
"Address": "' OR 1=0--"
- NoSQL injection
-
System command injection
- /api/v1/resources/books?show=/etc/passwd
-
Security Misconfigurations
-
Includes
- verbose error messaging
- lack of input sanitization
- acceptance of unnecessary HTTP methods
- misconfigured headers
- misconfigured transit encryption
- use of default accounts
-
Improper Assets Management
- Exposed APIs that are either retired or still in development.
- By paying close attention to outdated API documentation, changelogs, and version history.
-
older & newer versions
- /v1/, /v2/, /v3/
-
still in development
- /alpha/, /beta/, /test/, /uat/, /demo/
- Watch for patterns in the API documentation or path-naming scheme, and then make requests based on your assumptions.
-
Business Logic
-
Statements
- Only use feature X to perform function Y.
- Do not do X with endpoint Y.
- Only admins should perform request X.
-
EX
-
2FA bypass
- UserId=hapihacker&password=arealpassword!&MFA=true
- UserId=hapihacker&password=arealpassword!&MFA=false