Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessLure operator to run gather module
-
DeliveryHostile device returns traversal filename in listing
-
Exploitdownload_file writes ../../msfconsole.rc outside loot dir
-
ExecutionResource file and Ruby plugin auto-execute at next launch
-
ImpactInteractive shell as operator (often root)
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires three concrete prerequisites drawn from the description: (1) the operator must have an active Meterpreter session to an attacker-controlled or tampered iOS device; (2) the operator must run the specific post module post/apple_ios/gather/ios_image_gather; and (3) the hostile device must return a directory listing containing a crafted filename with traversal sequences (e.g. ../../msfconsole.rc) that the module interpolates unsanitized into client.fs.file.download_file(). Limiting factors: this is not remote-unauthenticated against a default service - it demands operator user interaction (UI:R), control over the connected device, and that the target runs Metasploit versions prior to 6.5.5. No authentication on the workstation is needed (PR:N), and the written msfconsole.rc only executes at the next msfconsole launch. |
| Impact | Signals conflict on how urgent this is. The CVSS base score of 8.8 (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) looks severe, and the outcome is genuinely serious: an arbitrary file write that converts into persistent code execution and an interactive shell as the Metasploit operator, who is frequently running as root on the pentester workstation. However, the exploitation-probability signals are muted or absent: no CISA KEV listing, no public exploit code identified, and no EPSS score was provided in the input, so there is no evidence of broad or opportunistic exploitation. The AC:L in the NVD vector arguably understates reality, since a successful attack requires an attacker-controlled or tampered iOS device, a Meterpreter session established to it, and social engineering to lure the operator into running one specific post module (post/apple_ios/gather/ios_image_gather). This is a targeted, operator-in-the-loop attack against a tooling niche rather than a mass-exploitable internet-facing flaw. Net assessment: a real and worth-patching issue for anyone running Metasploit against untrusted iOS devices, but not an emergency widespread-exploitation priority. Fixed upstream in release 6.5.5 (PR 21880), so remediation is straightforward. |
| Exploit ScenarioDerived | A penetration tester opens a Meterpreter session to an iOS device that is actually attacker-controlled or tampered and runs the ios_image_gather post module. The device returns a directory listing containing a crafted entry such as ../../msfconsole.rc, which the unsanitized download path writes outside the intended loot directory, overwriting the operator's startup resource file; a companion written Ruby plugin then executes the next time msfconsole launches, yielding code execution as the operator (often root). No public POC was identified at time of analysis, though the fixing PR diff publicly illustrates the vulnerable sink; exploitation requires user interaction (UI:R) but no privileges on the workstation. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 12, 2026
Persistent code execution on a penetration tester's workstation is achievable through a relative path traversal (CWE-22) in the Metasploit Framework post module post/apple_ios/gather/ios_image_gather, affecting versions prior to 6.5.5. A hostile or tampered iOS device can return a crafted directory-listing entry (for example ../../msfconsole.rc) that the module interpolates without sanitization into the local destination path handed to client.fs.file.download_file(), overwriting ~/.msf4/msfconsole.rc, which every msfconsole invocation automatically executes at startup; because the written resource file can load a second written Ruby plugin, this converts into an interactive shell as the operator (frequently root) at the next console launch. Exploitation is not remote-unauthenticated against a default service: it requires operator interaction (UI:R) to run the specific gather module against an attacker-controlled Meterpreter session, no workstation authentication (PR:N) is needed, and the assessed attack complexity is High because the hostile device, the specific module, and the resulting file write must all align; no public exploit code was identified at time of analysis, and the flaw is fixed in the 6.5.5 release.
RemediationAI
Upgrade to Metasploit Framework 6.5.5 (https://github.com/rapid7/metasploit-framework/releases/tag/6.5.5), which includes the sanitization fix from PR 21880 (https://github.com/rapid7/metasploit-framework/pull/21880). If immediate upgrade is not possible, do not run post/apple_ios/gather/ios_image_gather - or any other gather module that writes remote-supplied filenames to local paths - against sessions on devices that are not fully trusted; retrieve images manually over an out-of-band channel instead, accepting extra operational effort. Harden the operator's home directory by restricting write permissions on ~/.msf4, especially msfconsole.rc and the plugins directory, and monitor those paths for unexpected modification, understanding that legitimate operator workflows may be inconvenienced. Where feasible, avoid automatic loading of msfconsole.rc through controlled startup wrappers or a supplied resource file, but note that this will also skip legitimate resource and plugin configuration at startup. Integrity monitoring or checksum verification of msfconsole.rc and any referenced plugin files can detect tampering before the next console launch, at the cost of added operational overhead.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerable code lives in a Metasploit post-exploitation module that gathers iOS images through Meterpreter's stdapi file extension. Directory listing entries are treated as trusted input: each filename is joined onto a randomized loot directory under ~/.msf4/loot/ without scrubbing path separators, then passed as the local destination to client.fs.file.download_file(). The stdapi sink implemented in lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb writes to whatever path it is supplied, so a listing containing ../ sequences escapes the intended loot directory. CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) is the root-cause class here. The recursive downloader in stdapi/fs/dir.rb already scrubs separators, and this module omitted the equivalent scrub; upstream PR 21880 fixes the omission by sanitizing/rebasing filenames and switching to store_loot. The overwritten target, ~/.msf4/msfconsole.rc, is automatically executed by lib/msf/ui/console/driver.rb:196 on every msfconsole start, which provides both persistence and a path to secondary code execution when the resource file requires a second written Ruby plugin whose top-level code runs on require.
Know when Metasploit gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
AC:H because the attacker must control/tamper an iOS device and lure the operator into running one specific module; UI:R for operator action; full C/I/A impact from code execution as operator.
Primary rating from Vendor (rapid7).
CVSS VectorVendor: rapid7
Lifecycle Timeline
2DescriptionCVE.org
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.
Executive ViewAI
Metasploit Framework versions prior to 6.5.5 contain a path traversal vulnerability that allows a malicious iOS device to achieve persistent code execution on a penetration tester's workstation, potentially as root, when the operator runs the ios_image_gather post module. This affects security teams using Metasploit for authorized testing, and successful exploitation could compromise sensitive client data, internal credentials, and the integrity of security assessments. Leadership should prioritize mitigations because the vulnerability targets trusted security personnel and can lead to lateral movement within the corporate network.
No vendor-released patch identified at time of analysis; interim mitigations include isolating Metasploit workstations, prohibiting use of the affected module against untrusted iOS devices, disabling or monitoring ~/.msf4/msfconsole.rc auto-execution, running msfconsole with --no-rc, enforcing non-root execution, and monitoring file integrity of ~/.msf4/.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
More in Metasploit
View allRapid7's Metasploit msfvenom framework handles APK files in a way that allows for a malicious user to craft and publish
Rapid7 Metasploit Framework versions before 5.0.85 suffers from an instance of CWE-78: OS Command Injection, wherein the
The Metasploit Framework module "post/osx/gather/enum_osx module" is affected by a relative path traversal vulnerability
The Metasploit Framework module "auxiliary/admin/http/telpho10_credential_dump" module is affected by a relative path tr
Rapid7 Metasploit Framework suffers from an instance of CWE-22, Improper Limitation of a Pathname to a Restricted Direct
The web UI in Rapid7 Metasploit before 4.14.1-20170828 allows logout CSRF, aka R7-2017-22. Rated medium severity (CVSS 6
Cross-site Scripting (XSS) vulnerability in the 'notes' field of a discovered scan asset in Rapid7 Metasploit Pro allows
Cross-site Scripting (XSS) vulnerability in the 'host' field of a discovered scan asset in Rapid7 Metasploit Pro allows
Rapid7 Metasploit Pro installers prior to version 4.13.0-2017022101 contain a DLL preloading vulnerability, wherein it i
Routes used to stop running Metasploit tasks (either particular ones or all tasks) allowed GET requests. Rated low sever
All editions of Rapid7 Metasploit prior to version 4.13.0-2017020701 contain a directory traversal vulnerability in the
All editions of Rapid7 Metasploit prior to version 4.13.0-2017020701 contain a directory traversal vulnerability in the
EUVD-2026-97177
GHSA-663p-9fgr-v7m7
NVD
CVE.org
EPSS
Exploit-DB