Why “headless” doesn’t mean “safe”#
A headless setup splits one WordPress site into two systems:
- The front end (Next.js on Vercel, say) renders pages for visitors. It runs on Node.js, not PHP.
- The origin (WordPress) stores the content and serves it over the REST API or GraphQL. It runs PHP, and it’s still a web server on the internet.
The front end fetches content from the origin when it builds or revalidates pages. But editors still log in to the WordPress admin, previews load from the origin, and media files are often served from the origin’s hostname. So the PHP server stays reachable, and PHP2Shell is about PHP.
There’s a second reason not to rely on hiding routes. CERT-EU notes a demonstrated exploit in which a single unauthenticated request can trigger the attack before application code runs. My reading is that locking down individual WordPress routes, such as the login page, is not a substitute for patching PHP. That’s my inference from their wording, not a claim they make.
Cloudflare says the same thing about code updates, as reported by PPC Land: updating website code or plugins alone does not fix these vulnerabilities, and hosting providers must apply PHP updates where they manage PHP.
What the platforms say#
| Source | What it says | Why it matters for headless |
|---|---|---|
| Vercel bulletin | WordPress, Drupal, Laravel and Magento are affected when they run on a vulnerable PHP runtime. Patch external PHP backends and restrict direct access so traffic goes through Vercel. Free, automatic firewall rules cover PHP functions on Vercel and requests proxied to external PHP backends, but not requests that bypass Vercel. Firewall rules do not replace patching. | This is your exact setup: an external PHP backend behind Vercel. The bulletin doesn’t say whether Vercel’s Node.js and Next.js functions are affected, so I don’t claim they’re safe either way. |
| AWS bulletin 2026-143 | AWS says its services aren’t impacted, but customers running affected PHP in them could be. Lambda has no managed PHP runtime, so custom runtimes and container images must be updated and redeployed. Elastic Beanstalk has updated platforms, applied in the next maintenance window if you use managed updates and manually otherwise. Lightsail can’t update running instances in place: create new instances from the updated blueprints and migrate. | If your WordPress origin lives on Lightsail, Beanstalk or an EC2 box with Amazon Linux, the fix may be a rebuild, not a click. |
| Cloudflare (via PPC Land) | Firewall rules have blocked exploit attempts since 3:02 am UTC on 21 October, on every plan with the firewall including Free. Paid plans should confirm the rules are in block mode. They are defence in depth, not a substitute for patching. PPC Land notes that the protection doesn’t cover origins reachable without passing through Cloudflare. | The same lesson as Vercel’s: the edge only protects traffic that goes through it. |
| CERT-EU advisory 2026-018 | Patch immediately. If that isn’t feasible, consider isolating internet-facing systems from public networks until a fix is applied and verified. Mitigations reduce exposure but don’t make a system safe. | For a headless site, isolating the origin can be practical, because only your front end needs to reach it. |
Can people reach your origin directly?#
This is the question the Vercel and Cloudflare statements both point at. If the answer is yes, then whatever protection sits in front of your front end is irrelevant to attacks aimed straight at the origin. Two quick checks, from a machine that isn’t on your office network or VPN:
# 1. Does the origin answer on its own hostname?
curl -sI https://cms.example.com/wp-json/ | head -5
# 2. Does your public site leak the origin's hostname (media, links, scripts)?
curl -s https://www.example.com/ | grep -oE 'https://[^"]*wp-content[^"]*' | headIf the first command returns a response, the origin is reachable. If the second prints URLs, you’re also advertising where the origin is. Both are common in headless builds, because WordPress writes its own hostname into media URLs. That’s not a bug, but it does mean the origin isn’t hidden.
What to do now#
- Find the PHP version and how it runs on the origin. On WordPress, Tools → Site Health → Info → Server shows it, and
wp --infodoes too if you have WP-CLI. Managed host? Check its status page or ask support. AWS Lightsail? Per AWS, build a new instance from an updated blueprint and migrate. Docker? Rebuild from an updated PHP base image. - Patch PHP to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or to a vendor package that includes both fixes. Backported fixes keep the old version number, so check your distribution’s security tracker for the CVE IDs. Restart PHP-FPM or Apache afterwards.
- Close direct access to the origin. Allow only your front end, your CDN or WAF, and your own admin IPs. Options include an IP allow-list at the web server or firewall, authenticated origin pulls through your CDN, or a private network between the front end and the origin. Put
/wp-adminbehind SSO, a VPN or an allow-list where you can. - Stop advertising the origin. Serve media through your own domain or CDN, so public pages don’t print the origin’s hostname.
- Check that your edge rules are on. Vercel’s are automatic and free. On Cloudflare’s paid plans, confirm the managed rules are in block mode.
If you can’t patch today#
Use the interim settings from the PHP advisories (they’re in the first post, and CERT-EU lists the same ones). They reduce exposure but don’t fix either bug. On top of those, headless gives you one extra lever, and this part is my own adaptation, not from an advisory:
- Block multipart requests where you don’t need them. The advisory says that if an application doesn’t use multipart form data, those requests can be blocked at the frontend. Your Next.js app talks to WordPress with JSON over REST or GraphQL. Editors uploading media do use multipart, so allow it only on the admin and upload paths, from allowed IPs, and block it on the public API hostname.
- Isolate the origin. Per CERT-EU, if patching is not feasible, consider cutting internet-facing systems off from public networks until a fix is applied. With a static or revalidated front end, the origin often only needs to be reachable from your build and your editors.
- Cap request sizes at the edge, not just in PHP, as the advisories recommend.
One more item. CERT-EU adds CVE-2026-115560 to its advisory on 23 October: a PHP remote code execution flaw that PHP says affects only web applications configured in an unusual way, with a full advisory to follow with the next release. CERT-EU says turning off session.upload_progress also covers it until then.
If the origin might already have been hit#
Per the PHP advisories and AWS, the code runs as the web worker account and can read data that account can read. On a WordPress server, that account can read wp-config.php. So if you can’t rule out a compromise, treat these as exposed and rotate them from a clean machine, not from the server itself:
- The database password and the WordPress secret keys and salts.
- Application passwords and any JWT or API secrets used by GraphQL or REST authentication.
- Preview, revalidation and deploy-hook secrets that connect WordPress to your front end, and any third-party API keys stored in WordPress.
- SSH, SFTP and hosting-panel credentials for the origin.
Then look for new admin users, unfamiliar plugins or files, and changed content. The advisory warns that clean logs don’t prove safety. For anything that matters, bring in an incident-response team.
What changes on the front end#
This is my own analysis, not from the advisories.
- Treat CMS content as untrusted input. If someone controls your origin, they control what your front end renders. Sanitise HTML from WordPress before you pass it to
dangerouslySetInnerHTML, and don’t let content fields choose scripts, URLs or components without checking them. - Remember caching multiplies mistakes. With static generation or ISR, one bad response from a compromised origin can be cached and served to every visitor until the next revalidation.
- Give your build only what it needs. Use a read-only API user for build-time fetching, not an admin account.
Takeaways#
- The runtime under your CMS is part of your stack, even if you never write a line of PHP.
- An edge firewall protects the traffic that passes through it. Know what can still reach the origin.
- Split architectures need a split checklist: patch the origin, and harden what the front end trusts from it.
Sources#
- Vercel: PHP security advisory: php2shell
- AWS: Security Bulletin 2026-143-AWS
- CERT-EU: Security Advisory 2026-018, Critical Vulnerabilities in PHP
- PPC Land (reporting Cloudflare’s announcement): Cloudflare blocks php2shell exploits 9 hours before PHP flaws went public
- PHP advisories: CVE-2026-109618 and CVE-2026-109619
- My earlier post: PHP2Shell: two critical PHP flaws, explained
Keep reading
7 min read
Next.js November 2026 security release: seven fixes in 16.4.5 and 15.5.29, and how to check your app
Next.js 16.4.5 and 15.5.29 fix seven Moderate advisories: use cache leaks, an Edge cookie exposure and an SVG bypass. Which ones apply to you, and what to run.
6 min read
@sentry/nextjs tunnelRoute bypass (CVE-2026-114139): can your Next.js middleware be skipped?
CVE-2026-114139 (CVSS 9.1) can let requests skip Next.js middleware when @sentry/nextjs tunnelRoute is set on a webpack build. Who is affected, and the fix.