- Notifications
You must be signed in to change notification settings - Fork992
Fix trusted types violation in packages/auth/src/platform_browser/index.ts#9402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
changeset-botbot commentedDec 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
Uh oh!
There was an error while loading.Please reload this page.
This change addresses a Trusted Types violation inthe
loadJSfunction. The violation occurs because a URL constructed from a string is used to set thesrcattribute of a script element, which is a potential DOM XSS vulnerability.The patch resolves this issue by using
safevalues.safeUrlto create aSafeUrlobject from the URL string. This sanitized URL is then used with thesafevalues.dom.setSrcfunction to safely set thesrcattribute of the script element. This ensures that only sanitized, trusted URLs can be loaded, thus mitigating the risk of DOM XSS attacks.This change is purely for security and has no functional impact.
Test: Verified that all existing tests pass after the change.