# CVE-2026-87690: Metasploit Framework ios_image_gather Path Traversal Leading to Arbitrary File Write and Code Execution

- Severity: High 8.8 (CVSS:3.1, scored by rapid7) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.41%, higher than 37% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2026-10-12T04:50:56.020Z
- Modified: 2026-10-16T17:25:57.940Z
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: rapid7

## 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.

(As written by CVE List.)

## Affected

- Rapid7 Metasploit Framework: before 6.5.5 (not affected: 6.5.5)

## References

- <https://github.com/rapid7/metasploit-framework/releases/tag/6.5.5> (exploit, patch, release-notes)
- <https://github.com/rapid7/metasploit-framework/pull/21880> (exploit, issue-tracking, patch)
- <https://www.rapid7.com/blog/post/pt-metasploit-wrap-up-belgian-waffles-chocolates-and-modules-frites/> (technical-description, vendor-advisory)
- <https://github.com/rapid7/metasploit-framework> (product)

## Sources

- CVE List: [CVE-2026-87690](https://www.cve.org/CVERecord?id=CVE-2026-87690), CVE Terms of Use, modified 2026-10-14
- NVD: [CVE-2026-87690](https://nvd.nist.gov/vuln/detail/CVE-2026-87690), Public domain, modified 2026-10-16

---

Page: https://cve.day/CVE-2026-87690 · Whole record: https://cve.day/CVE-2026-87690.json · Rebuilt by cve.day 2026-11-25T22:59:43.551Z
