cloudflare / cloudflare/cloudflare-docs

Document Permissions-Policy requirements for Turnstile widget iframe

Open
#30,530 3 comments 1 reaction 3 assignees Claimed by @punkeel View on GitHub
content:new documentation product:turnstile stale
Dominant language
MDX
Stars
5.2k
Forks
16.7k
Avg merge
2d 6h
Merged PRs (30d)
337

Description

### Proposed changes

https://developers.cloudflare.com/turnstile/reference/content-security-policy/

### Subject Matter

Permissions-Policy header

### Content Location

Either add to the existing "Content Security Policy Page" or create a new "Permissions Policy" page as a sibling.

### Additional information

Turnstile appears to request the following permissions (from the `allow` attribute on its challenge iframe):
- `autoplay`
- `fullscreen`
- `gamepad`
- `keyboard-map`
- `picture-in-picture`

If the site applies a strict `Permissions-Policy` header then this suggests that the policy needs to be relaxed with:
```
Permissions-Policy: autoplay=(self "https://challenges.cloudflare.com"), fullscreen=(self "https://challenges.cloudflare.com"), gamepad=(self "https://challenges.cloudflare.com"), keyboard-map=(self "https://challenges.cloudflare.com"), picture-in-picture=(self "https://challenges.cloudflare.com")
```

However, it is not clear which (if any) of these permissions are actually required for Turnstile to function, or how functionality degrades if they are not provided (beyond clients submitting `potential-permissions-policy-violation` reports). The requested permissions also appear to change over time (e.g. `gamepad` and `keyboard-map` appear to be relatively recent additions).

The documentation should clarify the Permissions Policy requirements for Turnstile, and should be updated as those requirements change.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.