GraphQL Field-Level Injection

Detects GraphQL resolvers vulnerable to injection through unsanitized field arguments and dynamic query construction.

zakirkun d1290d7 2 files · 2.0 KB Updated

File contents

GraphQL Field-Level Injection

Overview

GraphQL resolvers that pass field arguments directly to database queries, OS commands, or other dangerous functions are vulnerable to injection. Unlike REST, GraphQL injection can be harder to detect because:

  • Arguments arrive as parsed JavaScript objects (not raw strings)
  • Multiple injection points per query
  • Batch operations multiply impact

Remediation

  • Use parameterized queries in all database operations within resolvers
  • Validate and sanitize all resolver arguments
  • Use schema-level validation with type coercion

zakirkun/ice-tea/tree/main/skills/injection/graphql-field-injection commit d1290d70b6

Frequently asked questions

npx skillmds@latest add zakirkun/graphql-field-level-injection