← Vulnerability feed

Vulnerability record · CVE-2018-19518 · published 25 November 2018

CVE-2018-19518: PHP imap_open argument injection enables OS command execution

Php · Php

The University of Washington IMAP Toolkit (2007f) used by PHP's imap_open() launches an rsh command without preventing argument injection. When the IMAP server name is attacker-controlled input, a crafted value can inject arguments into that command. On systems where rsh is a link to ssh, such as Debian and Ubuntu, the injected -oProxyCommand argument can lead to arbitrary OS command execution.

7.5 CVSS 3.1 High EPSS 96% · top 0.1% CWE-88 · Argument injection
7.5CVSS 3.1 base score, v2 8.5
96%EPSS exploitation probability, 30 days
NoNot in CISA KEV
4Affected product versions listed by NVD
40References, 12 tagged exploit
17 Jun 2026Last modified by NVD

Description

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.

CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

high priorityRemote command execution with a very high EPSS score and public exploit code, though exploitation requires attacker-controlled IMAP server input and a specific rsh-to-ssh configuration.

What it is

The University of Washington IMAP Toolkit (2007f) used by PHP's imap_open() launches an rsh command without preventing argument injection. When the IMAP server name is attacker-controlled input, a crafted value can inject arguments into that command. On systems where rsh is a link to ssh, such as Debian and Ubuntu, the injected -oProxyCommand argument can lead to arbitrary OS command execution.

Impact

An attacker who controls the IMAP server name passed to imap_open() can execute arbitrary operating system commands under the web or application process account. This can lead to full compromise of the host and any data or credentials reachable from that process.

Attack surface

Reached remotely over the network through any application that passes untrusted input as the IMAP server name to imap_open(); the CVSS vector indicates network access with low privileges and no user interaction. Exploitation depends on the environment, specifically rsh being replaced by a program such as ssh with different argument semantics.

Exploitation

Not listed in CISA KEV, but EPSS is very high at 0.9523 (99.862nd percentile), and multiple references are tagged Exploit, including public proof-of-concept code and an Exploit-DB entry, indicating mature public exploitation.

What to do

  • Patch PHP and the underlying UW IMAP Toolkit to fixed versions; apply the vendor commits and distribution advisories referenced for Debian, Ubuntu and Gentoo.
  • Upgrade or remove PHP versions that still bundle the vulnerable c-client code, and confirm the fix is present after upgrade.
  • Do not pass user-controlled values directly as the IMAP server name to imap_open(); validate against a strict allowlist of known hosts.
  • On affected hosts, ensure rsh is not a link to ssh or otherwise present with unexpected argument semantics, and remove unnecessary rsh/ssh client binaries from the web server environment.
  • Restrict outbound network access from application servers so injected proxy commands cannot reach external hosts.

Detection

  • Search application code and logs for imap_open() calls where the server argument derives from request parameters, and review for values containing -oProxyCommand or other option-like strings.
  • Monitor web and application process trees for unexpected child processes such as rsh or ssh spawned by the web server user.
  • Alert on outbound connections from web or application servers to unusual destinations consistent with injected proxy commands.
  • Audit installed PHP and UW IMAP package versions against the fixed releases named in the vendor advisories.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

4 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://www.securityfocus.com/bid/106018 Broken Link
http://www.securitytracker.com/id/1042157 Broken Link
https://antichat.com/threads/463395/#post-4254681 ExploitThird Party Advisory
https://bugs.debian.org/913775 Mailing ListThird Party Advisory
https://bugs.debian.org/913835 Mailing ListThird Party Advisory
https://bugs.debian.org/913836 Mailing ListThird Party Advisory
https://bugs.php.net/bug.php?id=76428 ExploitMailing ListVendor Advisory
https://bugs.php.net/bug.php?id=77153 ExploitMailing ListVendor Advisory
https://bugs.php.net/bug.php?id=77160 Vendor Advisory
https://git.php.net/?p=php-src.git%3Ba=commit%3Bh=e5bfea64c81ae34816479bb05d17cdffe45adddb
https://github.com/Bo0oM/PHP_imap_open_exploit/blob/master/exploit.php ExploitThird Party Advisory
https://lists.debian.org/debian-lts-announce/2018/12/msg00006.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2019/03/msg00001.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2021/12/msg00031.html Mailing ListThird Party Advisory
https://security.gentoo.org/glsa/202003-57 Third Party Advisory
https://security.netapp.com/advisory/ntap-20181221-0004/ Third Party Advisory
https://usn.ubuntu.com/4160-1/ Third Party Advisory
https://www.debian.org/security/2018/dsa-4353 Third Party Advisory
https://www.exploit-db.com/exploits/45914/ ExploitThird Party AdvisoryVDB Entry
https://www.openwall.com/lists/oss-security/2018/11/22/3 ExploitMailing ListThird Party Advisory
http://www.securityfocus.com/bid/106018 Broken Link
http://www.securitytracker.com/id/1042157 Broken Link
https://antichat.com/threads/463395/#post-4254681 ExploitThird Party Advisory
https://bugs.debian.org/913775 Mailing ListThird Party Advisory
https://bugs.debian.org/913835 Mailing ListThird Party Advisory
https://bugs.debian.org/913836 Mailing ListThird Party Advisory
https://bugs.php.net/bug.php?id=76428 ExploitMailing ListVendor Advisory
https://bugs.php.net/bug.php?id=77153 ExploitMailing ListVendor Advisory
https://bugs.php.net/bug.php?id=77160 Vendor Advisory
https://git.php.net/?p=php-src.git%3Ba=commit%3Bh=e5bfea64c81ae34816479bb05d17cdffe45adddb
https://github.com/Bo0oM/PHP_imap_open_exploit/blob/master/exploit.php ExploitThird Party Advisory
https://lists.debian.org/debian-lts-announce/2018/12/msg00006.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2019/03/msg00001.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2021/12/msg00031.html Mailing ListThird Party Advisory
https://security.gentoo.org/glsa/202003-57 Third Party Advisory
https://security.netapp.com/advisory/ntap-20181221-0004/ Third Party Advisory
https://usn.ubuntu.com/4160-1/ Third Party Advisory
https://www.debian.org/security/2018/dsa-4353 Third Party Advisory
https://www.exploit-db.com/exploits/45914/ ExploitThird Party AdvisoryVDB Entry
https://www.openwall.com/lists/oss-security/2018/11/22/3 ExploitMailing ListThird Party Advisory

Track CVE-2018-19518 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed9.8CVE-2024-4577PHP-CGI on Windows argument injection leads to remote code executionPHP-CGI on Windows can misinterpret characters in the command line passed to Win32 API functions when certain code pages are configured, due to Windo…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2018-19518), CISA KEV, FIRST EPSS (scores of 2026-09-24). This page is refreshed as NVD updates the record.