Character limit
Descriptionβ
Clients using GraphQL may craft a query with a huge amount of characters. This could lead to potential DoS attacks or information leakage.
Remediationβ
Reject requests containing more than a certain number of characters.
For instance, 15000
is a coherent threshold for characters.
This naΓ―ve approach will not prevent clever hackers from crafting costly requests if short field names are available. One should prefer the better but more difficult to implement "query complexity" method and set a complexity threshold instead.
GraphQL Specificβ
Apollo
Yoga
Awsappsync
Graphqlgo
Graphqlruby
Hasura
Configurationβ
Identifier:
resource_limitation/character_limit
Optionsβ
- threshold : Maximum characters before raising an alert (-1 = infinite)
Examplesβ
Ignore this checkβ
checks:
resource_limitation/character_limit:
skip: true
Scoreβ
- Escape Severity: LOW
Complianceβ
OWASP: API8:2023
pci: 6.5.10
gdpr: Article-32
soc2: CC1
psd2: Article-95
iso27001: A.14.2
nist: SP800-53
fedramp: AC-4
Classificationβ
- CWE: 400
Scoreβ
- CVSS_VECTOR: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:H/RL:O/RC:R
- CVSS_SCORE: 4.9