Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 4.16 KB

File metadata and controls

38 lines (31 loc) · 4.16 KB

Threat Model Analysis for facebook/relay

  • Description: An attacker gains access to the client-side environment (e.g., via browser developer tools, compromised browser extension, or XSS). They then inspect the Relay Store (client-side cache) and extract sensitive data cached by Relay. This data, if not properly handled, could include personal information or API keys. Relay's client-side caching mechanism makes this a direct Relay-related threat.
  • Impact: Confidentiality breach, exposure of sensitive user data, potential identity theft, financial loss, or regulatory compliance violations.
  • Relay Component Affected: Relay Store (Client-side cache)
  • Risk Severity: High
  • Mitigation Strategies:
    • Minimize storing highly sensitive data in the Relay Store.
    • If sensitive data must be cached, implement client-side encryption of sensitive fields before they are stored in the Relay Store.
    • Implement robust client-side security measures to prevent XSS and other client-side attacks that could lead to Relay Store access.
    • Regularly review the data being cached in the Relay Store and ensure it aligns with security and privacy requirements.
  • Description: An attacker attempts to bypass authorization checks on GraphQL mutations, which are a core part of Relay's data modification pattern. If server-side mutation resolvers, used by Relay clients, lack proper permission verification, an attacker could craft mutations to modify data they are not authorized to change. Relay's reliance on mutations for data updates makes this a directly relevant threat.
  • Impact: Data integrity compromise, unauthorized actions, privilege escalation, potential business logic bypass, unauthorized modification of sensitive information.
  • Relay Component Affected: GraphQL Mutation Resolvers (Server-side, specifically those used by Relay mutations)
  • Risk Severity: Critical
  • Mitigation Strategies:
    • Implement strong server-side authorization checks in all GraphQL mutation resolvers used by Relay.
    • Use a consistent authorization strategy across the application, especially for GraphQL mutations driven by Relay.
    • Leverage GraphQL directives or middleware to enforce authorization rules at the GraphQL layer for Relay mutations.
    • Thoroughly test mutation authorization logic to ensure it correctly restricts access based on user roles and permissions in Relay-driven data modifications.
  • Description: An attacker crafts malicious input data for GraphQL mutations, a primary data modification mechanism in Relay applications. If server-side mutation resolvers, designed to handle Relay client requests, lack proper input validation, attackers can inject malicious payloads. This can lead to backend vulnerabilities like SQL injection, NoSQL injection, or command injection, compromising backend systems. Relay's mutation-centric data flow makes input validation critical.
  • Impact: Data breaches, system compromise, potential remote code execution on backend systems, unauthorized access to backend databases or systems.
  • Relay Component Affected: GraphQL Mutation Resolvers (Server-side, specifically those handling Relay mutation inputs), Backend Data Layer
  • Risk Severity: Critical
  • Mitigation Strategies:
    • Implement robust server-side input validation for all GraphQL mutation inputs received from Relay clients.
    • Sanitize and escape user-provided data from Relay mutations before using it in backend queries or operations.
    • Utilize parameterized queries or ORMs to prevent SQL injection vulnerabilities in backend interactions triggered by Relay mutations.
    • Follow secure coding practices for backend development to mitigate injection vulnerabilities arising from Relay mutation inputs.