-
Notifications
You must be signed in to change notification settings - Fork 10k
[API Shield] BOLA attack detection #21969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/content/docs/api-shield/security/bola-attack-detection.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| pcx_content_type: concept | ||
| type: overview | ||
| title: Broken Object Level Authorization attack detection | ||
| sidebar: | ||
| badge: | ||
| text: Beta | ||
| order: 10 | ||
| label: BOLA attack detection | ||
| --- | ||
|
|
||
| import { Badge } from "~/components"; | ||
|
|
||
| A Broken Object Level Authorization (BOLA) attack is where an application or API fails to properly verify if a user has permission to access specific private data. | ||
|
|
||
| Bugs in the application or API allow attackers to bypass authorization checks and access sensitive information by manipulating and iterating through object identifiers | ||
|
|
||
| Vulnerabilities can occur at any time, including in the original application's deployment. However, changes or upgrades to authentication and authorization policies can also introduce these bugs. | ||
|
|
||
| BOLA attacks are as dangerous as account takeover. A successful BOLA attack allows the attacker to access or change data that they should not have ownership over. | ||
|
|
||
| Cloudflare labels endpoints with BOLA risk when we detect two distinct signals common with BOLA attacks: **Parameter pollution** and **Enumeration**. | ||
|
|
||
| - **Parameter pollution**: Cloudflare detects anomalies where one or more successful requests containing a value in an expected path, query string, header, or body parameter have that value duplicated in an unexpected, similar location. | ||
|
|
||
| This behavior may be indicative of attackers trying to confuse the API’s authorization system and bypass security controls. | ||
|
|
||
| - **Enumeration**: Cloudflare detects anomalies where one or more sessions makes successful requests to any one API endpoint changing variable values out of the norm, trying to get information from the API. | ||
|
|
||
| :::note | ||
| Sessions that have more random behavior or repetition have a higher chance of triggering an alert. | ||
| ::: | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Parameter pollution attack | ||
|
|
||
| **Endpoint**: `GET /api/v1/credit-cards/{cardId}` | ||
|
|
||
| - **Normal behavior**: `cardId` is sent in a path variable. | ||
| - **Attacker behavior**:`cardId` is also sent as a query parameter, which triggers old and undocumented code that looks for cards in the query parameter that lacks the authorization check: `GET /api/v1/credit-cards/{cardId}?cardId=12345`. | ||
|
|
||
| ### BOLA enumeration attack | ||
|
|
||
| **Endpoint**: `GET /api/v1/credit-cards/{cardId}` | ||
|
|
||
| - **Normal behavior**: Users request one to two credit cards per session. | ||
| - **Attack behavior**: Attackers request hundreds of credit card values per session. | ||
|
|
||
| ## Process | ||
|
|
||
| For beta customers, API Shield searches for and highlights BOLA attacks on your APIs. Cloudflare learns visitor traffic patterns over time to know when API access to specific objects is likely a Broken Object Level Authorization enumeration attack. We inform you what API endpoints are being targeted by automatically labeling them using the following risk labels: | ||
patriciasantaana marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| `cf-risk-bola-enumeration`: Automatically added when an endpoint experiences successful responses with drastic differences in the number of unique elements requested by different user sessions. | ||
|
|
||
| `cf-risk-bola-pollution`: Automatically added when an endpoint experiences successful responses where parameters are found in multiple places in the request. | ||
|
|
||
| If you see one of these labels on your API endpoints, check its authorization policy with your developer team to find any authorization bugs. Additionally, you can reach out to Cloudflare for a customized report about the behavior, including attacker identifiers that you can use to confirm attack reach and impact. | ||
|
|
||
| ## Availability | ||
|
|
||
| BOLA attack detection is available in a closed beta. Contact your account team if you are interested in BOLA attack detection for your API. | ||
|
|
||
| ## Limitations | ||
|
|
||
| The BOLA enumeration label requires an endpoint to have seen at least 10,000 sessions before being eligible for outlier detection. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.