Description
The Metasploit Framework post module post/apple_ios/gather/ios_image_gather is affected by a relative path traversal vulnerability (CWE-22). The module interpolates file names taken from a Meterpreter directory listing — data fully controlled by a hostile or tampered iOS device — directly into the local destination path passed to client.fs.file.download_file(), with no sanitization. The underlying stdapi sink (lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb) writes to whatever path is supplied, so a listing entry such as ../../msfconsole.rc escapes the intended ~/.msf4/loot/<random> directory and overwrites ~/.msf4/msfconsole.rc, a resource file that every msfconsole invocation automatically executes at startup (lib/msf/ui/console/driver.rb:196). An attacker-controlled device that lures an operator into running this gather module achieves an arbitrary file write as the operator; because the written msfconsole.rc can load a second written file (a Ruby plugin whose top-level code runs on require), this converts into persistent code execution and an interactive shell as the operator (frequently root) on the pentester's workstation at the next console launch. The same traversal was previously fixed upstream in the recursive downloader (stdapi/fs/dir.rb scrubs separators); this module omitted the equivalent scrub. The fix applies the same separator scrub (or File.basename) to listing entries before building the local path.
Published: 2026-10-12
Score: 8.8 High
EPSS: n/a
KEV: No
Impact: Arbitrary file write leading to persistent code execution
Action: Immediate Patch
AI Analysis

Impact

The vulnerability originates from a relative path traversal flaw in the Metasploit Framework module post/apple_ios/gather/ios_image_gather (CWE‑22). The module incorporates file names retrieved from a Meterpreter directory listing, which an attacker can fully control by using a compromised or malicious iOS device. These names are interpolated directly into the local destination path passed to client.fs.file.download_file() without any sanitization. As a result, a crafted entry such as ../../msfconsole.rc can escape the intended ~/.msf4/loot/<random> folder and overwrite the system‑wide resource file ~/.msf4/msfconsole.rc. Upon the next launch of msfconsole, the overwritten resource file is executed, allowing the attacker to load a malicious Ruby plugin and gain persistent code execution as the operator, who is often root on the pentester’s workstation.

Affected Systems

The affected product is Rapid7’s Metasploit Framework, specifically the post module post/apple_ios/gather/ios_image_gather. The vulnerability exists in versions of the framework released before the 6.5.5 update, which introduced input sanitization to the module. No specific sub‑component or product version list is supplied; operators using earlier releases are considered at risk until upgrading to 6.5.5 or later. The CNA solution repository points to the release tag 6.5.5 as the fix.

Risk and Exploitability

The CVSS score of 8.8 classifies this flaw as high severity, reflecting the high impact of arbitrary file write leading to persistent code execution. EPSS data is not available, so the probability of exploitation cannot be quantified but the exploitability is high on environments where an attacker can supply a malicious iOS device and trick an operator into running the vulnerable module. The vulnerability is not listed in the CISA KEV catalog, yet the attack path requires active engagement from the operator, making it a "risk on the operator's side." The path traversal is potentially bypassed by any listing entry containing relative references, and because the underlying stdapi sink writes to any supplied path, the flaw remains exploitable until the sanitization fix is applied.

Generated by OpenCVE AI on October 12, 2026 at 06:43 UTC.

Remediation

Vendor Solution

https://github.com/rapid7/metasploit-framework/releases/tag/6.5.5


OpenCVE Recommended Actions

  • Upgrade Metasploit Framework to release 6.5.5 or later, which applies separator sanitization to the ios_image_gather module.
  • Verify that any custom or third‑party modules applying file paths from external data use proper basename or separator scrub before writing to disk.
  • Restrict use of the ios_image_gather module to trusted iOS devices or disable the module entirely until the patch is deployed.

Generated by OpenCVE AI on October 12, 2026 at 06:43 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 12 Oct 2026 05:00:00 +0000

Type Values Removed Values Added
Description The Metasploit Framework post module post/apple_ios/gather/ios_image_gather is affected by a relative path traversal vulnerability (CWE-22). The module interpolates file names taken from a Meterpreter directory listing — data fully controlled by a hostile or tampered iOS device — directly into the local destination path passed to client.fs.file.download_file(), with no sanitization. The underlying stdapi sink (lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb) writes to whatever path is supplied, so a listing entry such as ../../msfconsole.rc escapes the intended ~/.msf4/loot/<random> directory and overwrites ~/.msf4/msfconsole.rc, a resource file that every msfconsole invocation automatically executes at startup (lib/msf/ui/console/driver.rb:196). An attacker-controlled device that lures an operator into running this gather module achieves an arbitrary file write as the operator; because the written msfconsole.rc can load a second written file (a Ruby plugin whose top-level code runs on require), this converts into persistent code execution and an interactive shell as the operator (frequently root) on the pentester's workstation at the next console launch. The same traversal was previously fixed upstream in the recursive downloader (stdapi/fs/dir.rb scrubs separators); this module omitted the equivalent scrub. The fix applies the same separator scrub (or File.basename) to listing entries before building the local path.
Title Metasploit Framework ios_image_gather Path Traversal Leading to Arbitrary File Write and Code Execution
Weaknesses CWE-22
References
Metrics cvssV3_1

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


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: rapid7

Published:

Updated: 2026-10-12T04:50:56.020Z

Reserved: 2026-09-08T23:15:36.929Z

Link: CVE-2026-87690

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-12T05:17:03.250

Modified: 2026-10-12T05:17:03.250

Link: CVE-2026-87690

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-12T06:45:07Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')