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-104721 Overview
CVE-2026-104721 is a path-traversal vulnerability [CWE-22] in QOS.CH Sarl Logback-classic, the widely deployed Java logging framework. The flaw affects the logback-classic module when a Mapped Diagnostic Context (MDC) based discriminator value flows unsanitized into a nested FileAppender path. An attacker able to influence that MDC value, for example through an HTTP header, can create and append log files outside the intended directory. The issue affects Logback-classic versions 0.9.14 through 1.6.4 and is related to CVE-2026-19880 but relies on a different attack technique.
Critical Impact
Attackers who control an MDC input can write arbitrary files on the host within the privileges of the Java process, enabling log tampering, configuration overwrite, or persistence.
Affected Products
- QOS.CH Sarl Logback-classic 0.9.14 through 1.6.4
- Java applications using SiftingAppender with MDC-based discriminators feeding nested FileAppender paths
- Downstream frameworks and services that embed vulnerable Logback-classic releases
Discovery Timeline
- 2026-10-02 - CVE-2026-104721 published to the National Vulnerability Database
- 2026-10-02 - Last updated in NVD database
Technical Details for CVE-2026-104721
Vulnerability Analysis
Logback-classic allows applications to route log output dynamically using a SiftingAppender. The appender selects a nested FileAppender based on a discriminator value, often sourced from the MDC. When the discriminator value is interpolated into the nested appender's file path without sanitization, path separators and traversal sequences such as ../ are honored by the file system APIs.
An attacker who can set the MDC key, for instance by sending a crafted HTTP header that a servlet filter copies into the MDC, controls the resulting log file path. The Java process then opens or creates a file at the attacker-chosen location and appends log data to it.
The behavior is remotely reachable in typical web deployments and does not require authentication when the MDC population logic executes before authorization checks.
Root Cause
The root cause is missing input validation on MDC-derived discriminator values before they are concatenated into nested FileAppender file paths. Logback-classic treats the discriminator as a trusted token rather than untrusted input, violating the principle enforced by CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
Attack Vector
Exploitation requires the target application to populate the MDC with attacker-influenced data and to use a SiftingAppender whose nested FileAppender path references that MDC key. A request header value such as ../../etc/cron.d/payload would cause Logback-classic to open that path for appending. The attacker then triggers log events to write chosen content into the file. Resulting primitives include overwriting configuration, poisoning log analysis pipelines, and in some environments achieving code execution by writing to script or scheduler directories.
No public proof-of-concept exploit is referenced in the advisory. See the Logback Release Notes 1.6.5 for vendor technical detail.
Detection Methods for CVE-2026-104721
Indicators of Compromise
- Log files created outside the application's configured log directory, especially under system paths such as /etc, /var/spool/cron, or user home directories
- HTTP request headers containing path separators or traversal sequences (../, ..\, /, \) that correlate with MDC-populated fields
- Unexpected FileAppender initialization entries in Logback internal status output referencing non-standard paths
Detection Strategies
- Inventory Java applications and resolve the transitive version of ch.qos.logback:logback-classic using build tooling such as mvn dependency:tree or gradle dependencies
- Audit Logback configuration files (logback.xml, logback-spring.xml) for SiftingAppender elements whose nested file attribute references ${mdc.*} or discriminator keys sourced from request data
- Review web filters and interceptors that call MDC.put(...) with values derived from headers, query parameters, or cookies
Monitoring Recommendations
- Alert on file-creation events by Java process identifiers writing outside allow-listed log directories
- Forward Logback status listener output to centralized logging and alert on appender target paths containing .. sequences
- Correlate web access logs with filesystem telemetry to identify header values preceding anomalous file writes
How to Mitigate CVE-2026-104721
Immediate Actions Required
- Upgrade logback-classic to version 1.6.5 or later across all Java services and container images
- Identify and remediate configurations where MDC values populated from untrusted input feed nested FileAppender paths
- Restrict filesystem permissions of the Java runtime user so log directories are the only writable locations
Patch Information
QOS.CH addressed the vulnerability in Logback 1.6.5. Refer to the Logback Release Notes 1.6.5 for the authoritative changelog and upgrade guidance. Rebuild and redeploy all services after updating the dependency, since Logback is loaded at JVM startup.
Workarounds
- Remove or refactor SiftingAppender configurations so the nested file path does not interpolate MDC values directly
- Sanitize MDC inputs in a servlet filter by stripping path separators and traversal sequences before calling MDC.put
- Enforce an allow-list of permitted discriminator values and reject requests supplying anything outside that set
# Maven dependency pin example
mvn versions:use-dep-version -Dincludes=ch.qos.logback:logback-classic -DdepVersion=1.6.5 -DforceVersion=true
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

