[9.191][BUG] HTTP Proxy "exceeded pcre limit on ..." reached

If I try to register on the hp website online shop https://h20386.www2.hp.com/SwitzerlandStore/Merch/SimpleRegistration.aspx, it will not work due following messages:


2013:12:27-11:28:12 asg01 httpproxy[6397]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xbc50020" function="match_exception_domainlist" file="profile.c" line="611" message="exception No Countryblocking exceeded pcre limit on met2.hp.com/.../s14031337932683
2013:12:27-11:28:12 asg01 httpproxy[6397]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xbc50020" function="match_exception_domainlist" file="profile.c" line="611" message="exception DELL Updates exceeded pcre limit on met2.hp.com/.../s14031337932683
2013:12:27-11:28:12 asg01 httpproxy[6397]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xbc50020" function="match_exception_domainlist" file="profile.c" line="611" message="exception APPLE EXCEPTIONS exceeded pcre limit on met2.hp.com/.../s14031337932683
2013:12:27-11:28:12 asg01 httpproxy[6397]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xbc50020" function="match_exception_domainlist" file="profile.c" line="611" message="exception SUN JAVA Updates exceeded pcre limit on met2.hp.com/.../s14031337932683
2013:12:27-11:28:12 asg01 httpproxy[6397]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xbc50020" function="match_exception_domainlist" file="profile.c" line="611" message="exception ADOBE EXCEPTIONS exceeded pcre limit on met2.hp.com/.../s14031337932683
2013:12:27-11:28:12 asg01 httpproxy[6397]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xbc50020" function="match_exception_domainlist" file="profile.c" line="611" message="exception NITENDO WII exceeded pcre limit on met2.hp.com/.../s14031337932683
2013:12:27-11:28:12 asg01 httpproxy[6397]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0xbc50020" function="match_exception_domainlist" file="profile.c" line="611" message="exception Shoutcast exceeded pcre limit on met2.hp.com/.../s14031337932683


Somehow all this informations in the URL will make it's size little too big for the pcre scanner ?
  • We changed the internal representation of regex to do better error handling and it looks like it doesn't do super-long urls all that well.
  • Correction:  This is not due to the representation of regex or Mantis 24316.

    This is something due to a bug fix brought in with 9.107.  There is a balancing act between memory allocation and handling of long URLs.  This will take some thought on what to do.

    Please note that this error message can be safely ignored.  It doesn't really cause a problem, its just stating the URL will not be parsed to see if it matches an exception.

    FYI:
    9.106 may have coredumped at this URL
    9.107 will print this error message
    9.191 will print this error message

    This is not really a 9.2 beta problem so I don't know the priority on it.  But we're looking into it.
  • this is a huge issue because if exception checking is not done then things that require the exception WILL BREAK.

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • William, I agree.  However the URLs need to be unusually long for this to occur.

    Remember that in 9.106 (and possibly all of 9.1) it used to coredump and we only had one or two reports.  9.107 has been out for a month and this is the first problem we've heard.

    The likelihood that you get such a long URL combined with the need to apply an exception in order for it to work says to me that this is not a huge issue that warrants ALL CAPS.

    In other words, if long URLs have been broken for a year then we should fix it, but it isn't a must have to get it next week.
  • Hello Michael

    I agree, that the URL is unusual long (those web programmers at HP maybe should learn lean coding...). However - I think HP is a well visited site and should work without issues through our proxy. I'm sure you'll find some clever fix for this too - you guys did really good work on the http proxy in the last months !!!

    /Sascha
  • Additional information:

    IE maximum URL length is roughly 2048 characters.  UTM maximum URL length is 2048 characters.

    This URL in question is 1700 characters, which is under the limit but also getting closer to it.

    The part of the system that is having problems is the PCRE - Perl Compatible Regular Expressions, a standard perl component.  PCRE is giving an amount of memory it can use (stack).  Depending on the URL *and* the complexity of the regular expression it needs to use different amounts of memory.  So if you have URL that is 2000 characters long and a simple regex ('aaaa') then it can do it in the memory space just fine.  But you could have a short URL (1000 characters) and an exceedingly complex regex that could cause it to run out of memory.

    So this isn't really about increasing the number of characters we support in a URL.  It is about making sure that there is enough assigned memory to PCRE that the regex that come out of the box can handle the maximum length of URL.  And balance that with the other memory constraints.

    However if someone wrote their own regex that was more complex it could break again.
    Runaway Regular Expressions: Catastrophic Backtracking
  • i can understand that..however i'm seeing this error with increasing frequency in my utm installations just using everyday sites.  It seems either regex needs to have more ram allocated to it or another system needs to be used.  Of course memory constraints can also be solved by making the minimum ram in the UTM appliances 4 gigs instead of 2.  I'm actually advocating for 8 at this point as even 4 is running into usage constraints with 9.x...might want to tune the kernel in UTM so it doesn't cache so aggressively as well..[:)]

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • Hi William,

    Can you fire me an IM (or post here) with a file containing examples.  It will give me a good base to test against once fixed.

    zgrep match_exception_domainlist /var/log/http/2013/12/http*
    zgrep match_exception_domainlist /var/log/http/2014/01/http*
  • hold snikies..i've got to modify that argument to it spits out a file

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • hrmm for some reason filezilla can not connect to the utm anymore...[:(]

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow