owasp-modsecurity / owasp-modsecurity/ModSecurity

Problem about proxy action

Open
#3,170 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.x Platform - Apache
Dominant language
C++
Stars
9.8k
Forks
1.8k
Avg merge
2h 46m
Merged PRs (30d)
1

Description

Describe the bug

I find a problem about proxy action.
If access a specified webpage file, such as "http://a.com/a/index.html", it can be successfully forwarded.
If access a directory, such as "http://a.com/a/", the error_log can log the url will be forwarded, but actually it cannot be forwarded.

Logs and dumps

[Wed Jun 12 11:04:12.784758 2024] [security2:error] [pid 97647:tid 139691269490432] [client 10.16.18.12:49131] [client 10.16.18.12] ModSecurity: Access denied using proxy to (phase 2) http://www.test1.com/a/index.html. detected XSS using libinjection. [file "/www/server/apache/conf/modsecurity/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf"] [line "100"] [id "941100"] [msg "XSS Attack Detected via libinjection"] [data "Matched Data: XSS data found within ARGS🆔 <script>"] [severity "CRITICAL"] [ver "OWASP_CRS/4.4.0-dev"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-xss"] [tag "xss-perf-disable"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/152/242"] [hostname "www.test.com"] [uri "/a/index.html"] [unique_id "ZmkQLMRnhk_2RbFR9ZGHggAAAJI"]

[Wed Jun 12 11:05:46.047957 2024] [security2:error] [pid 97790:tid 139691286275840] [client 10.16.18.12:49213] [client 10.16.18.12] ModSecurity: Access denied using proxy to (phase 2) http://www.test1.com/a/. detected XSS using libinjection. [file "/www/server/apache/conf/modsecurity/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf"] [line "100"] [id "941100"] [msg "XSS Attack Detected via libinjection"] [data "Matched Data: XSS data found within ARGS🆔 <script>"] [severity "CRITICAL"] [ver "OWASP_CRS/4.4.0-dev"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-xss"] [tag "xss-perf-disable"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/152/242"] [hostname "www.test.com"] [uri "/a/"] [unique_id "ZmkQijzeTyiVCq1qyoYiawAAANA"]

To Reproduce

Steps to reproduce the behavior:
curl http://www.test.com/a/index.html?id=<script>
curl http://www.test.com/a/?id=<script>

Expected behavior

If access a directory, it also can be forwarded.

Server (please complete the following information):

  • ModSecurity version (and connector): ModSecurity v2.9.7
  • WebServer: Apache 2.4.58
  • OS (and distro): CentOS 7.9.2009 x86_64

Rule Set (please complete the following information):

  • Running any public or commercial rule set? OWASP CRS
  • What is the version number? ver.4.4.0-dev

Additional context

The SecDefaultAction configuration is as follows:
SecDefaultAction "phase:1,log,noauditlog,proxy:'[nocanon]http://www.test1.com%{REQUEST_FILENAME}'"
SecDefaultAction "phase:2,log,noauditlog,proxy:'[nocanon]http://www.test1.com%{REQUEST_FILENAME}'"

Contributor guide

No contributing guide indexed for this repository

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 SecDefaultAction proxy configurations and reproduce both requests using the supplied curl commands against Apache 2.4.58 with ModSecurity v2.9.7 and OWASP CRS 4.4.0-dev. Compare proxy handling for /a/index.html and /a/; done means directory requests are forwarded as expected without breaking the reported rule behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, cpp
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.