feat(web-security): include wrangler (Cloudflare Workers) in web-security tooling (CAP-1190) - #131
Merged
GangGreenTemperTatum merged 1 commit intoAug 27, 2026
Conversation
… (CAP-1190)
Adds the wrangler CLI (cloudflare/workers-sdk) to the web-security
capability and a Wrangler toolset that deploys Cloudflare Workers as
custom OAST endpoints — attacker-controlled, programmable callback
infrastructure that complements the passive OOB providers
(webhook.site / interactsh can only receive; a worker can also serve):
- wrangler_status — verify binary + non-interactive token auth
- wrangler_deploy — callback (request logger), blind-xss (JS probe +
/collect exfil), redirect (302 for SSRF chains),
and custom worker templates
- wrangler_tail — bounded log-stream capture; parses console.log
JSON events AND raw request events
- wrangler_list — account workers via the Cloudflare REST API
(wrangler has no list command), pagination-aware
- wrangler_delete — teardown with --force
Auth is runtime-only from the environment per wrangler's own contract:
CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID, with the CF_API_TOKEN /
CF_ACCOUNT_ID aliases (flareprox's env contract accepted as fallbacks
so one credential pair drives both tools. No wrangler login state is
created or persisted. Telemetry is suppressed in subprocesses so
disconnected deployments make no extra outbound requests.
Runtime install:
- scripts/install_tools.sh: guarded (have wrangler) and pinned
(wrangler@4.127.0) npm install, non-fatal WARN fallback — offline
guard tests extended to enforce guard+pin discipline on all npm
installs (agent-browser pinned to its current latest as a result)
- docker/Dockerfile.runtime: matching pinned layer
- capability.yaml: wrangler preflight check, description, keywords,
version 1.14.0 -> 1.15.0
Docs: new skills/wrangler-oast/SKILL.md (activation gate on env vars,
workflow, template details, mandatory cleanup); agent tool guidance
updated to route credential-less detection to get_callback_url and
only use wrangler for payload serving / custom responses / redirects;
blind-ssrf-chains cross-references the new tools behind its existing
approval gate.
Ground-truth verification against wrangler 4.x: whoami --json exits
non-zero when unauthenticated (plain whoami exits 0 with a notice);
delete takes the worker name positionally (--name is not an option);
no top-level list command exists; CLOUDFLARE_ACCOUNT_ID is honored
without a wrangler.toml account_id; --var=KEY:VALUE works with
--no-bundle. All tool/test surfaces verified against the real binary
via the real SDK loader (tool registration, schema generation, and a
full handle_tool_call round-trip).
Tests: 67 new unit tests in tests/test_wrangler.py; offline-guard
tests extended for the wrangler install; full capability suite passes
(700 tests).
EOF
)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
注册 for free
to join this conversation on GitHub.
Already have an account?
登录 to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the wrangler CLI (Cloudflare Workers) to the web-security capability, closing CAP-1190. Wrangler deploys Cloudflare Workers as custom OAST endpoints — attacker-controlled, programmable callback infrastructure that complements the existing OOB tooling (interactsh, webhook.site): those can only receive callbacks, a worker can also serve — blind XSS payload hosting, custom response bodies, and 302 redirectors for SSRF chain escalation.
新建 toolset —
tools/wrangler.py(auto-discovered, 5 tools)wrangler_statuswhoami --json)wrangler_deploycallback(request logger),blind-xss(JS probe +/collectexfil),redirect(302 for SSRF chains),customwrangler_tailwrangler_listlistcommand), pagination-awarewrangler_deletedelete <name> --force)Auth carries from the environment per wrangler's own contract:
CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID, with theCF_API_TOKEN/CF_ACCOUNT_IDaliases (flareprox's env contract in this capability) accepted as fallbacks so one credential pair drives both tools. Nothing is persisted — nowrangler loginstate. Telemetry (WRANGLER_SEND_METRICS=false) is suppressed in subprocesses so disconnected deployments make no extra outbound calls.Runtime install
scripts/install_tools.sh— guarded (have wrangler) and pinned (wrangler@4.127.0) npm install with the standard non-fatalWARNfallback; the offline-guard test suite now enforces guard+pin discipline on all npm installs. Drive-by: as a resultagent-browseris pinned to its current latest (0.35.1, behavior-preserving today) — flagging in case maintainers want that split out.docker/Dockerfile.runtime— matching pinned layer, header comment updatedcapability.yaml—wranglerpreflight check, description/keywords, version1.14.0→1.15.0Docs
skills/wrangler-oast/SKILL.md— activation gate on env vars (fall back toget_callback_url, which needs no credentials, when unset), workflow, template details, mandatory cleanupagents/web-security.md— tool guidance routes credential-less detection toget_callback_url, wrangler only for payload serving / custom responses / redirectsskills/blind-ssrf-chains/SKILL.md— cross-references the new tools behind the skill's existing approval gateGround truth (verified against wrangler 4.125/4.127, not guessed)
whoami --jsonexits non-zero when unauthenticated (plainwhoamiexits 0 with a notice — the reliable check is--json)deletetakes the worker name positionally (--nameis not an option)wrangler listcommand → REST API for listingCLOUDFLARE_ACCOUNT_IDis honored from the env with noaccount_idinwrangler.toml(so the account id never lands in a temp file)--var=KEY:VALUEworks with--no-bundle; name validation regex is^[a-z0-9_][a-z0-9_-]*$(mirrored client-side, also blocks toml injection)Testing
tests/test_wrangler.py): tool discovery, auth resolution incl. CF-alias mapping, name validation (incl. injection attempts), deploy config generation,--varrouting, tail timeout-as-designed-stop, tail JSON/request/exception parsing, list pagination, teardown; extended offline-guard tests for the wrangler installload_capabilities_from_search_paths, all 5 tools registered (64 total), schema correct, fullhandle_tool_callround-trip against the real wrangler CLIwrangler.toml+ flags are valid), API rejection surfaces cleanly and ANSI-freewrangler@4.127.0verified installable/runnable;bash -n+shellcheckclean;just validate, pre-commit (ruff, gitleaks, yaml) all pass; full capability suite: 700 tests passingNotes for reviewers
wrangler_listuses the REST API rather than the CLI because nowrangler listexists — same API surface flareprox already uses in this capability