coreruleset / coreruleset/coreruleset

Integer MAX value is recognised as malicius

Open
#4,754 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

:heavy_plus_sign: False Positive
Dominant language
Python
Stars
3.3k
Forks
470
Avg merge
1d 20h
Merged PRs (30d)
11

Description

Description

During testing we noticed that Integer MAX value (2,147,483,647) is blocked as malicious, but this is valid number.

It looks like this is rule which is causing issue
https://github.com/coreruleset/coreruleset/blob/2c67856251fc90dcaf07f581ecdd484ec215248b/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf#L227-L254

and following is pattern
(?:429496729[56]|2(?:14748364[78]|.22507385850720(?:07|11)e-308)|-(?:214748364[89]|0000023456)|00000(?:12345|23456)|1e309)$"

How to reproduce the misbehavior (-> curl call)

In order to reproduce you can execute below endpoint on Sandbox

GET https://sandbox.coreruleset.org/?size=2147483647

That call is producing 403 error

"response": {
    "protocol": "HTTP/1.1",
    "status": 403,
    "headers": {
      "X-Unique-ID": "anXOUIi1kw0Lu7niovrHaQAAAAo",
      "Content-Length": "199",
      "Connection": "close",
      "Content-Type": "text/html; charset=iso-8859-1"
    },
...

While call which has value less then maximum will work as expected

GET /path/to/endpoint?size=](https://sandbox.coreruleset.org/?size=2147483646
would return expected response

  "response": {
    "protocol": "HTTP/1.1",
    "status": 200,
    "headers": {
      "X-Unique-ID": "anXOupe8YeMA0RqZQSZjuAAAARQ",
      "Access-Control-Allow-Credentials": "true",
      "Access-Control-Allow-Origin": "*",
      "Content-Security-Policy": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' camo.githubusercontent.com",
      "Content-Type": "text/html; charset=utf-8",
      "Content-Length": "13363",
      "Connection": "close"
    },
...
Confirmation

[x ] I have removed any personal data (email addresses, IP addresses,
passwords, domain names) from any logs posted.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked rule in REQUEST-942-APPLICATION-ATTACK-SQLI.conf and inspect the pattern around the reported match. Reproduce the behavior with the sandbox curl requests using size=2147483647 and size=2147483646, then verify that the valid maximum value is accepted without weakening the rule's intended malicious-value detection.

Written by the indexing model from the issue text.

Assessment

Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.