CVE-2024-31211: Remote Code Execution in `WP_HTML_Token`

Published Apr 4, 2024
·
Updated

WordPress is an open publishing platform for the Web. Unserialization of instances of the WPHTMLToken class allows for code execution via its destruct() magic method. This issue was fixed in WordPress 6.4.2 on December 6th, 2023. Versions prior to 6.4.0 are not affected.

Affected Software

5 affected componentsFixes available
WordPress WordPress>6.4.0<=6.4.2
WordPress WordPress>=6.4.0<6.4.2
debian/wordpress<6.4.2+dfsg1-1
6.4.2+dfsg1-1
debian/wordpress<6.4.2+dfsg1-1
6.4.2+dfsg1-1
debian/wordpress
6.1.9+dfsg1-0+deb12u16.8.7+dfsg1-0+deb13u16.8.12+dfsg1-0+deb13u17.1.4+dfsg1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/wordpress to a version that resolves this vulnerability.

    Fixed in 6.4.2+dfsg1-1
  2. Upgrade

    Upgrade debian/wordpress to a version that resolves this vulnerability.

    Fixed in 6.1.9+dfsg1-0+deb12u1Fixed in 6.8.7+dfsg1-0+deb13u1Fixed in 6.8.12+dfsg1-0+deb13u1Fixed in 7.1.4+dfsg1-1
  3. Upgrade

    Upgrade WordPress to a version that resolves this vulnerability.

    Fixed in 6.4.2

Event History

Apr 4, 2024
CVE Published
via MITRE·11:00 PM
Data Sourced
via MITRE·11:00 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·11:15 PM
DescriptionSeverityAffected Software
Aug 3, 2024
Exploit Published
via GitHub·07:26 PM

Frequently Asked Questions

1

What is the severity of CVE-2024-31211?

CVE-2024-31211 has a high severity due to its potential for code execution through the `__destruct()` magic method in the `WP_HTML_Token` class.

2

How do I fix CVE-2024-31211?

To fix CVE-2024-31211, update your WordPress installation to version 6.4.2 or later.

3

Which versions of WordPress are affected by CVE-2024-31211?

CVE-2024-31211 affects WordPress versions between 6.4.0 and 6.4.1.

4

What does the vulnerability CVE-2024-31211 exploit?

CVE-2024-31211 exploits the unserialization process in the `WP_HTML_Token` class, allowing for arbitrary code execution.

5

When was CVE-2024-31211 patched?

CVE-2024-31211 was patched in WordPress version 6.4.2, released on December 6th, 2023.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203