CVE-2026-104721

Path Traversal
Affects
Logback
in
Logback
No items found.
Versions
>=0.9.14 <=1.6.4

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Logback is an open-source Java logging framework designed as a successor to Log4j. Its core module provides logging infrastructure, logback-classic implements the SLF4J API, and logback-access supplies HTTP access logging for servlet containers.

A path traversal vulnerability (CVE-2026-104721) has been identified in the MDCBasedDiscriminator used by Logback's SiftingAppender, which allows attackers who can influence an MDC value (for example, through an HTTP header) to create and append to log files outside the intended directory.

Per OWASP: A path traversal attack (also known as directory traversal) aims to access files and directories that are stored outside the web root folder.

This issue affects multiple versions of Logback.

Details

Module Info

Vulnerability Info

This Medium-severity vulnerability is found in the ch.qos.logback:logback-classic package in multiple versions of Logback. SiftingAppender builds a separate nested appender for each distinct discriminating value, and the configuration of that nested appender refers to the value by its key, for example <file>${userid}.log</file> inside a FileAppender. The default discriminator, MDCBasedDiscriminator, reads the configured key from the event's MDC and returns the value as it is:

public String getDiscriminatingValue(ILoggingEvent event) {
    Map<String, String> mdcMap = event.getMDCPropertyMap();
    if (mdcMap == null) {
        return defaultValue;
    }
    String mdcValue = mdcMap.get(key);
    if (mdcValue == null) {
        return defaultValue;
    } else {
        return mdcValue;
    }
}

Applications commonly fill the MDC from request data such as a user name, tenant ID or HTTP header. When an attacker controls that data, the returned string is placed directly into the nested appender's file path. Path separators, .. sequences and other characters that have meaning in the nested configuration, such as variable substitution expressions, therefore reach the file name unchecked. The nested FileAppender then creates and appends to a file at a location of the attacker's choosing, outside the directory the configuration intended. Removing only the forward and backward slashes from the value does not fully close this path, because other values can still alter the resulting file name. The issue can only be exploited when SiftingAppender is active with an MDC key whose value an attacker can influence.

Mitigation

Logback 1.2.x is End-of-Life and will not receive any updates to address this issue. For more information, see here.

Users of the affected components should apply one of the following mitigations:

  • Upgrade affected applications to a currently supported version of Logback.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support.

Credits

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Medium
ID
CVE-2026-104721
PROJECT Affected
Logback
Versions Affected
>=0.9.14 <=1.6.4
NES Versions Affected
Published date
October 13, 2026
≈ Fix date
October 13, 2026
Category
Path Traversal
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Logback
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.