Ubuntu nginx 1.24.0-2ubuntu7.10 crashes workers with ngx_http_modsecurity_module enabled; 1.24.0-2ubuntu7.9 works
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
issue に記載されている最小限の nginx 設定と再現コマンドから始め、ModSecurity モジュールをロードし、SecRuleEngine を有効にした nginx 1.24.0-2ubuntu7.10 を使用します。報告されている worker crash と invalid malloc request を含め、その動作とログを、抽出した 1.24.0-2ubuntu7.9 バイナリと比較します。現行パッケージが worker crash を起こさずにテストリクエストを正常に処理できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi everyone, i was running my webpage production vm on ubuntu using nginx and modsecurity >> this morning 6:00 am ish it caused the page to go down. Stopped working, i realised that its due to the latest update on nginx caused Modsecurity not to work anymore. I've summarised the information below with codex. Just wanted to give you as much info as i can so that maybe you can fix or update so that modsecurity works just fine with nginx latest version. By the way the staging environment i have which is running on a mac mini m4, is perfectly fine. It also uses nginx, and modsecurity, but somehow the issue did not impact it. Everything else is identical, the code running django, and database etc are identical. Issue seems to be on ubuntu autoupdated nginx package vs the modesecurity.
Summary
After an unattended Ubuntu upgrade from nginx 1.24.0-2ubuntu7.9 to 1.24.0-2ubuntu7.10, Nginx workers began crashing on any ModSecurity-enabled request.
This happens even with a minimal inline ModSecurity config containing only:
modsecurity on;
modsecurity_rules 'SecRuleEngine On';
Environment
OS:
Ubuntu 24.04 noble
amd64
Installed packages:
nginx 1.24.0-2ubuntu7.10
nginx-common 1.24.0-2ubuntu7.10
libnginx-mod-http-modsecurity 1.0.3-1build3
libmodsecurity3t64 3.0.12-1.1build2
modsecurity-crs 3.3.5-2
The failing upgrade was installed by unattended-upgrades:
2026-06-09 06:13:29
Upgrade: nginx:amd64 1.24.0-2ubuntu7.9 -> 1.24.0-2ubuntu7.10
Upgrade: nginx-common:amd64 1.24.0-2ubuntu7.9 -> 1.24.0-2ubuntu7.10
Impact
Production Nginx returned empty replies / Cloudflare 502s for normal dynamic requests. Nginx workers repeatedly crashed with signal 11.
Example error:
malloc(96973185644385) failed (12: Cannot allocate memory)
worker process exited on signal 11 (core dumped)
Minimal Reproduction
Use this minimal config:
load_module /usr/lib/nginx/modules/ngx_http_modsecurity_module.so;
worker_processes 1;
pid /tmp/nginx-current-modsec-test.pid;
events {
worker_connections 64;
}
http {
error_log /tmp/nginx-modsec-error.log info;
server {
listen 127.0.0.1:18100;
server_name localhost;
modsecurity on;
modsecurity_rules 'SecRuleEngine On';
location / {
default_type text/plain;
return 200 "current engine ok\n";
}
}
}
Start current Nginx:
/usr/sbin/nginx -p /tmp/nginx-current-prefix -c /tmp/current.conf
curl -sS -D - http://127.0.0.1:18100/
Actual result:
curl: (52) Empty reply from server
Nginx error log:
malloc(108978184456033) failed (12: Cannot allocate memory)
worker process exited on signal 11 (core dumped)
Control Test
Download and extract previous Nginx:
apt-get download nginx=1.24.0-2ubuntu7.9 nginx-common=1.24.0-2ubuntu7.9
dpkg-deb -x nginx_1.24.0-2ubuntu7.9_amd64.deb /tmp/nginx-old
Run the same config with the old binary:
/tmp/nginx-old/usr/sbin/nginx -p /tmp/nginx-old-prefix -c /tmp/old.conf
curl -sS -D - http://127.0.0.1:18101/
Expected/actual result with old binary:
HTTP/1.1 200 OK
old engine ok
Workaround
Pin/replace the service runtime to use the extracted nginx 1.24.0-2ubuntu7.9 binary. With the previous Nginx binary, the same ModSecurity module and rules work again.
Expected Behavior
nginx 1.24.0-2ubuntu7.10 should not crash workers when ngx_http_modsecurity_module is loaded and SecRuleEngine On is enabled.
Actual Behavior
Nginx worker crashes with huge invalid-looking malloc request and signal 11.
Notes
This appears to be a regression or ABI/runtime incompatibility between:
nginx 1.24.0-2ubuntu7.10
libnginx-mod-http-modsecurity 1.0.3-1build3
libmodsecurity3t64 3.0.12-1.1build2
The issue is reproducible without OWASP CRS, so CRS rules are unlikely to be the root cause.
- 主要言語
- C++
- スター
- 9.8k
- フォーク
- 1.8k
- 平均マージ
- 2時間 46分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
owasp-modsecurity/ModSecurity のほかの issue
-
2.x Platform - IIS
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
owasp-modsecurity/ModSecurity#3623 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
2.x Platform - IIS
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
owasp-modsecurity/ModSecurity#3621 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
2.x Platform - IIS
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
owasp-modsecurity/ModSecurity#3619 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
2.x Platform - IIS
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
owasp-modsecurity/ModSecurity#3612 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
3.x
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
owasp-modsecurity/ModSecurity#3580 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
owasp-modsecurity/ModSecurity の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
espressif/esp-matter#1867 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
cuAmpcorParameter.cpp (CPU pycuampcor) does not compile with libc++: EXIT_FAILURE is undeclaredオープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
isce-framework/isce3#387 ·
-
upstream update
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
conan-io/conan-center-index#31055 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信