-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add bitcoin taproot #734
base: main
Are you sure you want to change the base?
Add bitcoin taproot #734
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
function uiConsole(...args: any): void { | ||
const el = document.querySelector("#console>p"); | ||
if (el) { | ||
el.innerHTML = JSON.stringify(args || {}, null, 2); |
Check warning
Code scanning / CodeQL
Exception text reinterpreted as HTML Medium
Exception text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 10 days ago
To fix the problem, we need to ensure that any user-controlled input is properly escaped before being written to the HTML. This can be achieved by using a library like DOMPurify
to sanitize the input or by manually escaping HTML meta-characters.
The best way to fix the problem without changing existing functionality is to use DOMPurify
to sanitize the input before setting it to the innerHTML property. This approach ensures that any potentially harmful content is removed, preventing XSS attacks.
-
Copy modified line R22 -
Copy modified line R302
@@ -21,2 +21,3 @@ | ||
import { Loading, BlurredLoading } from "./Loading"; | ||
import DOMPurify from 'dompurify'; | ||
|
||
@@ -300,3 +301,3 @@ | ||
if (el) { | ||
el.innerHTML = JSON.stringify(args || {}, null, 2); | ||
el.innerHTML = DOMPurify.sanitize(JSON.stringify(args || {}, null, 2)); | ||
} |
-
Copy modified lines R30-R31
@@ -29,3 +29,4 @@ | ||
"vite": "^5.4.8", | ||
"web3": "^4.13.0" | ||
"web3": "^4.13.0", | ||
"dompurify": "^3.2.4" | ||
}, |
Package | Version | Security advisories |
dompurify (npm) | 3.2.4 | None |
Motivation and Context
Jira Link: https://toruslabs.atlassian.net/jira/software/projects/DEVREL/boards/15?selectedIssue=DEVREL-1142
Description
How has this been tested?
Screenshots (if appropriate):
Types of changes
Checklist: