Skip to main content

Technical information leak - API

Description

An attacker is able to gather the entire GraphQL API Schema Structure (both queries and mutations).

Impact

Get the knowledge of the Schema Structure to open a door for more dangerous attacks.

Recommendation

Disable introspection queries.

Threat

An anonymous attacker from the Internet network crafts an introspection query.

Expected Remediation Time

⌚ 30 minutes.

Score

Default score using CVSS 3.1. It may change depending on the context of the vulnerability.

Base

  • Attack vector: N
  • Attack complexity: L
  • Privileges required: N
  • User interaction: N
  • Scope: U
  • Confidentiality: L
  • Integrity: N
  • Availability: N

Temporal

  • Exploit code madurity: X
  • Remediation level: W
  • Report confidence: X

Result

  • Vector string: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:X/RL:W/RC:X
  • Score:
    • Base: 5.3
    • Temporal: 5.2
  • Severity:
    • Base: Medium
    • Temporal: Medium

Code Examples

Compliant code

The back end correctly disables introspection for graphql

app.use('/graphql', graphqlHTTP({
schema: MyGraphQLSchema,
+ validationRules: [NoIntrospection]
}));

Non compliant code

The application has introspection queries that could potentially leak the GraphQL Schema Structure

app.use('/graphql', graphqlHTTP({
schema: MyGraphQLSchema,
+ validationRules: [*]
}));

Requirements