This is less a front-door RCE than a booby-trapped mail slot that only fires if your app jams user input straight into IMAP
Tenable plugin 119764 is a version-based hit for upstream PHP 5.6.0 through 5.6.38, fixed in 5.6.39. The package rolls up three issues that matter here: CVE-2018-19518 (imap_open() argument injection that can reach shell execution on Unix-like systems), CVE-2018-19935 (imap_mail() NULL dereference DoS), and CVE-2018-20783 (PHAR parser out-of-bounds read / memory disclosure).
Tenable's HIGH label is understandable if you look only at the worst CVE in isolation, but it overstates fleet-wide risk. The only path that plausibly becomes code execution requires far more than an old PHP banner: the imap extension must be present, the application must pass attacker-controlled mailbox/server strings into IMAP functions, and insecure shell transport must still be reachable; the other bundled bugs are a crash and an over-read, not mass-compromise material.
4 steps from start to impact.
Find an IMAP-backed feature
Burp Suite or plain curl by probing forms, admin panels, or API endpoints that accept mailbox/server strings.- Public or internal reachability to the web app
- A code path that uses
imap_open()or related IMAP functions - Attacker can influence the mailbox/server parameter
- Most PHP sites do not expose IMAP mailbox creation/opening to arbitrary users
- Many affected servers run PHP but do not load
ext/imapat all - The vulnerable function is usually buried in a niche workflow, not the main request path
119764 does not prove this step; it is banner/version driven and cannot confirm code-level use of imap_open().Inject a hostile mailbox string
Bo0oM/PHP_imap_open_exploit / Exploit-DB material for CVE-2018-19518, the attacker supplies a crafted IMAP server name that abuses the underlying UW c-client rsh/ssh handling. The payload is not magical; it works only if application input reaches the mailbox string with little or no validation.- Attacker-controlled mailbox/server string reaches IMAP calls
- Input validation does not strip dangerous connection-string content
- The target is using the vulnerable IMAP stack behavior
- Normal applications often hardcode the IMAP host instead of trusting user input
- Validation, allowlists, or fixed account profiles usually kill the exploit path early
- This is not a one-request generic exploit against every PHP endpoint
Trigger shell transport in ext/imap
rsh/ssh-style preauthenticated transport rather than a safe /norsh path. PHP's own manual now warns that passing untrusted mailbox data is insecure unless imap.enable_insecure_rsh is disabled.ext/imapis installed and activeimap.enable_insecure_rshis not effectively disabled or the code path still reaches insecure transport- Unix-like target behavior consistent with the advisory
- Modern hardening often disables this outright
- Windows-only PHP estates are not the natural sweet spot for this path
- Even where IMAP is present, many apps never exercise the risky transport options
php-fpm, Apache worker children, or web-user-owned ssh/rsh invocations.Land code execution as the web user
www-data, apache, or the PHP-FPM pool user. Impact then depends on local permissions, secrets exposure, writable paths, and whether the host is a shared app server with adjacent credentials.- Successful argument injection
- Process-spawn rights for the web stack
- Useful local permissions, secrets, or follow-on privilege escalation paths
- Least-privilege pools, containerization, SELinux/AppArmor, and read-only deployments reduce blast radius
- No evidence surfaced that this specific PHP 5.6.39 bundle has broad in-the-wild mass exploitation
- The plugin also includes lower-impact bugs that do not turn into shell access
php-fpm/Apache child process execution is high-value.The supporting signals.
| In-the-wild status | No evidence surfaced that CVE-2018-19518, CVE-2018-19935, or CVE-2018-20783 are in CISA KEV. NVD does, however, tag public exploit references for CVE-2018-19518, so this is not purely theoretical. |
|---|---|
| Proof-of-concept availability | CVE-2018-19518 has public exploit material referenced by NVD, including Exploit-DB 45914 and the GitHub repo Bo0oM/PHP_imap_open_exploit. I did not find comparable mature weaponization for CVE-2018-20783; that bug is mainly an over-read. |
| EPSS | Mirrors of FIRST EPSS place CVE-2018-19518 very high at roughly 93.96% probability / 99.9th percentile, while CVE-2018-20783 sits around 6.54% / ~91st percentile. That threat signal is real, but for 19518 it still collides with major application-path friction. |
| KEV status | Not KEV-listed in the CISA catalog search results reviewed for these CVEs. That matters: if CISA had field evidence of routine exploitation, this score would move up fast. |
| CVSS vector reality check | The lead RCE issue, CVE-2018-19518, is CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H — note the high attack complexity and low privileges required. Those are exactly the real-world brakes here: a reachable, authenticated-or-semi-trusted application workflow must hand attacker input to IMAP. |
| Affected versions | Upstream affected range for this plugin is PHP 5.6.0-5.6.38. CVE-2018-20783 also affects PHP 7.0.x <7.0.33, 7.1.x <7.1.25, and 7.2.x <7.2.13; CVE-2018-19935 spans PHP 5.x and 7.x before 7.3.0. |
| Fixed versions / backports | Upstream fix for the plugin finding is PHP 5.6.39. Distro packages may be backported without showing the upstream version string you expect, so remote banner hits on Ubuntu, Debian, RHEL, or SUSE should be verified against vendor package advisories before you burn change windows. |
| Exposure data | Internet exposure of old PHP is still non-trivial: BitSight's public footprint page for PHP 5.6.38 showed 22,160 observations over the prior 30 days. But exposure counts are noisy here because a PHP version banner does not prove ext/imap is installed or that any app path is attacker-reachable. |
| Disclosure timeline | PHP shipped 5.6.39 as a security release on 2018-12-06. NVD shows CVE-2018-19518 published on 2018-11-25 and CVE-2018-20783 on 2019-02-21`, reflecting CVE record timing rather than when the fleet actually got the bundled fix. |
| Researcher / reporting context | The decisive issue, CVE-2018-19518, was discussed publicly in PHP bug #77153 and oss-security. The PHP maintainers explicitly noted that the problem sat in the underlying c-client behavior and had to be mitigated in PHP. |
noisgate verdict.
The decisive factor is attack-path friction: this is not a generic remote exploit against any PHP 5.6 web server, but a narrow chain that depends on ext/imap being present and the application handing attacker-controlled mailbox input into that code path. Public exploit code exists, but the reachable population is much smaller than Tenable's version-only detection implies.
Why this verdict
- Version hit != exploit path: Tenable detects by PHP banner/version, not by proving
ext/imapis loaded,imap.enable_insecure_rshis reachable, or the app passes untrusted mailbox strings into IMAP. - The worst bug is workflow-dependent RCE:
CVE-2018-19518can become code execution, but only after multiple prerequisites stack: attacker reachability, vulnerable app feature, controllable mailbox parameter, and risky IMAP transport behavior. - The rest of the bundle pulls severity down:
CVE-2018-19935is a crash andCVE-2018-20783is an out-of-bounds read / disclosure bug. They do not justify keeping the overall plugin at a blanket HIGH by themselves.
Why not higher?
I am not calling this HIGH because the key exploit chain is not broad enough. Requiring a specific application behavior on top of an optional PHP extension is classic post-discovery friction, and there is no KEV-style evidence that attackers are mass-harvesting old PHP banners for this specific chain.
Why not lower?
I am not pushing this to LOW because there is still a legitimate public RCE path with published exploit references, and legacy PHP 5.6 fleets do show up on the public internet. If you do have an exposed mail-import or webmail-style feature using imap_open(), the local risk on those nodes is materially higher than the fleet average.
What to do — in priority order.
- Disable insecure IMAP shell transport — Set
imap.enable_insecure_rsh=0anywhereext/imapis still needed, and prefer explicit/norshin connection strings. For a MEDIUM verdict there is no mitigation SLA; do this in the next normal change window, but make it an exception candidate sooner on internet-facing legacy apps. - Remove
ext/imapwhere unused — If the host is just serving PHP apps and not doing mailbox operations, uninstall or stop loading the IMAP extension. This collapses the lead RCE path entirely; with no mitigation SLA for MEDIUM, fold it into standard hardening work rather than emergency ops. - Hunt for risky code paths — Search application code and config for
imap_open(,imap_mail(,imap_append(, and dynamic mailbox strings built from request parameters, tenant settings, or admin-entered hostnames. Prioritize internet-facing and authenticated self-service features first; this is the fastest way to separate noisy banner hits from actually dangerous nodes. - Fence legacy PHP behind stronger boundaries — Where immediate upgrades are hard, move old PHP 5.6 apps behind VPN, SSO, reverse-proxy ACLs, or admin network restrictions so fewer attackers can even reach the vulnerable workflow. There is no mitigation SLA for MEDIUM, but shrinking reachability is still worthwhile before you get to full remediation.
disable_functionsis not a reliable control here; the whole point ofCVE-2018-19518is that the shell path can bypass the usual expectation that PHP command-exec functions are blocked.- A generic WAF rule set is not enough by itself, because the dangerous input often lives in authenticated forms or app-specific parameters and the exploit path depends on backend function usage, not just URL shape.
- Hiding or rewriting the
X-Powered-By/ banner string only reduces scanner visibility; it does nothing to remove the vulnerable code or extension behavior.
Crowdsourced verification payload.
Run this on the target Linux/Unix host that actually executes PHP, not from the scanner. Invoke it as bash verify_php_5639.sh /usr/bin/php (or omit the argument to auto-discover php); no root is required unless your PHP binary or package metadata is locked down.
#!/usr/bin/env bash
# verify_php_5639.sh
# Purpose: assess whether local PHP is upstream-vulnerable to the PHP 5.6.39 bundle
# Exit codes: 0=PATCHED, 1=VULNERABLE, 2=UNKNOWN
set -u
PHPBIN="${1:-$(command -v php 2>/dev/null || true)}"
if [[ -z "$PHPBIN" || ! -x "$PHPBIN" ]]; then
echo "UNKNOWN - php binary not found"
exit 2
fi
phpv_raw="$($PHPBIN -v 2>/dev/null | head -n1)"
phpver="$($PHPBIN -r 'echo PHP_VERSION;' 2>/dev/null)"
if [[ -z "$phpver" ]]; then
echo "UNKNOWN - unable to read PHP_VERSION from $PHPBIN"
exit 2
fi
# Helper: compare semantic versions with sort -V
ver_lt() {
[[ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" != "$2" ]]
}
# Gather extension / ini hints
modules="$($PHPBIN -m 2>/dev/null | tr '[:upper:]' '[:lower:]')"
phpi="$($PHPBIN -i 2>/dev/null || true)"
imap_loaded="no"
phar_loaded="unknown"
insecure_rsh="unknown"
if grep -qx 'imap' <<< "$modules"; then
imap_loaded="yes"
fi
if grep -qx 'phar' <<< "$modules"; then
phar_loaded="yes"
else
phar_loaded="no"
fi
imap_line="$(grep -i '^imap.enable_insecure_rsh' <<< "$phpi" | head -n1 || true)"
if [[ -n "$imap_line" ]]; then
# Common php -i format: imap.enable_insecure_rsh => Off => Off
if grep -Eiq '=>[[:space:]]*off|=>[[:space:]]*0|=>[[:space:]]*false' <<< "$imap_line"; then
insecure_rsh="off"
elif grep -Eiq '=>[[:space:]]*on|=>[[:space:]]*1|=>[[:space:]]*true' <<< "$imap_line"; then
insecure_rsh="on"
fi
fi
# Detect distro-packaged builds where backports may make simple upstream version checks unreliable
backport_hint="no"
if grep -Eiq '(ubuntu|debian|red hat|rhel|suse|almalinux|rocky|amazon)' <<< "$phpv_raw"; then
backport_hint="yes"
fi
# Upstream logic for this specific Tenable finding
# Fixed upstream at 5.6.39; plugin only targets PHP 5.6.x < 5.6.39
major_minor="$(awk -F. '{print $1 "." $2}' <<< "$phpver")"
if [[ "$major_minor" != "5.6" ]]; then
echo "PATCHED - local PHP version is $phpver; this specific plugin targets 5.6.x < 5.6.39"
exit 0
fi
if ! ver_lt "$phpver" "5.6.39"; then
echo "PATCHED - local PHP version is $phpver (>= 5.6.39 upstream)"
exit 0
fi
# If distro packaging is obvious, we cannot trust upstream version alone.
if [[ "$backport_hint" == "yes" ]]; then
echo "UNKNOWN - PHP reports $phpver but appears distro-packaged/backported; verify package advisory status as well"
echo "INFO - imap_loaded=$imap_loaded insecure_rsh=$insecure_rsh phar_loaded=$phar_loaded"
exit 2
fi
# Upstream-built or plain versioned vulnerable case
if [[ "$imap_loaded" == "yes" && "$insecure_rsh" == "on" ]]; then
echo "VULNERABLE - upstream PHP $phpver with ext/imap loaded and imap.enable_insecure_rsh enabled"
exit 1
fi
if [[ "$imap_loaded" == "yes" && "$insecure_rsh" == "unknown" ]]; then
echo "VULNERABLE - upstream PHP $phpver with ext/imap loaded; confirm imap.enable_insecure_rsh but treat as exposed to this bundle"
exit 1
fi
if [[ "$phar_loaded" == "yes" ]]; then
echo "VULNERABLE - upstream PHP $phpver is below 5.6.39; even without IMAP, the bundled PHAR over-read issue still applies"
exit 1
fi
echo "VULNERABLE - upstream PHP $phpver is below 5.6.39"
exit 1
If you remember one thing.
119764 hit as equal. First separate public-facing or self-service PHP 5.6 apps that actually use IMAP features from plain legacy brochureware; for the former, review ext/imap, disable insecure IMAP shell transport, and inspect code paths immediately as a targeted hardening task, but under the noisgate mitigation SLA there is no mitigation SLA — go straight to the 365-day remediation window for this reassessed MEDIUM finding. Then put all remaining verified upstream 5.6.x < 5.6.39 systems on a retirement / upgrade track and complete the actual package remediation within 365 days under the noisgate remediation SLA, accelerating only those nodes where your own app review confirms attacker-controlled imap_open() usage.Sources
What defenders are saying.
Crowdsourced verification outputs.
Results submitted by users who ran the verification payload against their environment.