CVE-2020-4047 Authenticated XSS via media attachment page in WordPress

Medium 6.8 Published Updated

Authenticated users with upload permissions can inject JavaScript into media attachment pages, leading to script execution in the context of higher-privileged users.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2020-4047?

CVE-2020-4047 is a medium-severity cross-site scripting vulnerability in Debian Debian Linux, published on 12 Jun 2020. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

In affected versions of WordPress, authenticated users with upload permissions (like authors) are able to inject JavaScript into some media file attachment pages in a certain way. This can lead to script execution in the context of a higher privileged user when the file is viewed by them. This has been patched in version 5.4.2, along with all the previously affected versions via a minor release (5.3.4, 5.2.7, 5.1.6, 5.0.10, 4.9.15, 4.8.14, 4.7.18, 4.6.19, 4.5.22, 4.4.23, 4.3.24, 4.2.28, 4.1.31, 4.0.31, 3.9.32, 3.8.34, 3.7.34).

Weakness: CWE-80

Which versions are affected by CVE-2020-4047?

2 open source packages ship an affected version, including wordpress and wordpress-multisite. It affects 3 products.

PackageAffectedFixed in
wordpress BitnamiFrom 3.7.03.7.34, 3.8.34, 3.9.32, 4.0.31, 4.1.31, 4.2.28, 4.3.24, 4.4.23, 4.5.22, 4.6.19, 4.7.18, 4.8.14, 4.9.15, 5.0.10, 5.1.6, 5.2.7, 5.3.4, 5.4.2
wordpress-multisite BitnamiFrom 3.7.03.7.34, 3.8.34, 3.9.32, 4.0.31, 4.1.31, 4.2.28, 4.3.24, 4.4.23, 4.5.22, 4.6.19, 4.7.18, 4.8.14, 4.9.15, 5.0.10, 5.1.6, 5.2.7, 5.3.4, 5.4.2

Products include Debian Debian Linux, Fedoraproject Fedora, Wordpress Wordpress.

How do I fix CVE-2020-4047?

Upgrade wordpress to a fixed version for your release line: 3.7.34, 3.8.34, 3.9.32 or 4.0.31.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2020-4047 being exploited?

There is no known exploitation of CVE-2020-4047 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as BIT-wordpress-2020-4047, BIT-wordpress-multisite-2020-4047, DEBIAN-CVE-2020-4047, GHSA-8q2w-5m27-wm27, UBUNTU-CVE-2020-4047.

Is CVE-2020-4047 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free