Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

libModSecurity3: REQUEST_HEADERS names are treated as case sensitive with configure-time rule-exclusions

オープン
#3,609 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
64/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp, nginx

調査の方向性

まず、設定時のルール除外が SecRuleUpdateTargetById から一致する REQUEST_HEADERS ターゲットまでどのように伝わるかを追跡します。2 つの curl リクエストで問題を再現し、Referer と referer の除外を比較します。ヘッダー名の大文字と小文字が無視され、1 つの除外が両方のリクエストで一貫して動作し、リグレッションをカバーするテストがあることが完了条件です。

索引モデルが issue の本文から書いたものです。

説明

:1st_place_medal: good first issue 3.x pr available

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 ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

owasp-modsecurity/ModSecurity のほかの issue

owasp-modsecurity/ModSecurity の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。