-
Notifications
You must be signed in to change notification settings - Fork 133
Feat/general upgrade #222
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: master
Are you sure you want to change the base?
Feat/general upgrade #222
Conversation
8bfbb54 to
1ada2da
Compare
| */ | ||
| function deny(response, msg) { | ||
| response.writeHead(401); | ||
| response.write(msg); |
Check warning
Code scanning / CodeQL
Reflected cross-site scripting
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 year ago
To fix the reflected cross-site scripting vulnerability, we need to sanitize the user-provided request.url before incorporating it into the msg string and writing it to the HTTP response. The best way to achieve this is by using a well-known library for escaping HTML, such as escape-html.
- General Fix: Use contextual output encoding/escaping before writing user input to the response.
- Detailed Fix: Import the
escape-htmllibrary and use it to sanitizerequest.urlbefore constructing themsgstring. - Specific Changes: Modify the
denyfunction to escape themsgparameter before writing it to the response. - Required Changes: Import the
escape-htmllibrary, update thedenyfunction, and sanitize themsgstring.
-
Copy modified line R3 -
Copy modified line R95
| @@ -2,2 +2,3 @@ | ||
| import fs from 'fs'; | ||
| import escapeHtml from 'escape-html'; | ||
|
|
||
| @@ -93,3 +94,3 @@ | ||
| response.writeHead(401); | ||
| response.write(msg); | ||
| response.write(escapeHtml(msg)); | ||
| response.end(); |
-
Copy modified lines R22-R23
| @@ -21,3 +21,4 @@ | ||
| "follow-redirects": ">=1.14.8", | ||
| "xml2js": ">=0.4.23" | ||
| "xml2js": ">=0.4.23", | ||
| "escape-html": "^1.0.3" | ||
| }, |
| Package | Version | Security advisories |
| escape-html (npm) | 1.0.3 | None |
d960179 to
f4c3e94
Compare
🦋 Changeset detectedLatest commit: cb8862f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
d741550 to
04a60c9
Compare
4ad873d to
7eeaa92
Compare
fe90dca to
13f7102
Compare
- chore: add code comments - refactor: backup refactor - refactor: pass all tests - refactor: finished client refactor - feat: add promise execution - refactor: add debug function - test: refactor test and new post promised tests - refactor: rename main modules - refactor: configure build for module and cjs - refactor: delete mistaken files - refactor: ignore files - refactor: deleted un-required files - refactor: add cjs y module test projects - chore: ignore files - refactor: align test to module build - refactor: improve code
13f7102 to
ca3ba9d
Compare
- refactor: add release workflow - refactor: use freed package-lock.json - refactor: correct github folder - ci: add github actions - chore: dockerize nrc - chore: add changeset
b2ab4ed to
3abb555
Compare
8a7f722 to
cfa5561
Compare
No description provided.