Broken Object Level Authorization (BOLA)

Illustrative example. ACME Financial is an invented company and every detail below is made up. The layout is the one our reports use.

Finding 4.1
Broken Object Level Authorization (BOLA)
C1
Severity
Critical
CVSS 3.1 score
6.5Medium
Risk rating
Likelihood:  High
Impact:  Critical
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Classification
CWE-639
A01: Broken Access Control
API1:2023 Broken Object Level Authorization
Description
Broken object level authorization occurs when an API retrieves a record using an identifier supplied by the client and does not verify that the caller is entitled to that record. An attacker who changes the identifier receives data belonging to another user.
Affected assets
https://online.acme-financial.example/api/v2/accounts/
The CVSS score rates the technical characteristics of the flaw. The severity rating also accounts for likelihood and business impact: account numbers are sequential, and the exposed data is customers' banking information.

Impact

Using this flaw, Strafe retrieved the account details of a customer other than the one signed in. The exposed fields were the account holder’s name, routing number, account number, available balance and statements. The API accepted any account number, and account numbers are issued sequentially, so the exposure extends to every customer account and requires no privileges beyond an ordinary customer login.

A threat actor holding this information could attempt unauthorized debits against customer accounts or impersonate customers to the bank’s call center. Within an attack chain, this finding supports large-scale collection of customer data from a single customer account. Strafe assesses the likelihood as high and the impact as critical.

Technical details

Strafe tested with two customer accounts that had no relationship to each other, referred to as Customer A and Customer B. While authenticated as Customer B, the accounts page requested Customer B’s own account by its number, 100482. Strafe replayed the request with Customer B’s session and Customer A’s account number:

GET /api/v2/accounts/100481/details HTTP/2
Host: online.acme-financial.example
Cookie: acme_session=[Customer B's session]
Burp Repeater showing a request for account 100482 with Customer B's session and a 200 response containing Customer B's account details
Figure 1 - Customer B requests their own account Open full size

The API returned Customer A’s account details:

HTTP/2 200 OK
Content-Type: application/json

{"accountId":100481,"holder":"Customer A (test account)",
 "type":"checking","routingNumber":"000000000",
 "accountNumber":"0000100481","availableBalance":"2340.18"}
Burp Repeater showing the same request with account 100481, still on Customer B's session, and a 200 response containing Customer A's account details
Figure 2 - The same request with Customer A's account number Open full size

The statement download endpoint behaved in the same way. Testing was limited to the two test accounts, and no other customer records were requested.

ACME Financial online banking signed in as Customer B, displaying the holder, routing number, account number and balance of Customer A's account
Figure 3 - Customer A's account shown in Customer B's session Open full size

Remediation

  1. Resolve the requested account against the accounts held by the authenticated customer, on the server, within the API handler. Return 404 for any other account.
  2. Apply the same authorization check, from a single shared function, to every endpoint that accepts an account, statement, payee or transfer identifier.
  3. Log each refused request, and alert when a single customer requests multiple accounts they do not hold.

Replacing sequential account numbers with random identifiers would reduce the likelihood of exploitation but would not correct the missing authorization check.

remediation.md
## C1 - Broken object level authorization in account details

**Where:** GET /api/v2/accounts/{accountId}/details and /statements/*
**Severity:** Critical (CVSS 6.5) · Likelihood High · Impact Critical

### What "fixed" means
- A request for an account the caller does not hold returns 404
  and no account data.
- The check runs in the API handler. A check in the page that
  renders the account list does not count.

### What does not count
- Longer or random account identifiers.

### Where else this pattern may exist
Every route that takes an identifier from the client: statements,
payees, transfers, documents. Confirm each one resolves the
identifier against the caller's own accounts.

Retest

StatusResolved

Strafe repeated the request after the fix was applied. The API returned 404 for Customer A’s account, and Customer B’s own account loaded normally.

Burp Repeater showing the same request and session answered with 404 Not Found after the authorization check was added
Figure 4 - The same request after the fix Open full size

References

  • OWASP API Security Top 10, API1:2023 Broken Object Level Authorization
  • OWASP Authorization Cheat Sheet
  • CWE-639: Authorization Bypass Through User-Controlled Key