libModSecurity3: REQUEST_HEADERS names are treated as case sensitive with configure-time rule-exclusions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 64/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- cpp, nginx
調査の方向性
まず、設定時のルール除外が SecRuleUpdateTargetById から一致する REQUEST_HEADERS ターゲットまでどのように伝わるかを追跡します。2 つの curl リクエストで問題を再現し、Referer と referer の除外を比較します。ヘッダー名の大文字と小文字が無視され、1 つの除外が両方のリクエストで一貫して動作し、リグレッションをカバーするテストがあることが完了条件です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
This bug is similar to: https://github.com/owasp-modsecurity/ModSecurity/issues/3441, which also doesn't appear in ModSecurity2.
Logs and dumps
N/A
To Reproduce
Re-using the previous example in this issue, say I have this rule:
SecRule REQUEST_HEADERS:Referer "@contains <evil-string>" \
"id:2,\
phase:1,\
deny,\
t:none,\
log"
and I want to write a rule-exclusion for this rule via a configure-time rule-exclusion:
SecRuleUpdateTargetById 2 !REQUEST_HEADERS:referer
This rule-exclusion works if the client sends a lowercase referer header:
$ curl -H "referer: <evil-string>" localhost:8080
But if the client sends an uppercase referer header, then the request is wrongly blocked:
$ curl -H "Referer: <evil-string>" localhost:8080
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx/1.28.3 (Ubuntu)</center>
</body>
</html>
If I exclude both uppercase and lowercase referer header, then the rule-exclusion works as expected.
SecRuleUpdateTargetById 2 !REQUEST_HEADERS:Referer
SecRuleUpdateTargetById 2 !REQUEST_HEADERS:referer
Expected behavior
Request header case should be ignored.
Server (please complete the following information):
- OS: Ubuntu 26.04
- ModSecurity Version: 3.0.17
- NGINX Connector Version: v1.0.4
- NGINX Version: 1.28.3
Rule Set (please complete the following information):
N/A
Additional context
Similar to: https://github.com/owasp-modsecurity/ModSecurity/issues/3441
- 主要言語
- C++
- スター
- 9.8k
- フォーク
- 1.8k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
owasp-modsecurity/ModSecurity のほかの issue
-
v2: t:utf8toUnicode drops the last hex digit of code points above U+FFFF (regression since 2.9.9)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
owasp-modsecurity/ModSecurity#3684 ·
メンテナーはふだん 1 日以内に返信
-
IIS: ReadFileChunk allocates only 1 byte but reads m_dwPageSize (latent overflow)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン2.x bug Platform - IIS pr available windows
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
owasp-modsecurity/ModSecurity#3623 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
IIS: Host header fallback is dead code (r->hostname == NULL can never be true)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン2.x bug Platform - IIS pr available windows
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
owasp-modsecurity/ModSecurity#3621 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
IIS: Content-Length header corrupted/truncated for large responses (wrong printf format + off-by-one buffer size)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン2.x bug Platform - IIS pr available windows
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
owasp-modsecurity/ModSecurity#3619 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
2.x bug Platform - IIS pr available windows
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
owasp-modsecurity/ModSecurity#3612 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
owasp-modsecurity/ModSecurity の issue をすべて見る
似ている issue
-
objdetect(mcc): CCheckerDetector leaves its chart type uninitialized 🤖🤖🤖対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
(S1 - Need confirmation)
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CleverRaven/Cataclysm-DDA#89182 ·
メンテナーはふだん 1 日以内に返信
-
ai_p2
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ClickHouse/ClickHouse#126833 ·
メンテナーはふだん 1 日以内に返信
-
clang:static analyzer
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
llvm/llvm-project#233598 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100