CVE-2026-10821: Yoast SEO Premium arbitrary .htaccess directive injection to RCE

CVE-2026-10821 · Severity: medium · CVSS 6.6 · Published 2026-09-02

Yoast SEO Premium is a WordPress plugin that manages redirects and search engine optimization for websites. An authenticated user with basic post-editing privileges can inject malicious Apache configuration directives into the site's .htaccess file by including special characters in a redirect URL. On servers configured to use file-based redirects (a non-default setting), this can escalate to remote code execution, allowing an attacker to run arbitrary PHP code and fully compromise the website.

Vendors: Yoast.

Quick answers

Is CVE-2026-10821 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-10821 being exploited in the wild.
How severe is CVE-2026-10821?
Medium severity, with a CVSS score of 6.6, published 2 September 2026.
Which products and versions are affected?
Yoast SEO Premium before 27.6.1.
Is there a fix for CVE-2026-10821?
A patch was published on 2026-05-26: Version 27.6.1 released Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-10821 attacked?
It is attacked over the network.
Am I affected by CVE-2026-10821?
Check whether you run Yoast SEO Premium at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

This vulnerability stems from insufficient sanitization of control characters (newlines, carriage returns) in redirect origin fields before writing them to the Apache .htaccess configuration file. The vulnerability requires three preconditions: (1) the target site must use Apache with file-based redirects enabled (non-default configuration), (2) an authenticated user with edit_posts capability (Author role or above), and (3) a writable root .htaccess file. The regex-redirect endpoint bypasses origin validation, allowing CR/LF injection. An attacker can chain this with a polyglot PHP/PNG file upload to inject an auto_prepend_file directive, achieving pre-execution of arbitrary PHP code on every request. Yoast patched this in version 27.6.1 by stripping control characters from redirect fields, removing the vulnerable endpoint, and adding in-plugin detection for anomalous .htaccess modifications.

Affected products

  • Yoast SEO Premium before 27.6.1

Timeline

  • 2026-06-04: disclosed
  • 2026-05-26: patched: Version 27.6.1 released
  • 2026-09-02: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.