Exploit database

Vulnerability

CVE-2018-19518

Vulnerability details

Score
7.5
Severity
high

CVSS 3.1 · NVD

Vector string

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

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.

CVE Program

Exploit source choices

4 sources
php imap_open Remote Code Execution
MSF-linux--http--php_imap_open_rceMetasploitUnix / remote

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.

2018-10-23php_imap_open_rce.rb
houqe/exp_cve-2018-19518
GH-696420217eaa00ec8ae4744930d3d462GitHubUnofficial GitHub source

houqe/exp_cve-2018-19518 source repository

2023-04-153 files · 4 stars