Skip to content

Commit 74f6b27

Browse files
authored
No security sane defaults in Hive Gateway (#6942)
1 parent bdfc51d commit 74f6b27

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

packages/web/docs/src/content/gateway/other-features/security/index.mdx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ perform requesting signing and verification.
8282

8383
## Query Depth Limiting
8484

85-
<Callout type="info">
86-
Query Depth Limiting is enabled by default in Hive Gateway and set to 7.
87-
</Callout>
88-
8985
Attackers can send operations with deeply nested selection sets that could block other requests
9086
being processed. Fortunately, infinite loops are not possible by design as a fragment cannot
9187
self-reference itself; however, that still does not prevent possible attackers from sending
@@ -146,21 +142,6 @@ malicious API users executing GraphQL operations with deeply nested selection se
146142
tweak the maximum depth an operation selection set is allowed to have based on your schema and
147143
needs, as it could vary between users.
148144

149-
## Query Token Limiting
150-
151-
<Callout type="info">
152-
Query Token Limiting is enabled by default in Hive Gateway and set to 1000.
153-
</Callout>
154-
155-
Malicious queries can contain a great number of tokens, which can lead to performance issues when
156-
processing them. Attackers can send these operations over and over to degrade the performance of the
157-
Hive Gateway using the DDoS attack.
158-
159-
[Configuring the `maxTokens` option](/docs/gateway/other-features/security/max-tokens) can prevent
160-
malicious API users executing GraphQL operations with high token counts. You need to tweak the
161-
maximum token count an operation is allowed to have based on your schema and needs, as it could vary
162-
between users.
163-
164145
## Rate Limiting
165146

166147
Rate-limiting is a common practice with APIs, and with GraphQL it gets more complicated because of

packages/web/docs/src/content/migration-guides/gateway-v1-v2.mdx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ v2 includes several breaking changes and improvements over v1. The most signific
1212
- [Multipart Requests are Disabled by Default](#multipart-requests-are-disabled-by-default)
1313
- [Remove Mocking Plugin from built-ins](#remove-mocking-plugin-from-built-ins)
1414
- [Disabled Automatic Forking](#disabled-automatic-forking)
15-
- [Sane Security Defaults](#sane-security-defaults)
1615
- [Load Schema on CLI Start](#load-schema-on-cli-start)
1716
- [Inflight Request Deduplication](#inflight-request-deduplication)
1817
- [Hive Logger](#hive-logger)
@@ -122,25 +121,6 @@ However, the CLI is a complete program that gets ran by the user; meaning, we do
122121
the schema on-demand, we can load the schema on start! This helps catch schema issues early and
123122
provides a better developer experience.
124123

125-
## Sane Security Defaults
126-
127-
Hive Gateway v2 comes with improved security defaults to help protect your GraphQL API from common
128-
vulnerabilities. The following security measures are now enabled by default:
129-
130-
- [Maximum query depth](/docs/gateway/other-features/security/max-depth) is set to 7
131-
- [Maximum query tokens](/docs/gateway/other-features/security/max-tokens) is set to 1000
132-
133-
If you want to keep the v1 behavior, you can set these options to `false` in your configuration:
134-
135-
```ts filename="gateway.config.ts"
136-
import { defineConfig } from '@graphql-hive/gateway'
137-
138-
export const gatewayConfig = defineConfig({
139-
maxDepth: false,
140-
maxTokens: false
141-
})
142-
```
143-
144124
## Disabled Automatic Forking
145125

146126
We were previously forking workers automatically in v1 when detecting `NODE_ENV=production`;

0 commit comments

Comments
 (0)