CVE-2023-35169
php-imap vulnerable to RCE through a directory traversal vulnerability
Also known as GHSA-47p7-xfcc-4pv9
Mitigation
- Upgrade webklex/php-imap to 5.3.0 or later.
- Upgrade webklex/laravel-imap to 5.3.0 or later.
Who should check
- Projects that depend on Packagist package webklex/php-imap (< 5.3.0)
- Projects that depend on Packagist package webklex/laravel-imap (< 5.3.0)
- Anyone running Webklex php-imap < 5.3.0
Vulnerability facts
- Affected
- webklex/php-imap < 5.3.0; webklex/laravel-imap < 5.3.0
- Fixed in
- 5.3.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 9.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: None
- User interaction: None
- Scope: Changed (impact reaches other components)
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 2.70% chance of exploitation in 30 days (percentile 87, 2026-11-26)
- CWE
- CWE-22
- Modified
Description
PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled. Prior to version 5.3.0, an unsanitized attachment filename allows any unauthenticated user to leverage a directory traversal vulnerability, which results in a remote code execution vulnerability. Every application that stores attachments with `Attachment::save()` without providing a `$filename` or passing unsanitized user input is affected by this attack. An attacker can send an email with a malicious attachment to the inbox, which gets crawled with `webklex/php-imap` or `webklex/laravel-imap`. Prerequisite for the vulnerability is that the script stores the attachments without providing a `$filename`, or providing an unsanitized `$filename`, in `src/Attachment::save(string $path, string $filename = null)`. In this case, where no `$filename` gets passed into the `Attachment::save()` method, the package would use a series of unsanitized and insecure input values from the mail as fallback. Even if a developer passes a `$filename` into the `Attachment::save()` method, e.g. by passing the name or filename of the mail attachment itself (from email headers), the input values never get sanitized by the package. There is also no restriction about the file extension (e.g. ".php") or the contents of a file. This allows an attacker to upload malicious code of any type and content at any location where the underlying user has write permissions. The attacker can also overwrite existing files and inject malicious code into files that, e.g. get executed by the system via cron or requests. Version 5.3.0 contains a patch for this issue.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Packagist webklex/php-imap | < 5.3.0 | 5.3.0 | osv |
| Packagist webklex/laravel-imap | < 5.3.0 | 5.3.0 | osv |
| Webklex php-imap | < 5.3.0 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2023-35169. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2023-35169.md Affected: webklex/php-imap < 5.3.0; webklex/laravel-imap < 5.3.0 Fixed in: 5.3.0 Steps: 1. Search this machine and project for webklex/php-imap (Packagist), webklex/laravel-imap (Packagist), Webklex php-imap: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
FAQ
Is CVE-2023-35169 being exploited?
There is no confirmed exploitation: CVE-2023-35169 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 2.70% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2023-35169?
Critical: CVSS 9.1 (v3.1, scored by CNA). Remote, no login needed. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2023-35169?
webklex/php-imap < 5.3.0; webklex/laravel-imap < 5.3.0.
Is there a fix for CVE-2023-35169?
Yes. Fixed in 5.3.0. Upgrade webklex/php-imap to 5.3.0 or later. Upgrade webklex/laravel-imap to 5.3.0 or later.
How do I check if I'm affected by CVE-2023-35169?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.