Critical Vulnerability in Apache2 Package: Improper Output Escaping in mod_rewrite

apache2 Updated 03 Oct 2025

Summary

01/07/2024
N/A
Yes i
Critical
9.1

UBUNTU-CVE-2024-38475: Improper escaping of output in mod_rewrite in Apache HTTP Server 2.4.59 and earlier allows an attacker to map URLs to filesystem locations that are permitted to be served by the server but are not intentionally/directly... Affects apache2 versions < 2.4.7-1ubuntu4.22+esm10. Fixed in 2.4.7-1ubuntu4.22+esm10. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Apache2 is a widely used open-source web server software that enables the hosting of websites and applications. It is known for its flexibility, power, and extensive features, including support for various programming languages and modules. However, Apache2 has been found to have a critical vulnerability in its mod_rewrite module, which can lead to severe security risks if not addressed promptly.

Vulnerability Detail

The vulnerability, identified as CVE-2024-38475, arises from improper escaping of output in the mod_rewrite module of Apache HTTP Server versions 2.4.59 and earlier. This flaw allows attackers to map URLs to filesystem locations that should not be accessible, potentially leading to code execution or unauthorized disclosure of source code. The issue is particularly concerning as it affects substitutions in server contexts that utilize backreferences or variables as the first segment of the substitution. The severity of this vulnerability is underscored by its CVSS score of 9.1, indicating a high risk to affected systems.

How To Fix

Minimum fixed version

2.4.7-1ubuntu4.22+esm10

This is the first release that contains the fix.

sudo apt-get install --only-upgrade apache2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can utilize the rewrite flag 'UnsafePrefixStat' to opt back into unsafe RewriteRules. However, this should only be done after ensuring that the substitutions are appropriately constrained to mitigate potential risks.

Conclusion

The CVE-2024-38475 vulnerability in Apache2's mod_rewrite module poses a critical risk to web servers. It is crucial for users to update their Apache2 installations to the latest patched versions to protect against potential exploitation. Additionally, utilizing tools like Vulert can help monitor and alert for open-source vulnerabilities in real-time.

See every vulnerability recorded for apache2 →

Share this vulnerability

FAQ

CVE-2024-38475 is a critical vulnerability in the Apache2 web server's mod_rewrite module that allows attackers to access restricted filesystem locations.

The vulnerability can lead to code execution or unauthorized disclosure of sensitive source code, posing significant security risks to affected systems.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

The CVSS score of CVE-2024-38475 is 9.1, indicating a high severity level.

Yes, a patched version of Apache2 is available. Users should update to version 2.4.62-1ubuntu1 or later to mitigate the vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for apache2.

How To Fix

Minimum fixed version

2.4.7-1ubuntu4.22+esm10

This is the first release that contains the fix.

sudo apt-get install --only-upgrade apache2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback