Matt, Comments inline below. -- Ryan Barnett Trustwave SpiderLabs ModSecurity Project Leader OWASP ModSecurity CRS Project Leader
From: Matt Mitchell <mmitch...@backstopsolutions.com<mailto:mmitch...@backstopsolutions.com>> Date: Friday, January 4, 2013 3:22 PM To: "owasp-modsecurity-core-rule-set@lists.owasp.org<mailto:owasp-modsecurity-core-rule-set@lists.owasp.org>" <owasp-modsecurity-core-rule-set@lists.owasp.org<mailto:owasp-modsecurity-core-rule-set@lists.owasp.org>> Subject: [Owasp-modsecurity-core-rule-set] 'Multiple URL Encoding Detected', id:'950109' -- am I confused? Hi all, Thanks in advance for any help you can provide. I'm attempting to configure mod_security and the core rule set to handle traffic for our web application and am getting stuck trying to figure out the intended behavior of rule 950107. The problem I'm running into seems to stem from the fact that a literal % is being URI-encoded inside a query string (done "automagically" by jQuery in my case). As I'm reading rule 950109, it looks like any encoded character will cause it to trigger, which seems like not the intent of the rule (based on the name). I'd expect the rule to fire only in the case where the encoded % (%25) were then followed by two more (or u+4 more) digits, which would result from URI-encoding a string twice. While the encoding of the % as %25 isn't strictly necessary, I don't think it is, in and of itself, necessarily a problem. Here is an example request: GET /searchController.jsp?searchText=%25name&maxResults=50 So I suppose I have a three-part question: 1. What, if anything, am I missing about the intent and implementation of 950109? The purpose of this rule is to identify multiple encodings. The key to understanding the rule processing is the fact that the ARGS collection automatically applies 1 URL decode to the content before passing to the operator. This is key as it means that if there is any % char following by at least 2 alpha-numeric chars, then it is probably encoded content remaining. 1. If its behavior is deemed to be "correct", how would you suggest working around this? I have been trying to be surgical about modifying the core rules, only either whitelisting entire endpoints or by removing selected rules by ID after all had been loaded. I am sure I could re-add a modified version of 950109 that will not trigger on the particular endpoint in question, but is there a better way? I think that we might be able to improve the Regex to look for multiple, continued encoding and not just 1 encoded char such as %25. I will see about updating the Regex and let the list know. -Ryan 1. If its behavior is deemed to be incorrect, how should we (I) change it? -m ________________________________ This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.
_______________________________________________ Owasp-modsecurity-core-rule-set mailing list Owasp-modsecurity-core-rule-set@lists.owasp.org https://lists.owasp.org/mailman/listinfo/owasp-modsecurity-core-rule-set