CVE-2026-87902: WordPress RCE Vulnerability via Page Template Resolution

wordpress Updated 29 Sep 2026

Summary

29/09/2026
Yes i
High
Not published

CVE-2026-87902: An unauthenticated attacker can make get_page_template() page-template resolution include a chosen readable local .php file outside the active theme directories. Affects wordpress across 25 version ranges.

< 4.7.37 >= 4.8.0, < 4.8.32 >= 4.9.0, < 4.9.33 >= 5.0.0, < 5.0.29 >= 5.1.0, < 5.1.26 >= 5.2.0, < 5.2.28 >= 5.3.0, < 5.3.25 >= 5.4.0, < 5.4.23 >= 5.5.0, < 5.5.22 >= 5.6.0, < 5.6.21 >= 5.7.0, < 5.7.19 >= 5.8.0, < 5.8.17 >= 5.9.0, < 5.9.18 >= 6.0.0, < 6.0.16 >= 6.1.0, < 6.1.14 >= 6.2.0, < 6.2.13 >= 6.3.0, < 6.3.12 >= 6.4.0, < 6.4.12 >= 6.5.0, < 6.5.12 >= 6.6.0, < 6.6.9 >= 6.7.0, < 6.7.9 >= 6.8.0, < 6.8.10 >= 6.9.0, < 6.9.9 >= 7.0.0, < 7.0.6 >= 7.1.0, < 7.1.2

Fixed in 25 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2026-87902 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

WordPress is a widely-used open-source content management system (CMS) that allows users to create and manage websites easily. It features a plugin architecture and a template system, enabling users to customize their sites extensively. However, certain vulnerabilities can expose WordPress installations to security risks, such as remote code execution (RCE), which can compromise the integrity of the site and its data.

Vulnerability Detail

The vulnerability identified as CVE-2026-87902 allows an unauthenticated attacker to exploit the get_page_template() function, which is responsible for resolving page templates. If specific pre-conditions related to the server and active theme are met, this vulnerability can lead to the inclusion of a chosen readable local .php file outside the active theme directories. This could result in remote code execution, allowing attackers to execute arbitrary code on the server, potentially leading to data breaches or site defacement.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 4.7.37 4.7.37
  • >= 4.8.0, < 4.8.32 4.8.32
  • >= 4.9.0, < 4.9.33 4.9.33
  • >= 5.0.0, < 5.0.29 5.0.29
  • >= 5.1.0, < 5.1.26 5.1.26
  • >= 5.2.0, < 5.2.28 5.2.28
Show all 25 release lines
  • >= 5.3.0, < 5.3.25 5.3.25
  • >= 5.4.0, < 5.4.23 5.4.23
  • >= 5.5.0, < 5.5.22 5.5.22
  • >= 5.6.0, < 5.6.21 5.6.21
  • >= 5.7.0, < 5.7.19 5.7.19
  • >= 5.8.0, < 5.8.17 5.8.17
  • >= 5.9.0, < 5.9.18 5.9.18
  • >= 6.0.0, < 6.0.16 6.0.16
  • >= 6.1.0, < 6.1.14 6.1.14
  • >= 6.2.0, < 6.2.13 6.2.13
  • >= 6.3.0, < 6.3.12 6.3.12
  • >= 6.4.0, < 6.4.12 6.4.12
  • >= 6.5.0, < 6.5.12 6.5.12
  • >= 6.6.0, < 6.6.9 6.6.9
  • >= 6.7.0, < 6.7.9 6.7.9
  • >= 6.8.0, < 6.8.10 6.8.10
  • >= 6.9.0, < 6.9.9 6.9.9
  • >= 7.0.0, < 7.0.6 7.0.6
  • >= 7.1.0, < 7.1.2 7.1.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, users can restrict access to sensitive files and directories on their server, ensuring that only authorized users can access them. Additionally, disabling the get_page_template() function or implementing strict input validation can help mitigate the risk until a proper update is applied.

Conclusion

CVE-2026-87902 is a significant vulnerability in WordPress that can lead to remote code execution if not addressed. Users are urged to update their installations to the latest patched versions and consider implementing workarounds to mitigate risks until updates can be applied. Utilizing tools like Vulert can help monitor and alert for vulnerabilities in real-time.

See every vulnerability recorded for wordpress →

Share this vulnerability

FAQ

CVE-2026-87902 is a vulnerability in WordPress that allows unauthenticated attackers to exploit the get_page_template() function, potentially leading to remote code execution.

If your WordPress version is below the patched versions listed (4.7.37, 4.8.32, etc.), your site may be vulnerable. You can also use tools like Vulert to check for vulnerabilities.

If an immediate update is not possible, implement the suggested workarounds to restrict access to sensitive files and validate inputs to reduce the risk of exploitation.

You can update your WordPress installation through the admin dashboard by navigating to the updates section or by downloading the latest version from the official WordPress website.

Vulert monitors open-source vulnerabilities in your software using a manifest file like package-lock.json. You can check if your application is affected by vulnerabilities without any signup using the Vulert playground.

Related vulnerabilities

Recent vulnerabilities recorded for wordpress.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 4.7.37 4.7.37
  • >= 4.8.0, < 4.8.32 4.8.32
  • >= 4.9.0, < 4.9.33 4.9.33
  • >= 5.0.0, < 5.0.29 5.0.29
  • >= 5.1.0, < 5.1.26 5.1.26
  • >= 5.2.0, < 5.2.28 5.2.28
Show all 25 release lines
  • >= 5.3.0, < 5.3.25 5.3.25
  • >= 5.4.0, < 5.4.23 5.4.23
  • >= 5.5.0, < 5.5.22 5.5.22
  • >= 5.6.0, < 5.6.21 5.6.21
  • >= 5.7.0, < 5.7.19 5.7.19
  • >= 5.8.0, < 5.8.17 5.8.17
  • >= 5.9.0, < 5.9.18 5.9.18
  • >= 6.0.0, < 6.0.16 6.0.16
  • >= 6.1.0, < 6.1.14 6.1.14
  • >= 6.2.0, < 6.2.13 6.2.13
  • >= 6.3.0, < 6.3.12 6.3.12
  • >= 6.4.0, < 6.4.12 6.4.12
  • >= 6.5.0, < 6.5.12 6.5.12
  • >= 6.6.0, < 6.6.9 6.6.9
  • >= 6.7.0, < 6.7.9 6.7.9
  • >= 6.8.0, < 6.8.10 6.8.10
  • >= 6.9.0, < 6.9.9 6.9.9
  • >= 7.0.0, < 7.0.6 7.0.6
  • >= 7.1.0, < 7.1.2 7.1.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback