Re:The weirdest bug I've seen yet
by dev_slash_null on Thursday November 30, 2023 @08:26PM
(#38481776)
Just in case you haven't seen the postmortem of the Cloudflare outage which also was caused by a regex based DoS: https://blog.cloudflare.com/details-of-the-cloudflare-outage...
That was a great read, but there was one thing I didn't understand: Why would the regex string have "." twice in a row? What does ".." find that "." doesn't find? Does that just mean "at least two characters"?
It means specifically 2 characters, and is equivalent to .{2}
..+ or ...* are ways of writing "at least two characters".
Re:The weirdest bug I've seen yet
by bn-usd-mistake on Friday December 01, 2023 @05:44AM
(#38485338)
A single `.` matches exactly one character. `..` matches exactly two characters (not more, not less).
Re:The weirdest bug I've seen yet
by beaugunderson on Friday December 01, 2023 @03:01AM
(#38484330)
I had a ReDoS issue at a prior company many years ago; at least they're lintable now:
https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-super-linear-move.html
https://www.npmjs.com/package/eslint-plugin-redos/v/1.2.0
Just today I debugged a regex that would DoS our backend whenever the user enters the wrong thing in a form.
Now I'm reading up on regex engines: https://swtch.com/%7Ersc/regexp/regexp1.html