Skip to content
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

Write test to detect Rate limit bypass on GraphQL APIs #31

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Lack-of-Resources-and-Rate-Limiting/RateLimitBypassGraphQL.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
id: RATE_LIMIT_BYPASS_GRAPHQL
info:
name: "Rate Limit Bypass Vulnerability in GraphQL"
description: "The GraphQL specification allows multiple requests to be sent in a single request by batching them together."
details: >
"The GraphQL specification allows multiple requests to be sent in a single request by batching them together. If the developers did not implement some mechanism to prevent the sending of batch requests, you could potentially bypass the rate limit by sending queries in a single request."
impact: "If the developers did not implement some mechanism to prevent the sending of batch requests, you could potentially bypass the rate limit by sending queries in a single request."
category:
name: RL
shortName: Lack of Resources & Rate Limiting
displayName: Lack of Resources & Rate Limiting (RL)
subCategory: RATE_LIMIT_BYPASS_GRAPHQL
severity: MEDIUM
tags:
- GraphQL
- Business logic
- OWASP top 10
- HackerOne top 10
references:
- "https://0xn3va.gitbook.io/cheat-sheets/web-application/graphql-vulnerabilities#bypass-of-rate-limits"
cwe:
- CWE-287

api_selection_filters:
response_code:
gte: 200
lt: 300
request_payload:
extract: reqPayloadVar
contains_either: mutation
url:
contains_either: graphql

execute:
type: single
requests:
- req:
replace_body: "mutation {${reqPayloadVar}, ${reqPayloadVar}, ${reqPayloadVar}, ${reqPayloadVar}, ${reqPayloadVar} }"

validate:
response_code:
gte: 200
lt: 300
response_payload:
contains_either: .*limit.*