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.

Rule 932200 from https://github.com/coreruleset/coreruleset/blob/v4.0/dev/rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf creating false positives for GraphQL query

See original GitHub issue

Description

For certain GraphQL queries the rule 932200 is creating false positives. For example, for the following GraphQL query, the rule is tracing $f and blocking it even though its a valid request:

query HeroComparison($first: Int = 3) {
  leftComparison: hero(episode: EMPIRE) {
    ...comparisonFields
  }
  rightComparison: hero(episode: JEDI) {
    ...comparisonFields
  }
}

fragment comparisonFields on Character {
  name
  friendsConnection(first: $first) {
    totalCount
    edges {
      node {
        name
      }
    }
  }
}

Audit Logs / Triggered Rule Numbers

POC: https://regex101.com/r/Y1F1ko/1

Rule 932200 of shell injection URL: https://github.com/coreruleset/coreruleset/blob/v4.0/dev/rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf

Confirmation

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dune73commented, Nov 14, 2022

Unfortunately yes, @fuomag9. And there is very little we can do with CRS alone. The problem is the lack of parser in ModSec (compare with XML and JSON …).

1reaction
fzipicommented, Sep 17, 2022

An example GraphQL query could be this:

curl --location --request POST 'https://echo.hoppscotch.io/graphql' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query Request {\n  method\n  url\n  headers {\n    key\n    value\n  }\n}\n","variables":{}}'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Blocking graphql queries · Issue #1775 - GitHub
Audit Logs / Triggered Rule Numbers. I'm trying to setup ModSecurity in my server, but first I'm setting up locally for testing. The...
Read more >
GraphQL query best practices
When creating queries and mutations, follow these best practices to get the most out of both GraphQL and Apollo tooling. Name all operations....
Read more >
OWASP Rules and Graphql - Stack Overflow
What rules of OWASP are triggering a false positive in your requests? GraphQL requests are nothing more than a POST request but you...
Read more >
GraphQL Library Detection - Invicti
Invicti can detect GraphQL endpoints and libraries by sending specific queries. The GraphQL library detection is enabled by default.
Read more >
Validation - GraphQL
Validation. By using the type system, it can be predetermined whether a GraphQL query is valid or not. This allows servers and clients...
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