-
Notifications
You must be signed in to change notification settings - Fork 23
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
Sanitize CI #385
Sanitize CI #385
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ const compareButton = () => { | |
checkedBoxes.forEach(checkbox => { | ||
link = `${link}${checkbox.value},`; | ||
}); | ||
window.location = link.substr(0,link.length-1); | ||
window.location = encodeURIComponent(link.substr(0, link.length - 1)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this supposed to do? Which part of the checkboxes is supposed to be malicious? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't honestly understand the vulnerability here, but this was the recommendation on how to resolve it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a link? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was a ChatGPT suggestion: To fix the warning about DOM text being reinterpreted as HTML without escaping meta-characters, you need to properly escape the text before assigning it to window.location = encodeURIComponent(link.substr(0, link.length - 1)); By using However, please note that directly manipulating |
||
} | ||
const updateCompareCount = () => { | ||
const countButton = document.getElementById('compare-button'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is
url_params.get('repo')
not sanitzed here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed. Fixed in last commit