ruby-i18n / i18n

Internationalization (i18n) library for Ruby
MIT License
976 stars 408 forks source link

[BUG] Possible Denial of Service #667

Closed Akashkarmakar787 closed 1 year ago

Akashkarmakar787 commented 1 year ago

What I tried to do

What actually happened

Versions of i18n, rails, and anything else you think is necessary


Bonus points for providing an application or a small code example which reproduces the issue.

Screenshot 2023-06-08 at 11 34 32 AM

Thanks! :heart:

radar commented 1 year ago

Believe these will be fixed by #668 and #669

Akash-Karmakar-e3082 commented 1 year ago

@radar @kbrock Can we have a CVE for the issue?

kbrock commented 1 year ago

@Akash-Karmakar-e3082 you passed in a 40k character string, and it was going through character by character.

It had 4 checks per character, so it was 40k * 3 checks. It did not have any major backtraces, so it did not exhibit the O(n^2) slowdown like you had in your referenced article.

If you have reason to believe that this with exponentially take longer, please share how you came to that conclusion.

Also, can you share a quick example of why someone would localize content that was entered by a user? (An admin does not count. if the admin is nefarious, then they may as well just format the disk and be done)