CVE-2018-19518

HIGH EXPLOITED RANSOMWARE NUCLEI

University of Washington IMAP Toolkit 2007f - Command Injection

Title source: llm
STIX 2.1

Exploitation Summary

CVE-2018-19518 has been observed exploited in the wild (reported by VulnCheck KEV), including in ransomware campaigns. EIP tracks 5 public exploits from researchers including Metasploit, houqe, ensimag-security, including a Metasploit module exploits/linux/http/php_imap_open_rce. A Nuclei detection template is also available.

AI-analyzed exploit summary This Metasploit module exploits CVE-2018-19518, a vulnerability in PHP's imap_open function that allows remote code execution by leveraging the ProxyCommand option in SSH when rsh is mapped to SSH on Debian-based systems. It targets applications like Prestashop, SuiteCRM, and e107 v2 by injecting a malicious command through IMAP configuration settings.

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.

Exploits (5)

exploitdb WORKING POC VERIFIED
by Metasploit · rubyremotelinux
https://www.exploit-db.com/exploits/45914

This Metasploit module exploits CVE-2018-19518, a vulnerability in PHP's imap_open function that allows remote code execution by leveraging the ProxyCommand option in SSH when rsh is mapped to SSH on Debian-based systems. It targets applications like Prestashop, SuiteCRM, and e107 v2 by injecting a malicious command through IMAP configuration settings.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PHP (imap_open function), Prestashop, SuiteCRM, e107 v2
Auth required
Prerequisites: Administrator credentials for the target application · Target system must be Debian-based with rsh mapped to SSH
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 4 stars
by houqe · remote
https://github.com/houqe/EXP_CVE-2018-19518

This PoC exploits CVE-2018-19518, a command injection vulnerability in the target software, by sending a crafted HTTP POST request with a base64-encoded reverse shell payload. The exploit writes a reverse shell script to /tmp/test and executes it.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: Unknown (likely a web application with command injection vulnerability)
No auth needed
Prerequisites: Network access to the target · Target application must be vulnerable to command injection
devstral-2 · analyzed Feb 16, 2026 Full analysis →
gitlab WORKING POC
by ensimag-security · poc
https://gitlab.com/ensimag-security/CVE-2018-19518

This repository contains a functional exploit for CVE-2018-19518, which leverages the `imap_open()` function in PHP to achieve remote code execution (RCE) via the `-oProxyCommand` argument. The exploit demonstrates how to bypass disabled functions by injecting a base64-encoded command into the hostname parameter.

Classification
Working Poc 95%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PHP with IMAP extension (versions prior to the fix)
No auth needed
Prerequisites: PHP with IMAP extension enabled · rsh/ssh binaries available on the target system · rsh linked to ssh (common on Debian/Ubuntu)
devstral-2 · analyzed Feb 23, 2026 Full analysis →
nomisec WORKING POC
by ensimag-security · poc
https://github.com/ensimag-security/CVE-2018-19518

This repository contains a working proof-of-concept exploit for CVE-2018-19518, which leverages a command injection vulnerability in PHP's imap_open function. The exploit demonstrates how to bypass disable_functions via the ProxyCommand parameter in the IMAP server string.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PHP with IMAP extension (versions prior to the fix)
No auth needed
Prerequisites: PHP with IMAP extension enabled · Ability to send HTTP POST requests to the target
devstral-2 · analyzed Feb 16, 2026 Full analysis →
metasploit WORKING POC GOOD
by Anton Lopanitsyn, Twoster, h00die, Paolo Serracino, Pietro Minniti, Damiano Proietti · rubypoc
https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/php_imap_open_rce.rb

This Metasploit module exploits CVE-2018-19518, a vulnerability in PHP's imap_open function that allows remote code execution by leveraging the ProxyCommand option in SSH when rsh is mapped to SSH on Debian-based systems. It targets applications like Prestashop, SuiteCRM, e107, and Horde IMP H3.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Moderate
Reliability
Reliable
Target: PHP (versions before 5.6.39), Prestashop, SuiteCRM, e107 v2, Horde IMP H3
Auth required
Prerequisites: Administrator credentials for targeted applications · Debian-based system with rsh mapped to SSH
devstral-2 · analyzed Apr 23, 2026 Full analysis →

Nuclei Templates (1)

PHP imap - Remote Command Execution
HIGHby princechaddha

References (20)

Core 20
Core References
Vendor Advisory x_refsource_misc
https://bugs.php.net/bug.php?id=77160
Exploit, Third Party Advisory, VDB Entry exploit x_refsource_exploit-db
https://www.exploit-db.com/exploits/45914/
Mailing List, Third Party Advisory mailing-list x_refsource_mlist
https://lists.debian.org/debian-lts-announce/2019/03/msg00001.html
Third Party Advisory x_refsource_confirm
https://security.netapp.com/advisory/ntap-20181221-0004/
Broken Link vdb-entry x_refsource_sectrack
http://www.securitytracker.com/id/1042157
Third Party Advisory vendor-advisory x_refsource_debian
https://www.debian.org/security/2018/dsa-4353
Mailing List, Third Party Advisory x_refsource_misc
https://bugs.debian.org/913835
Exploit, Mailing List, Third Party Advisory x_refsource_misc
https://www.openwall.com/lists/oss-security/2018/11/22/3
Broken Link vdb-entry x_refsource_bid
http://www.securityfocus.com/bid/106018
Exploit, Mailing List, Vendor Advisory x_refsource_misc
https://bugs.php.net/bug.php?id=76428
Mailing List, Third Party Advisory x_refsource_misc
https://bugs.debian.org/913775
Mailing List, Third Party Advisory x_refsource_misc
https://bugs.debian.org/913836
Exploit, Third Party Advisory x_refsource_misc
https://antichat.com/threads/463395/#post-4254681
Exploit, Mailing List, Vendor Advisory x_refsource_misc
https://bugs.php.net/bug.php?id=77153
Mailing List, Third Party Advisory mailing-list x_refsource_mlist
https://lists.debian.org/debian-lts-announce/2018/12/msg00006.html
Third Party Advisory vendor-advisory x_refsource_ubuntu
https://usn.ubuntu.com/4160-1/
Third Party Advisory vendor-advisory x_refsource_gentoo
https://security.gentoo.org/glsa/202003-57
Mailing List, Third Party Advisory mailing-list x_refsource_mlist
https://lists.debian.org/debian-lts-announce/2021/12/msg00031.html

Scores

CVSS v3 7.5
EPSS 0.9384
EPSS Percentile 99.9%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Details

VulnCheck KEV 2023-02-14
Ransomware Use Confirmed
CWE
CWE-88
Status published
Products (7)
canonical/ubuntu_linux 16.04
canonical/ubuntu_linux 18.04
canonical/ubuntu_linux 19.04
debian/debian_linux 8.0
debian/debian_linux 9.0
php/php 5.6.0 - 5.6.38
uw-imap_project/uw-imap 2007f
Published Nov 25, 2018
Tracked Since Feb 18, 2026