lib/contrast/agent/protect/rule/path_traversal.rb in contrast-agent-4.6.0 vs lib/contrast/agent/protect/rule/path_traversal.rb in contrast-agent-4.7.0

- old
+ new

@@ -27,11 +27,11 @@ /Windows/win.ini /windows/system32/ /windows/repair/ ].cs__freeze - def name + def rule_name NAME end def infilter context, method, path return unless infilter?(context) @@ -40,13 +40,12 @@ return unless result append_to_activity(context, result) return unless blocked? - raise Contrast::SecurityException.new( - self, - "Path Traversal rule triggered. Call to File.#{ method } blocked.") + raise Contrast::SecurityException.new(self, + "Path Traversal rule triggered. Call to File.#{ method } blocked.") end protected def find_attacker context, path @@ -126,10 +125,11 @@ # return 'embedded null byte' == str(e) # except TypeError as e: # return 'NUL' in str(e) or 'null byte' in str(e) or (PY34 and 'embedded NUL character' == str(e)) # except Exception as e: # return 'null byte' in str(e).lower() - # return return any([bypass_markers.lower().rstrip('/') in realpath for bypass_markers in PathTraversalREPMixin.KNOWN_SECURITY_BYPASS_MARKERS]) + # return return any([bypass_markers.lower().rstrip('/') in realpath for bypass_markers in + # PathTraversalREPMixin.KNOWN_SECURITY_BYPASS_MARKERS]) false end end end end