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.
Published: 2026-04-03
Score: 9.3 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Command Injection leading to Arbitrary Command Execution
Action: Immediate Patch
AI Analysis

Impact

A flaw in the Python wrapper for Metasploit, pymetasploit3, allows an attacker to insert newline characters 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 EPSS data is not available 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.

Generated by OpenCVE AI on April 3, 2026 at 07:51 UTC.

Remediation

No vendor fix or workaround currently provided.

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 April 3, 2026 at 07:51 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 03 Apr 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 03 Apr 2026 10:15:00 +0000

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

Fri, 03 Apr 2026 05:15:00 +0000

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'}


Subscriptions

Dan Mcinerney Pymetasploit3
cve-icon MITRE

Status: PUBLISHED

Assigner: TuranSec

Published:

Updated: 2026-04-03T15:35:09.337Z

Reserved: 2026-04-03T04:28:08.555Z

Link: CVE-2026-5463

cve-icon Vulnrichment

Updated: 2026-04-03T15:34:55.762Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-04-03T05:16:24.160

Modified: 2026-04-03T16:10:23.730

Link: CVE-2026-5463

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-03T09:15:47Z

Weaknesses