You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DoS: Infinite loop in parser when ruby script contains an unclosed heredoc named with empty string #5676
changed the title [-]Infinite loop when ruby script contains an unclosed heredoc named with empty string[/-][+]DoS: Infinite loop in parser when ruby script contains an unclosed heredoc named with empty string[/+]on Mar 24, 2022
Activity
lopopolo commentedon Mar 24, 2022
I found this bug when fuzzing artichoke with
rust-fuzzandlibFuzzer:https://github.com/artichoke/artichoke/runs/5675904707?check_suite_focus=true
printing the bytes that trigger the infinite loop:
[-]Infinite loop when ruby script contains an unclosed heredoc named with empty string[/-][+]DoS: Infinite loop in parser when ruby script contains an unclosed heredoc named with empty string[/+]lopopolo commentedon Mar 24, 2022
Here's a couple of stack traces I pulled from LLDB:
lopopolo commentedon Mar 24, 2022
This also reproduces on 3.1.0-rc. Here's a stack I pulled during the infinite loop:
matz commentedon Mar 24, 2022
Thank you! We forgot to check empty here-doc delimiters.
lopopolo commentedon Mar 24, 2022
Thanks @matz. Would you be willing to backport this fix to the pending 3.1 release?
matz commentedon Mar 25, 2022
Ah, I will ask the release manager.
parse.y: empty here-doc delimiter caused infinite loop; fix mruby#5676
parse.y: empty here-doc delimiter caused infinite loop; fix mruby#5676