Security update: mod_security_crs v4.25.2 RPM and DEB packages released

mod_security_crs v4.25.2 has been added to the CodeIT repository. mod_security_crs is the OWASP CRS rule set for ModSecurity. The packages are built for RHEL, CentOS, AlmaLinux, Rocky Linux and Oracle Linux 8 and 9, and for Ubuntu 22.04 and 24.04.

This update fixes security vulnerabilities. Upgrading is recommended.

Major changes:

  • Backport false positive fix for the `vega` scanner user agent substring matching `veganism.social` (rule 913100) (Esad Cetiner, cherry-pick of #4777)
  • Backport fix so `tx.crs_skip_response_analysis` also skips the phase 4 response body rules; previously only the phase 3 header rules were skipped (new rule 950022) (Jozef Sudolský, cherry-pick of #4807)
  • Backport allowing and JSON-parsing `application/*+json` content types (including subtypes that contain a `+`, such as `application/vc+ld+json`) and the AWS `application/x-amz-json-1.0`/`1.1` content types by default, so these JSON request bodies are no longer blocked by the content-type allow-list or left uninspected (new rules 901360, 901370) (Felipe Zipitría, cherry-pick of #4775 and #4828)

Fixed vulnerabilities:

  • Backport fix for [GHSA-575j-qr6p-9763] via adding `REQUEST_FILENAME` to the targets of the RCE rules, so command injection payloads placed in the URL path are inspected like those in `ARGS` (rules 932125-932390, except 932200, where every URL path contains the `/` it requires) (Max Leske)
  • Backport fix for [GHSA-89h9-2j8h-9gp2] via lowercasing the `charset` parameter name before matching, so an uppercase or mixed-case `CHARSET=` in `Content-Type` can no longer skip the charset allow-list check (rule 920480) (Felipe Zipitría)
  • Backport fix for [GHSA-qmx4-jfcv-fgww] via collecting every `_charset_` value so a second multipart part or a query-string `_charset_` can no longer shadow a disallowed charset (rule 922100) (Ervin Hegedüs)
  • Backport fix removing a bypassable length bound in the SQL `(X)OR` injection detection (rule 942390) (Felipe Zipitría, cherry-pick of #4713)
  • Backport fix for [V29-260924] via tolerating trailing slashes as well as dots after the extension, so a PHP or JSP upload filename ending in `/` can no longer bypass the upload extension checks (rules 933110, 944140) (Felipe Zipitría, cherry-pick of #4815)
  • Formalize rule 932171 (Shellshock, CVE-2014-6271) into a `regex-assembly` file and apply the standard `[sx0b]` whitespace-class normalization; the `json.` ARGS_NAMES prefix detection itself was already present on this branch via an untracked fix, so this is a maintainability/consistency change, not a functional fix (partial cherry-pick of #4703)

How to install CRS 4 (CodeIT-CRS repository)

CRS 4 (mod_security_crs for rpm, modsecurity-crs for deb) is not in the main CodeIT channel, so a routine dnf or apt upgrade never replaces the CRS 3.3 of your distribution. It is in a separate repository, CodeIT-CRS. Version 2.1 or newer of codeit-repo-release installs this repository, disabled by default. ModSecurity itself (mod_security, libapache2-mod-security2) is in the main channel, and CRS 4 needs it. CRS 4 is not a drop-in replacement for CRS 3.3 (new crs-setup.conf, plugins), so review a CRS 3 setup before you switch.

RHEL, AlmaLinux, Rocky Linux and Oracle Linux 8 and 9 (CRS has no EL7 or EL10 build yet)

sudo dnf upgrade -y codeit-repo-release
sudo dnf --enablerepo=CodeIT-CRS install -y mod_security_crs

To keep CRS 4 updated with every dnf upgrade, enable the repository (needs dnf-plugins-core):

sudo dnf config-manager --set-enabled CodeIT-CRS

Ubuntu 20.04, 22.04, 24.04 and Debian 11, 12 (Ubuntu 20.04 and Debian 11 are donor releases; the same steps apply)

sudo apt-get update && sudo apt-get install -y codeit-repo-release

Then, in /etc/apt/sources.list.d/codeit.sources, set Enabled: yes in the stanza with Components: crs:

sudo sed -i '/^Components: crs/,/^$/ s/^Enabled: no/Enabled: yes/' /etc/apt/sources.list.d/codeit.sources

Then update the package index and install CRS 4:

sudo apt-get update && sudo apt-get install -y modsecurity-crs

Install or upgrade:

  • EL8/EL9: dnf --enablerepo=CodeIT-CRS install mod_security_crs

Connect the CodeIT repository first: https://codeit.guru/codeit-repository-setup/

Package files in the repository:

EL8

# noarch
mod_security_crs-4.25.2-1.codeit.el8.noarch.rpm
# SRPM
mod_security_crs-4.25.2-1.codeit.el8.src.rpm

EL9

# noarch
mod_security_crs-4.25.2-1.codeit.el9.noarch.rpm
# SRPM
mod_security_crs-4.25.2-1.codeit.el9.src.rpm

Ubuntu 20.04

# all
modsecurity-crs_4.25.2-1+codeit.ubuntu20.04_all.deb

Ubuntu 22.04

# all
modsecurity-crs_4.25.2-1+codeit.ubuntu22.04_all.deb

Ubuntu 24.04

# all
modsecurity-crs_4.25.2-1+codeit.ubuntu24.04_all.deb

Debian 11

# all
modsecurity-crs_4.25.2-1+codeit.deb11_all.deb

Debian 12

# all
modsecurity-crs_4.25.2-1+codeit.deb12_all.deb

Leave a Reply

Your email address will not be published. Required fields are marked *