Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-105242 Overview
CVE-2026-105242 is an Improper Handling of Exceptional Conditions vulnerability [CWE-755] in the %aspnet-request pattern converter of Apache log4net. The converter reads request parameters through HttpRequest.Params, which triggers ASP.NET request validation. A request carrying content such as HTML markup causes validation to throw, the layout to fail, and the appender to discard the entire log event. An attacker can suppress the log record of their own request by including rejected content. Only applications running on ASP.NET for .NET Framework whose layout uses %aspnet-request are affected.
Critical Impact
A remote sender can suppress logging of their own HTTP requests, undermining audit trails and complicating incident response for affected ASP.NET applications.
Affected Products
- Apache log4net from version 1.2.11 up to (but not including) 3.5.0
- ASP.NET applications on .NET Framework using the %aspnet-request layout converter
- Downstream applications and services bundling vulnerable log4net versions
Discovery Timeline
- 2026-10-06 - CVE-2026-105242 published to NVD
- 2026-10-07 - Last updated in NVD database
Technical Details for CVE-2026-105242
Vulnerability Analysis
The flaw lives in the AspNetRequestPatternConverter component of log4net. When the converter formats a log event, it accesses HttpRequest.Params to read query string, form, and cookie values. On first access, ASP.NET performs request validation to protect applications from potentially dangerous input such as <script> tags. When validation rejects the content, it throws a HttpRequestValidationException inside the layout. The exception propagates through the layout pipeline, the appender treats the event as unformattable, and the entire log record is dropped. The outcome is a logging gap controlled by the request sender.
Root Cause
The root cause is improper handling of exceptional conditions in the pattern converter. The code path assumes that reading HttpRequest.Params is safe, but ASP.NET request validation can raise an exception that the converter does not catch. Because the exception bubbles up to the appender layer, the appender treats the whole log event as invalid rather than degrading gracefully on the single problematic field.
Attack Vector
A remote unauthenticated attacker sends an HTTP request containing content that triggers ASP.NET request validation, such as markup in a query string, form field, or cookie. When the targeted application processes the request and attempts to log it through a layout using %aspnet-request, the appender discards the event. The attacker achieves no code execution and does not disclose data, but gains the ability to suppress audit records of their own activity, impairing integrity of the log trail.
// Security patch from src/changelog/3.5.0/316-aspnet-request-event-loss.xml
+<?xml version="1.0" encoding="UTF-8"?>
+<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="https://logging.apache.org/xml/ns"
+ xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
+ type="fixed">
+ <issue id="316" link="https://github.com/apache/logging-log4net/pull/316"/>
+ <description format="asciidoc">Stop `%aspnet-request` losing the whole event for a request that fails
+ ASP.NET request validation. Reading `HttpRequest.Params` validates the query string, form and
+ cookies on first access, so a request carrying `<script>` threw inside the layout and the
+ appender discarded the event: a sender could suppress the log record of their own request. The
+ converter now reads through `HttpRequest.Unvalidated`, which keeps the content instead of
+ dropping it (audit da18b6fd-f019, fixed by @FreeAndNil)</description>
+</entry>
Source: Apache log4net commit 1452034. The fix routes reads through HttpRequest.Unvalidated, bypassing ASP.NET request validation inside the converter and preserving the full event.
Detection Methods for CVE-2026-105242
Indicators of Compromise
- Unexplained gaps in web request logs where other telemetry (IIS logs, upstream proxies, WAF) shows traffic that never reached log4net output.
- Discrepancies between the number of HTTP requests recorded by the web server and the number of events written by log4net appenders.
- Correlated spikes in ASP.NET HttpRequestValidationException events in Windows Event Log or application traces that do not appear in log4net sinks.
Detection Strategies
- Inventory .NET Framework applications and identify any configuration (log4net.config, App.config, Web.config) that references the %aspnet-request conversion pattern.
- Cross-reference application logs against IIS W3C logs or load balancer access logs to find missing events, especially those originating from a single source IP.
- Query software bill of materials (SBOM) data for log4net versions between 1.2.11 and 3.4.x to scope exposure.
Monitoring Recommendations
- Instrument log4net appenders to emit internal error diagnostics (log4net.Internal.Debug) and alert on repeated layout exceptions.
- Forward IIS logs, WAF alerts, and application logs into a centralized data lake so coverage gaps become visible through correlation.
- Add alerting on sudden drops in log event volume per application, broken down by source IP and URL path.
How to Mitigate CVE-2026-105242
Immediate Actions Required
- Upgrade Apache log4net to version 3.5.0 or later across all affected .NET Framework applications.
- Audit log4net layout patterns in production configurations and flag every use of %aspnet-request until the upgrade completes.
- Preserve parallel logs (IIS, reverse proxy, WAF) that are not subject to the log4net event-loss path during the remediation window.
Patch Information
The Apache Logging Services project fixed the issue in log4net 3.5.0. The patch in AspNetRequestPatternConverter.cs switches the converter to read request data through HttpRequest.Unvalidated, which returns the raw content without triggering ASP.NET request validation. See GitHub Pull Request #316, the upstream commit 1452034, the Apache mailing list announcement, and the OpenWall OSS-Security discussion.
Workarounds
- Remove %aspnet-request from log4net layout patterns and substitute discrete converters that read specific, unvalidated fields.
- Add a secondary appender that logs minimal request metadata (remote IP, URL, status) through a layout that does not touch HttpRequest.Params, ensuring an audit record survives even if the primary appender drops the event.
- Where feasible, disable ASP.NET request validation for logging-only code paths while keeping it enforced for application input handling.
# Upgrade log4net to the fixed version using the .NET CLI
dotnet add package log4net --version 3.5.0
# Or with NuGet Package Manager for projects targeting .NET Framework
Install-Package log4net -Version 3.5.0
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

