CVE-2026-5463

pymetasploit3 - Command Injection via Newline Injection in console.run_module_with_output()

Published Apr 3, 2026 CVSS 4.0 · 9.3 Critical EPSS 2.2% KEV · Not listed
Description
Command injection vulnerability in console.run_module_with_output() in pymetasploit3 through version 1.0.6 allows attackers to inject newline characters into module options such as RHOSTS. This breaks the intended command structure and causes the Metasploit console to execute additional unintended commands, potentially leading to arbitrary command execution and manipulation of Metasploit sessions.

Analysis

AI-generated

Technical impact

A flaw in the Python wrapper for Metasploit, pymetasploit3, allows an attacker to insert newline characters (Command Injection, CWE‑77) into module options such as RHOSTS when calling console.run_module_with_output(). The added newlines break the intended command syntax, causing the Metasploit console to execute additional, unintended commands. This can result in the execution of arbitrary system commands outside the normal Metasploit flow, potentially compromising the security of any hosts the modules target as well as the integrity of the Metasploit sessions themselves.

Affected Systems

The vulnerability affects installations of the pymetasploit3 project maintained by Dan McInerney. Versions up to and including 1.0.6 contain the flaw. Any deployment that relies on these versions for automated module execution or the remote provision of module options should be considered at risk.

Risk and Exploitability

The CVSS score of 9.3 denotes a high severity vulnerability. Although the EPSS score is 2% and the issue is not listed in the CISA KEV catalog, the potential for arbitrary command execution is significant. Based on the description, it is inferred that an attacker must be able to supply module options to console.run_module_with_output(), implying either a local user with write access to a Metasploit console or a remote user with authenticated access to supply those options. Successful exploitation would allow an attacker to run arbitrary commands on the system hosting the Metasploit framework, thereby gaining full control over the environment.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade pymetasploit3 to the latest released version (≥ 1.0.7) to eliminate the newline injection flaw.
  • If an upgrade cannot be applied immediately, restrict or block use of console.run_module_with_output() in the environment until a fix is in place.
  • Implement input validation to reject or properly escape newline characters in module options such as RHOSTS before they are passed to the Metasploit console.
  • Monitor Metasploit console logs for unexpected command execution and audit session integrity to detect potential abuse.

Generated by OpenCVE AI on October 25, 2026 at 21:12 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-qpc3-8vqg-8g6w pymetasploit3 vulnerable to command injection in console.run_module_with_output()
History
Type Values Removed Values Added
Title pymetasploit3 Command Injection via Newline Injection in console.run_module_with_output() pymetasploit3 - Command Injection via Newline Injection in console.run_module_with_output()
Type Values Removed Values Added
Title Newline Injection in pymetasploit3 Allows Arbitrary Command Execution pymetasploit3 Command Injection via Newline Injection in console.run_module_with_output()
Type Values Removed Values Added
Title Newline Injection in pymetasploit3 Allows Arbitrary Command Execution
Type Values Removed Values Added
Title Command Injection in pymetasploit3’s console.run_module_with_output() Allows Arbitrary System Command Execution
Type Values Removed Values Added
Title Command Injection in pymetasploit3’s console.run_module_with_output() Allows Arbitrary System Command Execution
Type Values Removed Values Added
Title Command Injection in pymetasploit3 Enables Arbitrary Command Execution
Type Values Removed Values Added
First Time appeared Danmcinerney
Danmcinerney pymetasploit3
CPEs cpe:2.3:a:danmcinerney:pymetasploit3:*:*:*:*:*:*:*:*
Vendors & Products Danmcinerney
Danmcinerney pymetasploit3
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Title Command Injection in pymetasploit3 Enables Arbitrary Command Execution
First Time appeared Dan Mcinerney
Dan Mcinerney pymetasploit3
Vendors & Products Dan Mcinerney
Dan Mcinerney pymetasploit3
Type Values Removed Values Added
Description Command injection vulnerability in console.run_module_with_output() in pymetasploit3 through version 1.0.6 allows attackers to inject newline characters into module options such as RHOSTS. This breaks the intended command structure and causes the Metasploit console to execute additional unintended commands, potentially leading to arbitrary command execution and manipulation of Metasploit sessions.
Weaknesses CWE-77
References
Metrics cvssV2_0

{'score': 7.5, 'vector': 'AV:N/AC:L/Au:N/C:P/I:P/A:P'}

cvssV3_1

{'score': 8.6, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L'}

cvssV4_0

{'score': 9.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:L/SC:L/SI:H/SA:L'}

Weaknesses
  • CWE-77

    Improper Neutralization of Special Elements used in a Command ('Command Injection')

Sources

Status
PUBLISHED
Assigner
TuranSec
Published
Updated
Aug 10, 2026, 11:30 AM
Reserved
Apr 3, 2026, 4:28 AM
Status
Analyzed
Published
Apr 3, 2026, 5:16 AM
Modified
Jul 24, 2026, 8:10 PM