OWASP Top 10 API Flashcards

1
Q

API 1: What is Broken Object Level Authorization

A

Attacker substitutes ID of their resource in API call with an ID of a resource belonging to another user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to prevent Broken Object Level Authorization

A
  • Implement authorization checks with user policies and hierarchy
  • Do not rely on IDs sent from client.
  • Check authorization each time there is a client
    request to access database
  • Use random non guessable IDs (UUIDs)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

API 2:What is Broken User Authentication

A

Poorly implemented API authentication allowing attackers to assume other users’ identities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to prevent Broken User Authorization

A

– Check all possible ways to authenticate to all APIs
– Use standard authentication, token generation, password storage, multi-factor authentication (MFA)
– Use short-lived access tokens
– Use rate-limiting for authentication, implement lockout policies and weak password checks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

API 3: What is Excessive Data Exposure

A

API overexpose data to the client, relying on the client to do the filtering. Attacker goes directly to the API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to prevent Excessive Data Exposure

A

– Never rely on client to filter data
– Review all responses and adapt responses to what the API
consumers really need
– Define schemas of all the API responses
– Don’t forget about error responses
– Identify all the sensitive or PII info and justify its use
– Enforce response checks to prevent accidental data and exception leaks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

API 4: Lack of Resources & Rate Limiting

A

API is not protected against an excessive amount of calls or payload sizes. Attackers use that for DoS and brute force attacks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to prevent Lack of Resources and Rate limiting

A
  • Rate Limiting
  • Payload size limit
  • Add proper server side validation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

API5: Broken Function Level Authorization

A

API relies on client to use user level or admin level APIs. Attacker figures out the “hidden” admin API methods and invokes them directly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to prevent Broken Function Level Authorization

A

– Deny all access by default
– Properly design and test authorization
– Role-based access control
– Do not rely on the client to enforce admin access

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

API6: Mass Assignment

A

Mass assignment is a computer vulnerability where an active record pattern in a web application is exploited to modify data items.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to prevent Mass Assignment

A

– Don’t automatically bind incoming data and internal objects
– Explicitly define all the parameters and payloads you are expecting
– Set readOnly to true for object schemas and all properties that can be retrieved via APIs but should never be modified

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

API7: Security Misconfiguration

A

Poor configuration of the API servers allows
attackers to exploit them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to prevent security misconfiguration

A

– Repeatable hardening and patching processes
– Automated process to locate configuration flaws
– Disable unnecessary features
– Restrict administrative access
– Define and enforce all outputs including errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

API8: Injection

A

Attacker constructs API calls that include SQL-, NoSQL-, LDAP-, OS- and other commands that the API or back-end behind it blindly executes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to prevent injection

A

– Never trust your API consumers
– Strictly define all input data: schemas, types, string patterns - and enforce them at runtime
– Validate, filter, sanitize all incoming data
– Define, limit, and enforce API outputs to prevent data
leaks

17
Q

API9: Improper Assets Management

A

Attacker finds non-production versions of the API: such as staging, testing, beta or earlier versions - that are not as well protected, and uses those to launch the attack.

18
Q

How to prevent improper assets management

A

– Inventory all API hosts
– Limit access to anything that should not be public
– Limit access to production data. Segregate access to production and non-production data.
– Implement additional external controls such as API firewalls

19
Q

API10: Insufficient Logging & Monitoring

A

Lack of proper logging, monitoring, and alerting let attacks go unnoticed.

20
Q

How to prevent insufficient logging and monitoring

A

– Log failed attempts, denied access, input validation failures, any failures in security policy checks
– Ensure that logs are formatted to be consumable by other tools
– Protect logs as highly sensitive
– Include enough detail to identify attackers
– Avoid having sensitive data in logs
– Integrate with SIEMs and other dashboards, monitoring, alerting tools