-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Fixed bug in prototypejs #3003
Fixed bug in prototypejs #3003
Conversation
If I try the regex on the string |
The PR is a little bit different from prototypejs/prototype#349 Why is this PR public? |
Yes, the solution proposed in prototypejs/prototype#349 seems to be working fine. |
@elidrissidev switched the PR to the code used in prototypejs/prototype#349 @theroch cause it's public on prototype repo since 2021, also, if we merge it quick we can release it quick |
It's an argument ;) |
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.
Regex works fine, but untested since I don't know how to replicate the issue.
I found an attack script, but not sure how to test it. If someone can test if the fix really works? |
We've tested with this script and we can confirm that this fixed the issue. Sorry I was very busy, so I only now get to answer you again. |
/cc @Flyingmana |
I did and forwarded it internally, where @fballiano got it and volunteered to take care of it. (there are currently 3 or 4 people behind the security contact address) |
@theroch that's the info I left out intentionally :-D |
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.
Tested. Add the following in any page
<script>
function build_attack(n) {
var ret = "hello <span> <a "
for (var i = 0; i < n; i++) {
ret += "'"
}
return ret+"!";
}
function attack() {
for(var i = 1; i <= 50000; i++) {
var time = Date.now();
var attack_str = build_attack(i)
attack_str.stripTags()
var time_cost = Date.now() - time;
console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
}
}
</script>
Then execute the attack in browser console. The page became unresponsive without this PR.
merged and ported to v20 @kiatng @elidrissidev @Flyingmana do you think we should do another hotfix release? |
Anything blocking a full release? |
as its related to a CVE, its probably preferred by users to have another release |
How is it with the version number in prototype.js. Is it possible to increase it to 1.7.4 or 1.7.3.1. |
I wouldn't change the prototype version as prototype itself didn't do anything about it. as per ZF1, we apply patches but don't change their version number. |
@Flyingmana I'll prepare another hotfix |
I've prepared the 2 hotfix branches with version bump and this commit, could you just do a quick check for me before actually tagging the release? thanks! |
Everything is explain in prototypejs/prototype#356
I'm not publishing too many details on this PR since it's a delicate matter, but we should merge it ASAP