-
Notifications
You must be signed in to change notification settings - Fork 6
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
Updating staging #1041
Updating staging #1041
Conversation
Added the js
payment accuracy prod fix
fix header for career planning tool
carrer planning header
jfmip hide block chain
.then(function (posts) { | ||
totalResults = posts.web.total; | ||
document.getElementById("search-params").innerHTML = | ||
urlParams.get("query"); |
Check failure
Code scanning / CodeQL
Client-side cross-site scripting High
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to ensure that any user input written to the webpage is properly sanitized or encoded to prevent XSS attacks. The best way to fix this issue is to use a library that provides functions for safely encoding user input before inserting it into the DOM. One such library is DOMPurify
, which can sanitize HTML and prevent XSS attacks.
We will:
- Import the
DOMPurify
library. - Use
DOMPurify
to sanitize the user input before writing it to the DOM.
-
Copy modified lines R1-R2 -
Copy modified line R49 -
Copy modified line R51
@@ -1 +1,3 @@ | ||
import DOMPurify from 'dompurify'; | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
@@ -46,5 +48,5 @@ | ||
document.getElementById("search-params").innerHTML = | ||
urlParams.get("query"); | ||
DOMPurify.sanitize(urlParams.get("query")); | ||
document.getElementById("search-keyword").innerHTML = | ||
urlParams.get("query"); | ||
DOMPurify.sanitize(urlParams.get("query")); | ||
document.getElementById("results-count").innerHTML = totalResults; |
-
Copy modified lines R15-R16 -
Copy modified line R26
@@ -14,3 +14,4 @@ | ||
"react-redux": "^7.2.9", | ||
"striptags": "^3.2.0" | ||
"striptags": "^3.2.0", | ||
"dompurify": "^3.2.3" | ||
}, | ||
@@ -24,3 +25,3 @@ | ||
"cross-spawn": "^6.0.6", | ||
"trim":">=0.0.3", | ||
"trim": ">=0.0.3", | ||
"tough-cookie": ">=4.1.4", |
Package | Version | Security advisories |
dompurify (npm) | 3.2.3 | None |
document.getElementById("search-params").innerHTML = | ||
urlParams.get("query"); | ||
document.getElementById("search-keyword").innerHTML = | ||
urlParams.get("query"); |
Check failure
Code scanning / CodeQL
Client-side cross-site scripting High
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to ensure that any user-provided data is properly sanitized or encoded before being inserted into the DOM. The best way to fix this issue is to use a library like DOMPurify
to sanitize the user input. This will remove any potentially malicious content from the input before it is inserted into the DOM.
- Install the
DOMPurify
library. - Import
DOMPurify
in the relevant JavaScript file. - Use
DOMPurify.sanitize
to sanitize the user input before assigning it to theinnerHTML
property.
-
Copy modified lines R1-R2 -
Copy modified line R49 -
Copy modified line R51
@@ -1 +1,3 @@ | ||
import DOMPurify from 'dompurify'; | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
@@ -46,5 +48,5 @@ | ||
document.getElementById("search-params").innerHTML = | ||
urlParams.get("query"); | ||
DOMPurify.sanitize(urlParams.get("query")); | ||
document.getElementById("search-keyword").innerHTML = | ||
urlParams.get("query"); | ||
DOMPurify.sanitize(urlParams.get("query")); | ||
document.getElementById("results-count").innerHTML = totalResults; |
-
Copy modified lines R15-R16 -
Copy modified line R26
@@ -14,3 +14,4 @@ | ||
"react-redux": "^7.2.9", | ||
"striptags": "^3.2.0" | ||
"striptags": "^3.2.0", | ||
"dompurify": "^3.2.3" | ||
}, | ||
@@ -24,3 +25,3 @@ | ||
"cross-spawn": "^6.0.6", | ||
"trim":">=0.0.3", | ||
"trim": ">=0.0.3", | ||
"tough-cookie": ">=4.1.4", |
Package | Version | Security advisories |
dompurify (npm) | 3.2.3 | None |
if (totalResults > (page * resultsPerPage)) { | ||
pagerLinks += '<a href="' + getLinkToPage(parseInt(page) + 1) + '" aria-label="Next page">Next >></a>'; | ||
} | ||
pager.innerHTML = pagerLinks; |
Check failure
Code scanning / CodeQL
Client-side cross-site scripting High
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 2 months ago
To fix the problem, we need to ensure that any user-provided input is properly sanitized or escaped before being used in HTML content. In this case, we should escape the page
parameter before inserting it into the DOM.
The best way to fix this issue is to use a library like DOMPurify
to sanitize the user input. This library is well-known and widely used for preventing XSS attacks.
We will need to:
- Import the
DOMPurify
library. - Use
DOMPurify
to sanitize thepage
parameter before using it in the HTML content.
-
Copy modified lines R1-R2 -
Copy modified line R110
@@ -1 +1,3 @@ | ||
import DOMPurify from 'dompurify'; | ||
|
||
document.addEventListener("DOMContentLoaded", function () { | ||
@@ -107,3 +109,3 @@ | ||
'<span class="margin-2">Page ' + | ||
page + | ||
DOMPurify.sanitize(page) + | ||
" of " + |
-
Copy modified lines R15-R16 -
Copy modified line R26
@@ -14,3 +14,4 @@ | ||
"react-redux": "^7.2.9", | ||
"striptags": "^3.2.0" | ||
"striptags": "^3.2.0", | ||
"dompurify": "^3.2.3" | ||
}, | ||
@@ -24,3 +25,3 @@ | ||
"cross-spawn": "^6.0.6", | ||
"trim":">=0.0.3", | ||
"trim": ">=0.0.3", | ||
"tough-cookie": ">=4.1.4", |
Package | Version | Security advisories |
dompurify (npm) | 3.2.3 | None |
No description provided.