Objective: Exfiltrate Sensitive Data or Manipulate Application State
Exfiltrate Sensitive Data or Manipulate Application State
(Attacker's Goal)
|
-------------------------------------------------
| |
1. Exploit Relay Client-Side Logic 2. Exploit Relay Server-Side Integration [CN]
| |
------------------------------------ ------------------------------------
| | | |
1.2 Query 1.3 Mutation 2.1 Over-fetching 2.2 GraphQL
Manipulation Vulnerabilities at the GraphQL Schema
[HR] [HR] Layer Design Flaws
[HR] [CN]
| | | |
-------|------- -----|----- -----|----- -----|-----
| | | |
1.2.1 1.3.1 2.1.1 2.2.1
**Crafted** **Crafted** **Leaking** **Missing**
**Queries** **Mutations** **Sensitive** **or**
**to Bypass** [HR] **Data via** **Inadequate**
**Intended** **GraphQL** **Authorization**
**Fetch** **Fields** [HR] [CN]
**Restrictions** [HR] [CN]
[HR] [CN]
Attack Tree Path: Critical Node: 2. Exploit Relay Server-Side Integration
Description: This represents the entire category of attacks targeting the server-side components of the Relay application, including the GraphQL server and its integration with the backend database. Server-side vulnerabilities are generally more critical due to direct access to sensitive data and resources. * Why Critical: Server-side compromise often grants broader access and control compared to client-side exploits.
Attack Tree Path: Critical Node & High-Risk Path: 2.2 GraphQL Schema Design Flaws
Description: This encompasses vulnerabilities arising from the design of the GraphQL schema itself, which defines the API's attack surface. * Why Critical: The schema's design fundamentally dictates what data and operations are exposed, making flaws here highly impactful.
Description: This is the most critical vulnerability. It means that the GraphQL schema lacks proper authorization checks, allowing unauthorized access to sensitive data or operations. This could be due to missing auth
directives, improperly configured resolvers, or a complete lack of an authorization layer.
* Attack Vector Details:
* An attacker sends GraphQL queries or mutations to the server.
* The server processes the request without verifying if the user has the necessary permissions.
* The server returns sensitive data or performs unauthorized actions.
* Why Critical & High-Risk: This is a fundamental security flaw that can completely bypass other security measures. It's relatively easy to exploit and has a high impact.
Description: This vulnerability occurs when the GraphQL schema exposes sensitive fields without proper protection, even if Relay's client-side data masking is in place. The attacker bypasses the client and directly queries the GraphQL API. * Attack Vector Details: * An attacker examines the GraphQL schema (often through introspection). * The attacker identifies sensitive fields that are not adequately protected by authorization checks. * The attacker crafts a GraphQL query directly targeting those sensitive fields. * The server returns the sensitive data. * Why Critical & High-Risk: This bypasses client-side security and directly exposes sensitive data.
Attack Tree Path: Critical Node & High-Risk Path: 1.2.1 Crafted Queries to Bypass Intended Fetch Restrictions
Description: This involves an attacker crafting malicious GraphQL queries that circumvent the intended data fetching restrictions imposed by Relay (e.g., pagination limits, connection filters, or custom logic). * Attack Vector Details: * An attacker analyzes the application's client-side code and network traffic to understand how Relay fetches data. * The attacker identifies potential weaknesses in the query construction or validation. * The attacker crafts a GraphQL query that manipulates variables, fragment spreads, or directives to access data outside the intended scope. * The server, if not properly validating the query, processes the request and returns unauthorized data. * Why Critical & High-Risk: This allows direct data exfiltration by bypassing intended access controls.
Attack Tree Path: High-Risk Path: 1.3.1 Crafted Mutations
Description: Similar to crafted queries, this involves an attacker crafting malicious GraphQL mutations to perform unauthorized actions or manipulate data in unexpected ways. * Attack Vector Details: * An attacker analyzes the application's client-side code and network traffic to understand how Relay handles mutations. * The attacker identifies potential weaknesses in the mutation input validation or server-side logic. * The attacker crafts a GraphQL mutation that manipulates input parameters to perform unauthorized actions (e.g., deleting data, modifying user roles, creating fraudulent transactions). * The server, if not properly validating the mutation, executes the request and modifies the application state in an unauthorized way. * Why High-Risk: This allows direct manipulation of application state, potentially leading to data corruption, denial of service, or other severe consequences.