Skip to content

Stop Cloudflare's WAF blocking publishes: no DROP TABLE in the README#9

Merged
Acro merged 1 commit into
masterfrom
fix-waf-blocked-readme
Jul 24, 2026
Merged

Stop Cloudflare's WAF blocking publishes: no DROP TABLE in the README#9
Acro merged 1 commit into
masterfrom
fix-waf-blocked-readme

Conversation

@Acro

@Acro Acro commented Jul 24, 2026

Copy link
Copy Markdown
Owner

This is why every 3.0.0 publish failed.

Each attempt died with E403 Forbidden - PUT https://registry.npmjs.org/simple-builder after all five gates passed — from CI and locally, over OIDC and with an owner's OTP, with and without --provenance. npm surfaced only its generic "forbidden by your security policy" text and no response body.

Proxying the publish through localhost revealed the body was never an npm error:

<title>Attention Required! | Cloudflare</title>
Sorry, you have been blocked

The registry sits behind Cloudflare, npm publish sends README.md as plaintext in the publish metadata, and the managed SQL-injection ruleset matches the literal string DROP TABLE. The block happens in front of the registry — which is exactly why every credential type failed identically, and why await-parallel-limit (same account, same workflow, no SQL in its README) publishes without trouble.

Verification

The WAF sits ahead of auth, so this can be probed with unauthenticated PUTs — no token, nothing published:

readme payload Result
benign prose passes
pg(sql\SELECT * FROM users`)` passes
1; DROP TABLE users blocked
1; DROP TABLE users; # blocked
'; DROP TABLE users; -- blocked
1; DELETE FROM users; -- passes
1; TRUNCATE users; -- passes
UNION SELECT password FROM users passes
our real README.md blocked
our real llms.txt passes

Only DROP TABLE matters — the -- comment and the quoting are irrelevant.

Change

Swaps the three README payloads to DELETE FROM users; --, which demonstrates a destructive injection just as well. The tarball is gzipped and base64'd before it enters the request body, so llms.txt, src/ and dist/ are invisible to the WAF and keep their examples unchanged.

AGENTS.md records the constraint and the probe recipe, since none of this is discoverable from the repo and it will silently break releases again otherwise.

npm test passes: 64/64 unit tests, 26 documented examples verified.

🤖 Generated with Claude Code

Every 3.0.0 publish attempt died with `E403 Forbidden - PUT` after all five
gates passed — from CI and locally, over OIDC and with an owner's OTP, with
and without --provenance. npm reported only its generic "forbidden by your
security policy" text and no response body.

Proxying the publish through localhost showed why: the body was not an npm
JSON error at all but a Cloudflare HTML page, "Attention Required! | Sorry,
you have been blocked". The registry sits behind Cloudflare, `npm publish`
sends README.md as *plaintext* metadata, and the managed SQL-injection
ruleset matches the literal string `DROP TABLE`. The block happens in front
of the registry, which is why every credential failed identically and why
`await-parallel-limit` — same account, same workflow, no SQL in its README —
publishes fine.

Confirmed by probing the registry with unauthenticated PUTs (the WAF is in
front of auth, so it needs no token and publishes nothing): `DROP TABLE` is
blocked in every spelling tried, while `DELETE FROM`, `TRUNCATE` and even
`UNION SELECT` pass. Only that one phrase matters.

Swap the three README payloads to `DELETE FROM users; --`, which demonstrates
a destructive injection just as well. The tarball is gzipped and base64'd
before it goes into the request, so llms.txt, src/ and dist/ are unaffected
and keep their examples.

Record the whole thing in AGENTS.md with the probe recipe — this is invisible
from the repo and will silently break releases again otherwise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Acro
Acro merged commit 07da3f1 into master Jul 24, 2026
8 checks passed
@Acro
Acro deleted the fix-waf-blocked-readme branch July 24, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant