-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing bug: Unsafe HTML constructed from library input #3312
Conversation
I'd recommend switching the text for that button to use ( But no idea what's going on with that dependency, Gatsby normally bundles deps, maybe it makes a networking request inside its codebase? ) |
Yeah, the code I am suggesting is: const versionButton = document.querySelectorAll("#versions > a").item(0)
versionButton.textContent = "v" + sandbox.ts.version + " "
const caret = document.createElement("spam")
caret.classList.add("caret")
versionButton.appendChild(caret) or similar |
packages/playground/package.json
Outdated
@@ -17,7 +17,8 @@ | |||
"dependencies": { | |||
"@typescript/playground-worker": "workspace:*", | |||
"@typescript/sandbox": "workspace:*", | |||
"esbuild": "^0.17.8" | |||
"esbuild": "^0.17.8", | |||
"striptags": "^3.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to package.json / pnpm-lock can now be reverted.
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3312.centralus.5.azurestaticapps.net |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work.
This PR fixes https://liquid.microsoft.com/codeql/issues/71221708-d80d-49f5-b177-1b536b3b3e22 where unsafe HTML was constructed from library input. Fix is according to the recommendation provided by https://liquid.microsoft.com/Web/Object/Read/ScanningToolWarnings/Requirements/CodeQL.SM03892#Zguide.