docs(security): stop presenting CORS as an XSS defence - #3086
Open
santhiprakash wants to merge 1 commit into
Open
santhiprakash wants to merge 1 commit into
santhiprakash wants to merge 1 commit into
Conversation
jan--f
requested changes
Sep 23, 2026
jan--f
left a comment
Contributor
There was a problem hiding this comment.
Please keep PRs/commits focused to what the claimed change is.
santhiprakash
force-pushed
the
docs/security-cors-not-xss
branch
from
September 23, 2026 15:36
793ab80 to
1ebfa1a
Compare
Problem: docs/operating/security.md told operators to set CORS headers to prevent XSS. CORS relaxes the Same-Origin Policy and is not an XSS defence (prometheus#2449). Fix: reword the CORS sentence so it no longer presents CORS as an XSS control. Verification: confirmed the stale wording on the target page. Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
santhiprakash
force-pushed
the
docs/security-cors-not-xss
branch
from
September 23, 2026 15:37
1ebfa1a to
9422f69
Compare
Contributor
Author
|
@jan--f Done — I reworked the branch to keep only the CORS wording change and rebased onto current The previous Java TLS and
--- a/docs/operating/security.md
+++ b/docs/operating/security.md
@@ -211,8 +211,10 @@ may wish to block such paths to prevent CSRF.
For non-mutating endpoints, you may wish to set [CORS
headers](https://fetch.spec.whatwg.org/#http-cors-protocol) such as
-`Access-Control-Allow-Origin` in your reverse proxy to prevent
-[XSS](https://en.wikipedia.org/wiki/Cross-site_scripting).
+`Access-Control-Allow-Origin` in your reverse proxy if a browser
+application on another origin should be allowed to read those
+responses. CORS relaxes the Same-Origin Policy; it is not a defence
+against [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting).CI is green and the DCO check passes. The Java TLS and |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
Problem
docs/operating/security.mdcurrently tells operators to set CORS headers suchas
Access-Control-Allow-Originto prevent XSS. That is incorrect: CORSrelaxes the Same-Origin Policy so a browser on another origin can read
responses; it is not an XSS defence.
Reported in #2449. Confirmed still present on current
main.Triage / Root cause
The CORS sentence is in the API Security section and presents CORS as an
XSS control. Maintainers already agreed in #2449 that CORS should not be
mentioned as a defence against XSS.
Fix
Reword the CORS sentence: set CORS if a browser app on another origin should be
allowed to read non-mutating responses; CORS is not an XSS defence.
The Java TLS and
crypto/tlslink changes that were previously in this branchhave been reverted so this PR stays focused on the CORS wording. They can be
proposed in separate PRs once a repo slot frees.
Issue Number
Fixes #2449
Verification
docs/operating/security.mdonupstream/main— the "to prevent XSS"wording was still present.
Notes / Risks
need cross-origin browser access still have the guidance.