forked from trailofbits/semgrep-rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema-directives.yaml
23 lines (22 loc) · 969 Bytes
/
schema-directives.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
rules:
- id: schema-directives
message: >-
The Apollo GraphQL uses the 'schemaDirectives' option. This works in ApolloServer v2, but does nothing in version >=3. Depending on what the directives are used for, this can expose authenticated endpoints, disable rate limiting, and more. See the references on how to create custom directives in v3 and v4.
languages: [js, ts]
severity: ERROR
metadata:
category: security
cwe: "CWE-686: Function Call With Incorrect Argument Type"
subcategory: [vuln]
confidence: MEDIUM
likelihood: MEDIUM
impact: HIGH
technology:
- graphql
- apollo-graphql-server
description: "Use of outdated ApolloServer option 'schemaDirectives'"
references:
- https://www.apollographql.com/docs/apollo-server/schema/directives/#custom-directives
pattern-either:
- pattern: |
new ApolloServer({..., schemaDirectives: ..., ...})