GraphQL Injection

Summary

GraphQL Injection allows an attacker to manipulate GraphQL queries to perform unauthorized operations, extract sensitive data, or execute arbitrary code.

Description

GraphQL Injection is a vulnerability that occurs when an attacker can manipulate GraphQL queries or their parameters to perform unauthorized operations, extract sensitive data, or execute arbitrary code on the server-side. Attackers can exploit this vulnerability by injecting malicious GraphQL queries or modifying existing queries to gain unauthorized access, escalate privileges, or compromise the integrity and confidentiality of the system.

Remediations

  • Implement strict input validation and sanitization of user-controlled input used in GraphQL queries.
  • Avoid building dynamic queries by concatenating user input. Instead, use query parameterization or prepared statements.
  • Apply proper access controls and authorization mechanisms to restrict unauthorized access to sensitive data or operations.
  • Regularly update and patch the GraphQL server implementation and dependencies.
hackstack
Anatomy
Usually follows
Authentication Bypass
Broken Access Control
Usually precedes
Broken Access Control
Affected components
Database
Sensitive Information