P2 — Unauthenticated AI Agent Access via Cloudflare Turnstile C
The WebSocket AI agent service accepted any CAPTCHA token, including empty or missing ones, as valid, bypassing the Cloudflare Turnstile check. This allowed an unauthenticated attacker to retrieve the full internal system prompt, exposing tool definitions and business logic.
Published on medium.com
During the security assessment, a critical weakness was identified in a publicly accessible WebSocket-based AI Agent service that uses Cloudflare Turnstile CAPTCHA as an anti-automation and access-control mechanism.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the backend did not call Cloudflare's Siteverify API to validate the token, and it exposed a system_prompt event without proper authorization.
Impact
An unauthenticated attacker could bypass CAPTCHA protection and retrieve the internal system prompt, exposing tool definitions and business workflows, though no access to customer devices or data was demonstrated.
What the attacker needed
Network access to the WebSocket endpoint; no account or valid CAPTCHA token needed
The fix
The service should validate every CAPTCHA token via Cloudflare's Siteverify API and remove the public system_prompt retrieval event, enforcing proper authentication and authorization.
How it was found
- Connect to the WebSocket endpoint without authentication.
- Attempt to retrieve the system prompt and observe an authentication error.
- Send a captcha_verify event with an empty token and receive success.
- Send the system_prompt retrieval event again and receive the full prompt.
- Repeat with invalid, whitespace, and missing tokens to confirm the bypass.
- Test other production environments and observe the same behaviour.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A CAPTCHA is a test to prove you are human, but here the server never actually checked the answer. Anyone could pretend to pass it and then ask the AI service for its secret instructions, which should have been private.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.