-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Use VUE3-extension #126
Use VUE3-extension #126
Conversation
"*://*.primevideo.com/*", "*://*.amazon.com/*", "*://*.amazon.co.jp/*", "*://*.amazon.de/*", "*://*.amazon.co.uk/*", ]
headers: { | ||
accept: "application/json", | ||
Authorization: | ||
"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI5OWQyMWUxMmYzNjU1MjM4NzdhNTAwODVhMmVjYThiZiIsInN1YiI6IjY1M2E3Mjg3MjgxMWExMDBlYTA4NjI5OCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.x_EaVXQkg1_plk0NVSBnoNUl4QlGytdeO613nXIsP3w", |
Check failure
Code scanning / CodeQL
Hard-coded credentials Critical
authorization header
} | ||
// to parse html umlaut symbols like ä to ä | ||
function decodeHtmlEntities(str: string) { | ||
return new DOMParser().parseFromString("<!doctype html><body>" + str, "text/html").body.textContent |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 days ago
To fix the problem, we need to ensure that the input to decodeHtmlEntities
is properly sanitized before being parsed as HTML. This can be achieved by using a library that safely decodes HTML entities without interpreting the input as HTML. One such library is he
, which provides robust HTML entity encoding and decoding.
- Install the
he
library. - Replace the
decodeHtmlEntities
function with a function that uses thehe
library to decode HTML entities safely.
-
Copy modified line R98 -
Copy modified line R100
@@ -97,4 +97,5 @@ | ||
// to parse html umlaut symbols like ä to ä | ||
import he from 'he'; | ||
function decodeHtmlEntities(str: string) { | ||
return new DOMParser().parseFromString("<!doctype html><body>" + str, "text/html").body.textContent | ||
return he.decode(str); | ||
} |
-
Copy modified lines R37-R38
@@ -36,3 +36,4 @@ | ||
"vue-router": "^4.5.0", | ||
"webextension-polyfill": "^0.12.0" | ||
"webextension-polyfill": "^0.12.0", | ||
"he": "^1.2.0" | ||
}, |
Package | Version | Security advisories |
he (npm) | 1.2.0 | None |
No description provided.