Skip to content
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

Merged
merged 288 commits into from
Jan 12, 2025
Merged

Use VUE3-extension #126

merged 288 commits into from
Jan 12, 2025

Conversation

Dreamlinerm
Copy link
Owner

No description provided.

@Dreamlinerm Dreamlinerm merged commit 8143ce8 into main Jan 12, 2025
1 check passed
headers: {
accept: "application/json",
Authorization:
"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI5OWQyMWUxMmYzNjU1MjM4NzdhNTAwODVhMmVjYThiZiIsInN1YiI6IjY1M2E3Mjg3MjgxMWExMDBlYTA4NjI5OCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.x_EaVXQkg1_plk0NVSBnoNUl4QlGytdeO613nXIsP3w",

Check failure

Code scanning / CodeQL

Hard-coded credentials Critical

The hard-coded value "Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI5OWQyMWUxMmYzNjU1MjM4NzdhNTAwODVhMmVjYThiZiIsInN1YiI6IjY1M2E3Mjg3MjgxMWExMDBlYTA4NjI5OCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.x_EaVXQkg1_plk0NVSBnoNUl4QlGytdeO613nXIsP3w" is used as
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
is reinterpreted as HTML without escaping meta-characters.

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.

  1. Install the he library.
  2. Replace the decodeHtmlEntities function with a function that uses the he library to decode HTML entities safely.
Suggested changeset 2
src/content-script/netflix.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/content-script/netflix.ts b/src/content-script/netflix.ts
--- a/src/content-script/netflix.ts
+++ b/src/content-script/netflix.ts
@@ -97,4 +97,5 @@
 // to parse html umlaut symbols like &auml; 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);
 }
EOF
@@ -97,4 +97,5 @@
// to parse html umlaut symbols like &auml; 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);
}
package.json
Outside changed files

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/package.json b/package.json
--- a/package.json
+++ b/package.json
@@ -36,3 +36,4 @@
 		"vue-router": "^4.5.0",
-		"webextension-polyfill": "^0.12.0"
+		"webextension-polyfill": "^0.12.0",
+		"he": "^1.2.0"
 	},
EOF
@@ -36,3 +36,4 @@
"vue-router": "^4.5.0",
"webextension-polyfill": "^0.12.0"
"webextension-polyfill": "^0.12.0",
"he": "^1.2.0"
},
This fix introduces these dependencies
Package Version Security advisories
he (npm) 1.2.0 None
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant