Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-27407: CWE-94: Improper Control of Generation of Code ('Code Injection') in rmosolgo graphql-ruby

0
Critical
VulnerabilityCVE-2025-27407cvecve-2025-27407cwe-94
Published: Wed Mar 12 2025 (03/12/2025, 18:15:57 UTC)
Source: CVE Database V5
Vendor/Project: rmosolgo
Product: graphql-ruby

Description

graphql-ruby is a Ruby implementation of GraphQL. Starting in version 1.11.5 and prior to versions 1.11.8, 1.12.25, 1.13.24, 2.0.32, 2.1.14, 2.2.17, and 2.3.21, loading a malicious schema definition in `GraphQL::Schema.from_introspection` (or `GraphQL::Schema::Loader.load`) can result in remote code execution. Any system which loads a schema by JSON from an untrusted source is vulnerable, including those that use GraphQL::Client to load external schemas via GraphQL introspection. Versions 1.11.8, 1.12.25, 1.13.24, 2.0.32, 2.1.14, 2.2.17, and 2.3.21 contain a patch for the issue.

AI-Powered Analysis

AILast updated: 11/03/2025, 20:59:19 UTC

Technical Analysis

CVE-2025-27407 is a critical vulnerability classified under CWE-94 (Improper Control of Generation of Code), affecting the graphql-ruby library, a popular Ruby implementation of GraphQL. The vulnerability exists in versions starting from 1.11.5 up to but excluding patched releases (e.g., 1.11.8, 1.12.25, 1.13.24, 2.0.32, 2.1.14, 2.2.17, and 2.3.21). The root cause lies in the unsafe handling of schema definitions loaded via the methods GraphQL::Schema.from_introspection and GraphQL::Schema::Loader.load. When these methods load a schema from an untrusted JSON source, such as external GraphQL introspection queries (including those performed by GraphQL::Client), maliciously crafted schema definitions can inject executable code. This leads to remote code execution (RCE) on the host system without requiring authentication or user interaction. The vulnerability allows attackers to execute arbitrary code with the privileges of the application, potentially leading to full system compromise, data exfiltration, or service disruption. The CVSS v3.1 score of 9.1 reflects the high impact on confidentiality, integrity, and availability, with network attack vector, no privileges required, and no user interaction needed. Although no known exploits are reported in the wild yet, the severity and ease of exploitation make this a critical threat. The vulnerability affects a broad range of graphql-ruby versions, indicating many applications using this library could be vulnerable if they load schemas from untrusted sources. The patch is available in the specified versions, and upgrading is essential to remediate the risk.

Potential Impact

For European organizations, this vulnerability poses a significant threat, especially those developing or deploying Ruby-based web applications that utilize GraphQL APIs. The ability to achieve remote code execution without authentication means attackers can compromise backend servers, leading to data breaches, service outages, or lateral movement within networks. Confidentiality is at high risk as attackers can access sensitive data processed by the application. Integrity is compromised because attackers can alter application behavior or data. Availability may be impacted through denial-of-service conditions caused by malicious code execution. Organizations relying on third-party GraphQL schemas or integrating external GraphQL services are particularly vulnerable if they do not validate schema sources. The threat is exacerbated in sectors with high-value targets such as finance, healthcare, and government services prevalent in Europe. Additionally, the widespread adoption of GraphQL and Ruby in modern web development increases the attack surface. Failure to patch promptly could lead to exploitation attempts, especially as proof-of-concept code becomes available.

Mitigation Recommendations

1. Immediately upgrade graphql-ruby to one of the patched versions: 1.11.8 or later, 1.12.25 or later, 1.13.24 or later, 2.0.32 or later, 2.1.14 or later, 2.2.17 or later, or 2.3.21 or later. 2. Avoid loading GraphQL schemas from untrusted or unauthenticated sources. Validate and sanitize any external schema definitions before loading. 3. Implement strict access controls and network segmentation to limit exposure of services that perform schema loading. 4. Monitor application logs and network traffic for unusual schema loading activities or unexpected introspection queries. 5. Employ runtime application self-protection (RASP) or endpoint detection and response (EDR) tools to detect anomalous code execution. 6. Conduct code reviews and security testing focusing on GraphQL schema handling and introspection features. 7. Educate development teams about the risks of dynamic code generation and the importance of secure schema management. 8. If immediate upgrade is not possible, consider disabling schema loading from introspection or applying custom validation layers as temporary mitigations.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2025-02-24T15:51:17.268Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6909153cc28fd46ded7bacba

Added to database: 11/3/2025, 8:49:00 PM

Last enriched: 11/3/2025, 8:59:19 PM

Last updated: 11/5/2025, 2:10:05 PM

Views: 1

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats