CVE-2026-130336 in Metasploit Framework
Summary
by MITRE • 11/25/2026
Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') in the HWBridge custom methods command dispatcher (lib/rex/post/hwbridge/ui/console/command_dispatcher/custom_methods.rb) in Rapid7 Metasploit Framework versions prior to 6.5.10 on all platforms allows a malicious or compromised hardware bridge to execute arbitrary code in the msfconsole process via a crafted method_name returned by the /custom_methods endpoint. The injected code runs automatically when the operator connects to the bridge, without the operator invoking any custom command.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/25/2026
The vulnerability identified as Improper Neutralization of Directives in Dynamically Evaluated Code, commonly referred to as Eval Injection, represents a critical security flaw within the Rapid7 Metasploit Framework prior to version 6.5.10. This specific issue resides in the HWBridge custom methods command dispatcher located at lib/rex/post/hwbridge/ui/console/command_dispatcher/custom_methods.rb. The core technical failure involves the framework's handling of method names returned by a connected hardware bridge via the /custom_methods endpoint. When msfconsole establishes a connection with an external hardware device, it retrieves metadata about available commands from this endpoint and dynamically constructs executable code based on the provided method_name values without sufficient sanitization or validation. This architectural decision assumes that all data received from trusted peripheral devices is safe for direct evaluation within the Ruby interpreter context of the console process.
The operational impact of this vulnerability is severe because it allows an attacker who controls or compromises a hardware bridge to execute arbitrary code directly within the msfconsole process on the operator's machine. Unlike many remote code execution vulnerabilities that require user interaction such as clicking a link or typing a specific command, this exploit triggers automatically upon connection establishment. The malicious payload embedded in the crafted method_name is evaluated and executed immediately when the operator connects to the compromised bridge. This bypasses standard operational security controls because the victim does not need to invoke any custom commands; the mere act of connecting initiates the code execution sequence. Consequently, an attacker can gain full control over the Metasploit session, potentially leading to complete compromise of the attacking infrastructure used for penetration testing or security assessments.
From a classification perspective, this vulnerability aligns with CWE-95, which describes Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'). The root cause is the use of dynamic code evaluation mechanisms on untrusted input without proper neutralization of special elements that could alter the intended execution flow. In the context of the MITRE ATT&CK framework, this behavior corresponds to techniques involving command and script interpretation or remote code execution via trusted software binaries. The attack vector leverages the trust relationship between the console application and its peripheral hardware components, exploiting a blind spot where input validation is assumed rather than enforced through rigorous security checks.
Mitigation strategies for this vulnerability primarily involve upgrading the Metasploit Framework to version 6.5.10 or later, where the issue has been addressed by implementing stricter input validation and avoiding direct evaluation of untrusted method names. For environments that cannot immediately upgrade, operators should exercise extreme caution when connecting to hardware bridges from unverified sources. It is advisable to treat all external peripheral inputs as potentially hostile and implement network-level segmentation to isolate testing infrastructure from critical systems. Additionally, developers integrating with HWBridge APIs should validate all returned metadata against a whitelist of expected method names before passing them to any dynamic execution contexts within the application logic.