-
Notifications
You must be signed in to change notification settings - Fork 31
Feat/remote sign v3 #705
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
base: main
Are you sure you want to change the base?
Feat/remote sign v3 #705
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 8 months ago
To fix the problem, we need to ensure that any untrusted data written to the HTML is properly sanitized or escaped to prevent XSS attacks. The best way to fix this issue is to use a library like DOMPurify
to sanitize the HTML content before writing it to the DOM. This will ensure that any potentially dangerous characters are neutralized.
- Install the
dompurify
library. - Import the
dompurify
library in the file. - Use
DOMPurify.sanitize
to sanitize the content before setting it toinnerHTML
.
-
Copy modified line R4 -
Copy modified line R447
@@ -3,2 +3,3 @@ | ||
import "./App.css"; | ||
import DOMPurify from 'dompurify'; | ||
import { tssLib as dklsLib } from "@toruslabs/tss-dkls-lib"; | ||
@@ -445,3 +446,3 @@ | ||
if (el) { | ||
el.innerHTML = JSON.stringify(args || {}, null, 2); | ||
el.innerHTML = DOMPurify.sanitize(JSON.stringify(args || {}, null, 2)); | ||
} |
-
Copy modified lines R33-R34
@@ -32,3 +32,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:
Description
How has this been tested?
Screenshots (if appropriate):
Types of changes
Checklist: