Skip to content

security: fixes GraphQL DoS vulnerability. query depth limit + graphql-go v1.3.0 → v1.9.0#18

Open
chris-mercer wants to merge 2 commits intoethereumclassic:masterfrom
chris-mercer:security/graphql-depth-limit
Open

security: fixes GraphQL DoS vulnerability. query depth limit + graphql-go v1.3.0 → v1.9.0#18
chris-mercer wants to merge 2 commits intoethereumclassic:masterfrom
chris-mercer:security/graphql-depth-limit

Conversation

@chris-mercer
Copy link
Copy Markdown
Member

@chris-mercer chris-mercer commented Mar 20, 2026

Security: GraphQL DoS prevention + library update

Adds a MaxDepth(20) limit on GraphQL query nesting to prevent deeply nested query DoS attacks (ported from go-ethereum). Also bumps graphql-go to fix a bug where MaxDepth did not function correctly.

Changes

  • graphql/service.go: Add maxQueryDepth constant and graphql.MaxDepth(maxQueryDepth) option
  • github.com/graph-gophers/graphql-go v1.3.0 → v1.9.0
  • github.com/opentracing/opentracing-go v1.1.0 → v1.2.0 (transitive)

Vulnerabilities Fixed

ID Severity Description
GHSA-mh3m-8c74-74xh High MaxDepth schema option did not function correctly, allowing DoS via deep nesting

References


Road to Olympia — Core-Geth Modernization March

Developed by White B0x Inc. for Ethereum Classic DAO LLC

🤖 Generated with Claude Code

Merge Order

  • Dependencies: None — this PR is independent and can be merged in any order
  • Part of: Core-Geth Modernization March — Wave 1 (Security)

Adds a MaxDepth(20) limit to prevent deeply nested query DoS attacks.
Bumps graphql-go to v1.9.0 to fix GHSA-mh3m-8c74-74xh — a bug where
the MaxDepth option did not function correctly in v1.3.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chris-mercer chris-mercer force-pushed the security/graphql-depth-limit branch from 98d482a to f90d9f0 Compare March 20, 2026 20:21
@chris-mercer chris-mercer changed the title security: add GraphQL query depth limit to prevent DoS attacks security: add GraphQL query depth limit, bump graphql-go v1.3.0 → v1.9.0 Mar 20, 2026
@chris-mercer chris-mercer changed the title security: add GraphQL query depth limit, bump graphql-go v1.3.0 → v1.9.0 security: fixes GraphQL DoS vulnerability. query depth limit + graphql-go v1.3.0 → v1.9.0 Mar 20, 2026
@chris-mercer chris-mercer requested a review from Copilot March 21, 2026 07:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the GraphQL endpoint against deeply nested query DoS attacks by enforcing a maximum query depth at schema parse time, and updates github.com/graph-gophers/graphql-go to a version where MaxDepth enforcement is reliable.

Changes:

  • Add a maxQueryDepth constant and apply graphql.MaxDepth(maxQueryDepth) when parsing the schema.
  • Bump github.com/graph-gophers/graphql-go from v1.3.0 to v1.9.0.
  • Update github.com/opentracing/opentracing-go (indirect) to v1.2.0 via dependency resolution.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
graphql/service.go Enforces a max GraphQL query nesting depth via graphql.MaxDepth(...).
go.mod Updates graphql-go and indirect opentracing-go dependency versions.
go.sum Adds checksums for the updated module versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread graphql/service.go
Verify that queries exceeding maxQueryDepth are rejected with a
400 error, preventing deeply nested query DoS attacks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants