CVE-2024-12798: Logback core QOS.CH Logback-core Expression Language Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-pr98-23f8-jwxv
CWE-917
Published
Advisory Summary

CVE-2024-12798 is a MODERATE qos.ch logback-core expression language injection vulnerability (CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')) affecting Logback core libraries in the Maven ecosystem. The issue involves qos.ch logback-core expression language injection vulnerability. Remediation is available by upgrading affected packages to version 1.5.13, 1.3.15.

CVE-2024-12798 at a Glance

CVE Identifier CVE-2024-12798
GHSA Identifier GHSA-pr98-23f8-jwxv
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')
Affected Product Logback core
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2024-12798

To remediate this vulnerability, upgrade all affected Logback core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ch.qos.logback:logback-core fixed: 1.5.13
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-core</artifactId>
    <version>1.5.13</version>
</dependency>
ch.qos.logback:logback-core fixed: 1.3.15
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-core</artifactId>
    <version>1.3.15</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=ch.qos.logback

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-12798, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=ch.qos.logback

Analyze the terminal output to locate any version of Logback core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.13), your application is affected.

Note: The mvn dependency:tree -Dincludes=ch.qos.logback command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection'), where the product constructs all or part of an expression language (el) statement in a framework such as a java server page (jsp) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended el statement before it is executed. In Logback core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

ACE vulnerability in JaninoEventEvaluator by QOS.CH logback-core up to and including version 1.5.12 in Java applications allows attackers to execute arbitrary code by compromising an existing logback configuration file or by injecting an environment variable before program execution. Malicious logback configuration files can allow the attacker to execute arbitrary code using the JaninoEventEvaluator extension. A successful attack requires the user to have write access to a configuration file. Alternatively, the attacker could inject a malicious environment variable pointing to a malicious configuration file. In both cases, the attack requires existing privilege.

CVE-2024-12798 Affected Logback core Versions

2 component(s)
Fixed Versions:
1.5.131.3.15
Product / Package Ecosystem Affected Versions Fixed Version
ch.qos.logback:logback-core
Maven
≥ 1.4.0
< 1.5.13
1.5.13
ch.qos.logback:logback-core
Maven
< 1.3.15
1.3.15

References

Frequently Asked Questions

What is CVE-2024-12798?
CVE-2024-12798 is a security vulnerability in Logback core involving QOS.CH logback-core Expression Language Injection vulnerability under CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection').
Which Logback core versions are affected?
Affected versions include releases prior to 1.5.13, 1.3.15 across affected packages: ch.qos.logback:logback-core.
What version fixes CVE-2024-12798?
Upgrading to 1.5.13, 1.3.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is logback-core affected?
Yes, ch.qos.logback:logback-core is affected in releases prior to 1.5.13, 1.3.15. Upgrade your dependency to 1.5.13, 1.3.15 or later.
What CWE is associated with CVE-2024-12798?
CVE-2024-12798 is classified under CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') (The product constructs all or part of an expression language (EL) statement in a framework such as a Java Server Page (JSP) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended EL statement before it is executed.).
How can I check Maven dependencies for CVE-2024-12798?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=ch.qos.logback'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pr98-23f8-jwxv",
  "modified" : "2025-01-03T19:05:25Z",
  "published" : "2024-12-19T18:31:37Z",
  "aliases" : [ "CVE-2024-12798" ],
  "summary" : "QOS.CH logback-core Expression Language Injection vulnerability",
  "details" : "ACE vulnerability in JaninoEventEvaluator by QOS.CH logback-core up to and including version 1.5.12 in Java applications allows attackers to execute arbitrary code by compromising an existing logback configuration file or by injecting an environment variable before program execution.\n\nMalicious logback configuration files can allow the attacker to execute arbitrary code using the JaninoEventEvaluator extension.\n\nA successful attack requires the user to have write access to a configuration file. Alternatively, the attacker could inject a malicious environment variable pointing to a malicious configuration file. In both cases, the attack requires existing privilege.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:L/SI:H/SA:L/RE:L/U:Clear"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ch.qos.logback:logback-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.0"
      }, {
        "fixed" : "1.5.13"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ch.qos.logback:logback-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.15"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-12798"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/qos-ch/logback/commit/2cb6d520df7592ef1c3a198f1b5df3c10c93e183"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/qos-ch/logback"
  }, {
    "type" : "WEB",
    "url" : "https://logback.qos.ch/news.html#1.3.15"
  }, {
    "type" : "WEB",
    "url" : "https://logback.qos.ch/news.html#1.5.13"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-917" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-19T22:22:09Z",
    "nvd_published_at" : "2024-12-19T16:15:07Z"
  }
}