Metasploit Framework ios_image_gather Path Traversal Leading to Arbitrary File Write and Code Execution
Summary
| CVE | CVE-2026-87690 |
|---|---|
| State | PUBLISHED |
| Assigner | rapid7 |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-10-12 05:17:03 UTC |
| Updated | 2026-10-14 11:17:06 UTC |
| 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. |
Risk And Classification
Primary CVSS: v3.1 8.8 HIGH from [email protected]
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS: 0.004110000 probability, percentile 0.334620000 (date 2026-10-12)
Problem Types: CWE-22 | CWE-22 CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | [email protected] | Secondary | 8.8 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| 3.1 | CNA | CVSS | 8.8 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
LowPrivileges Required
NoneUser Interaction
RequiredScope
UnchangedConfidentiality
HighIntegrity
HighAvailability
HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Rapid7 | Metasploit Framework | affected 6.5.5 semver | Linux, Windows, macOS |
| CNA | Rapid7 | Metasploit Framework | unaffected 6.5.5 semver | Linux, Windows, macOS |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| github.com/rapid7/metasploit-framework/pull/21880 | [email protected] | github.com | |
| github.com/rapid7/metasploit-framework | [email protected] | github.com | |
| github.com/rapid7/metasploit-framework/releases/tag/6.5.5 | [email protected] | github.com | |
| www.rapid7.com/blog/post/pt-metasploit-wrap-up-belgian-waffles-chocolates-an... | [email protected] | www.rapid7.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: h00die (en)
Additional Advisory Data
| Source | Time | Event |
|---|---|---|
| CNA | 2026-08-27T10:45:00.000Z | Vulnerability reported to Rapid7 |
| CNA | 2026-09-02T00:54:00.000Z | Rapid7 acknowledged receipt and forwarded to the Metasploit team |
| CNA | 2026-09-10T03:22:00.000Z | Vulnerability confirmed legitimate; CVE-2026-87690 reserved |
| CNA | 2026-09-23T04:42:00.000Z | Fix released in Metasploit Framework 6.5.5 |
Solutions
CNA: https://github.com/rapid7/metasploit-framework/releases/tag/6.5.5
There are currently no legacy QID mappings associated with this CVE.