docs: zeg bij connect-src wat CORS niet tegenhoudt #546
No reviewers
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
security
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck!546
Loading…
Reference in a new issue
No description provided.
Delete branch "docs/csp-connect-src-redenering"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Third item from #516: the
connect-src 'self' https:directive, which the issue flags as permitting a no-cors POST to any host.No directive changed. What changed is the reasoning next to it, which was subtly wrong in a way that mattered.
What was wrong
The comment justified
connect-src https:like this: the browser's CORS policy gates every cross-origin read, so a non-cooperating host cannot be read through it. That is true, and it is a good argument — about reads.CORS does not stop a
no-corsPOST. The request is sent; only the response is opaque. So the directive leaves a one-way write channel to any https host. That is an exfiltration path, and CORS was never the control for it — the comment attributed the protection to the wrong mechanism.Why the directive stays
Closing it means removing URL-import on web, a feature the user asks for and initiates. And reaching the channel requires script execution in this origin, which is what
script-src 'self'without'unsafe-inline'/'unsafe-eval'actually prevents.So: the control here is
script-src, notconnect-src.connect-srcnarrows the blast radius ifscript-srcever fails, and theno-referrermeta below keeps the deck's own URL out of the request. All of that is now written down, along with when to revisit — if URL-import ever moves behind a fixed set of hosts,connect-srccan name them instead of allowinghttps:wholesale.Why this is worth a commit on its own
A security comment that credits the wrong mechanism is worse than no comment: the next reader sees a justification, believes the case is covered, and moves on. That is how a real gap survives three reviews.
Verification
make checkgreen.make check-webgreen — the CSP itself is byte-identical, andtool/check_web_hardening.dartstill pinsconnect-srcto exactly'self' https:.Part of #516; six items left there.