data-antispam loads Turnstile from security.docly.net
-
What you'll see
You protect a form with
data-antispam="on"and run the site with a strict CSP. Because the Turnstile article listschallenges.cloudflare.comas the host to allow, that is what you add. The widget never appears, the browser console reports a CSP violation, and every submission fails. -
What's actually happening
There are two Turnstile routes, and they load from different hosts:
- Your own keys (
data-validatewith#/Config, see Protect every form with Turnstile): the page loadshttps://challenges.cloudflare.com/turnstile/v0/api.js. - The platform's antispam (
data-antispam="on", no keys): the submit script loads the widget fromhttps://security.docly.net, which also serves the iframe.
Measured 2026-11-28 on two sites with an enforced policy without
unsafe-inline: withsecurity.docly.netallowed inscript-srcandframe-srcthe console was clean and the A+ headers were kept. A submission without a token was refused with 403 «Antispam verification is required for this form.», and an invalid token with 403 «invalid-input-response». - Your own keys (
-
What to do
For
data-antispam="on", allow exactly this host. One named host does not weaken the A+ rating:"Content-Security-Policy": "default-src 'self'; script-src 'self' https://security.docly.net; frame-src https://security.docly.net; style-src 'self'; img-src 'self' data:; form-action 'self'; base-uri 'self'; object-src 'none'"
Load the submit script from your own origin:
<script src="/vanilla.submitform.js"></script>. Docly serves it. Test only the rejection paths - the success path mails a real recipient.
Last reviewed 28 Nov 2026