CVE-2019-8943

WordPress Core <= 5.0.3 - Path Traversal and Local File Inclusion

2019-02-19 00:00
Wilfried Becard

Strategic Overview

Status
Patched in 5.0.3
Affected Core
WordPress 5.0
Affected Version
<= 5.0.2
CVSS
6.5Medium
Weakness type
CWE-98 · Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
CVE
CVE-2019-8943
View all WordPress 5.0 vulnerabilities

At a glance

CVE-2019-8943 is a medium-severity Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') vulnerability in the WordPress 5.0 WordPress release line, affecting <= 5.0.2. It carries a CVSS score of 6.5 (reachable over the network; low attack complexity; high integrity impact). The issue is fixed in version 5.0.3; sites on affected versions should update now. Disclosed February 2019, reported by Wilfried Becard.

Vulnerability Overview

WordPress through 5.0.3 allows Path Traversal in wp_crop_image(). An attacker (who has privileges to crop an image) can write the output image to an arbitrary directory via a filename containing two image extensions and ../ sequences, such as a filename ending with the .jpg?/../../file.jpg substring.

Technical Analysis

The vector marks this flaw as remotely reachable over the network, with low attack complexity — no special timing or configuration is needed, and no interaction from a victim user. A successful exploit has high impact on integrity.

CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')

WordPress 5.0 <= 5.0.2 carries this weakness at wp_crop_image(), and reaching it takes a caller who can reach the endpoint. PHP file inclusion means a path used by include or require is built from request data, so the file that gets executed is under the caller's influence.

Including an attacker-influenced file executes its contents, which is why this class is routinely chained with an upload or log-poisoning step to reach code execution. For WordPress 5.0 the fix is 5.0.3: builds <= 5.0.2 are affected, anything from 5.0.3 onward is not.

Remediation

Update to version 5.0.3, or a newer patched version

How does WordSec protect against this?

The attempt arrives as an ordinary request to WordPress 5.0: WordSec's web application firewall inspects request payloads before WordPress loads them. Classes like this one can leave something behind, so the staged malware scanner is the second half: it looks for dropped files and modified code rather than for the request that created them. None of that substitutes for the fix: updating to 5.0.3 is the step that ends it.

  • Firewall
  • Scanner
  • Alerts

External References

Related records

Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C