Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Cloudflare uses Regexp::Debugger in explaining the outage

by reisinge (Hermit)
on Jul 18, 2019 at 13:01 UTC ( [id://11102972]=perlnews: print w/replies, xml ) Need Help??

See "Appendix" of this blog post.

Adding manpower to a late software project makes it later. -- Brooks law

Replies are listed 'Best First'.
Re: Cloudflare uses Regexp::Debugger in explaining the outage
by Eily (Monsignor) on Jul 18, 2019 at 13:54 UTC

    The article looks very thorough and detailed from what I've seen. The TLDR version (for the regex part. They give a lot of context information as well) would be this sentence:

    what's important is any "real-world" expression (like the complex ones in our WAF rules) that ask the engine to "match anything followed by anything" can lead to catastrophic backtracking.
    Basically /.*.*=/ is bad because the first .* will jump to the end of the string, and move back one character at a time, only for the second .* to take that character and start the whole process all over again before the engines gets a chance to check if the character is =.

    I'm kind of surprised that the optimizer wouldn't remove such an obvious problem though. Maybe it's the non capturing group which prevents the two identical nodes from being merged. Or maybe their version of perl is too old and newer ones would have optimized that away correctly.

    They don't mention it but I think the tool they used to turn the regexes into graphs is debuggex.

      maybe their version of perl is too old
      The regex were for Lua/PCRE.

        Oh you're right. So that's a case of perl to the rescue then :D.

        I still wonder if it's their version of LUA or the PCRE that is too old, or if it's missing an optimization.

Re: Cloudflare uses Regexp::Debugger in explaining the outage
by dmitri (Priest) on Jul 18, 2019 at 17:39 UTC
    My post from a couple of days ago carries the original Cloudflare outage story.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlnews [id://11102972]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-18 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found