Edge detection and blocking for CVE-2026-109618 / CVE-2026-109619 — the PHP
session.upload_progress use-after-free RCE pair — as a Cloudflare Worker.
Free-tier compatible. No KV, no paid features, ~6 KB.
Multipart POSTs are inspected at the Cloudflare edge; exploit-shaped requests
are blocked with a 403 and reported to your Discord within seconds.
All other traffic passes through untouched.
This is a detection/edge-mitigation layer, not a fix. Patch PHP, and/or set
session.upload_progress.enabled = Offin yourphp.ini/ FPM pool config. The Worker does not see traffic that bypasses Cloudflare and hits your origin directly.
| Signal | Severity | Action |
|---|---|---|
Body contains PHP_SESSION_UPLOAD_PROGRESS (the actual trigger field) |
CRITICAL | 403 + alert |
PHPSESSID sent as a multipart form field (exploit pattern) |
HIGH | alert |
≥ 20 identical t[] fields (heap-spray pattern from public PoCs) |
HIGH | alert |
Alerts are Discord embeds containing: matched signals, client IP, country, ASN, CF colo + Ray ID, target path, User-Agent, and a sanitized body excerpt. Identical alerts are deduplicated for 5 minutes (Cache API), so a spray does not flood your channel.
- A Cloudflare account with your domain active as a zone (Free plan works)
- Node.js + wrangler (
npm i -g wrangler) - A Discord webhook (channel settings → Integrations → Webhooks)
npm install -g wrangler
wrangler login
cd release-
Edit
wrangler.toml— replace the example route with your domain (patterns for whole domain, WordPress subdir, or subdomain are in the file). -
Set a random
TEST_TOKENinindex.js(or as a secret, see below). -
Set the secrets:
wrangler secret put DISCORD_WEBHOOK # paste your Discord webhook URL wrangler secret put TEST_TOKEN # optional; overrides the value in index.js
-
Deploy:
wrangler deploy
Dashboard-only alternative: Workers & Pages → Create Worker → paste index.js →
Settings → Variables and Secrets → add DISCORD_WEBHOOK (Secret) →
Triggers → Routes → add your pattern.
# 1. Alert pipeline — expect "test alert sent" + a green embed in Discord
curl -H "x-watcher-test: <your TEST_TOKEN>" https://your-domain/
# 2. Real trigger shape — expect HTTP 403 + a red CRITICAL embed
curl -X POST https://your-domain/ \
-F "PHP_SESSION_UPLOAD_PROGRESS=x" -F "f=@/etc/hostname"If (1) pings Discord but (2) returns 200, your route pattern doesn't cover the
requesting hostname (check example.com vs www.example.com).
Edit CONFIG at the top of index.js:
| Option | Default | Meaning |
|---|---|---|
BLOCK_ON_TRIGGER |
true |
Return 403 when the trigger field is present (set false for monitor-only) |
ALERT_ON_SUSPICION |
true |
Alert on heuristic-only matches (no block) |
MAX_BODY_SCAN |
262144 |
Max bytes of any body inspected (256 KB) |
ALERT_TTL |
300 |
Deduplication window per identical alert (seconds) |
TEST_TOKEN |
— | Token for the self-test endpoint; set a long random string |
- Free quota: Workers free tier allows 100,000 invocations/day, and every
request on a matching route counts (not just POSTs). On busy sites, scope the
route to PHP paths (e.g.
/blog/*) or upgrade to Workers Paid. - Edge only: traffic that reaches your origin directly (server IP, bypass of Cloudflare) is not inspected. Lock your origin down to Cloudflare IPs and keep the PHP-level mitigation in place.
- No false-positive expectation if your app does not use upload-progress
bars. If it does, set
BLOCK_ON_TRIGGER: falseand treat alerts as signal.
MIT — see LICENSE.