question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

False Positives with PL4 rule 920274 (msg: Invalid character in request headers (outside of very strict set))

See original GitHub issue

Description

I have a lot of false positives with PL4 rule 920274 (I know it’s PL4!) The rule’s message is: Invalid character in request headers (outside of very strict set)

Audit Logs / Triggered Rule Numbers

Although it is a PL4 rule, in my opinion it is far too strict and I would like to relax it.

Rule violations I often see:

  • Sec-CH-UA: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA. Hint: REQUEST_HEADERS:Sec-CH-UA-Mobile is already excluded from this rule.
  • REQUEST_HEADERS:from=googlebot(at)googlebot.com
  • REQUEST_HEADERS:x-authenticated-user=someone@somewhere.xy
  • REQUEST_HEADERS:via=1.1 172.x.y.z (McAfee Web Gateway 10.2.3.38089) or other versions
  • REQUEST_HEADERS:x-user-identity=name@somedomain.xy - Exchange autodiscover requests
  • REQUEST_HEADERS:x-anchormailbox=name@somedomain.xy - Exchange autodiscover requests
  • REQUEST_HEADERS:from=bingbot(at)microsoft.com - bingbot indexing

I would like to do the following two changes to the rule:

  1. Add an exclusion for Sec-CH-UA like we already have for Sec-CH-UA-Mobile
  2. Add the brackets ( and ) and maybe the @ to the list of allowed characters

What do you think. Is it worth improving a PL4 rule? I would say yes, because I think we should always allow compliant requests, even at PL4.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
franbuehlercommented, Jan 24, 2022

Ok, thank you both! I’ll open a PR.

1reaction
dune73commented, Jan 24, 2022

I second @lifeforms’ opinion here.

As for @: It’s role in the DOM model gives it a role in many XSS exploits. See https://portswigger.net/web-security/cross-site-scripting/cheat-sheet

Read more comments on GitHub >

github_iconTop Results From Across the Web

False positives on 920274 for From Header ... - GitHub
It complicates the rule 920274 or costs everybody cycles if adding exclusion to 905. People working in PL4 are perfectly capable of excluding...
Read more >
Handling False Positives with the OWASP ... - netnea
Rule 920273 Invalid character in request is pretty much self explanatory. It's a very strict rule at paranoia level 4 and it fights...
Read more >
request-920-protocol.. - Index of /
The OWASP ModSecurity Core Rule Set is distributed under # Apache Software ... msg:'Invalid character in request headers (outside of very strict set)',\ ......
Read more >
ModSecurity CRS Rule Group 920 Protocol Enforcement
920420 In case Content-Type header can be parsed, check the mime-type against 920274 Invalid character in request headers (outside of very strict set) ......
Read more >
How to tune your WAF installation to reduce false positives
ModSecurity, the WAF engine, is most often used in coordination with the OWASP ModSecurity Core Rule Set (CRS). This creates a first line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found