CVE-2024-12798: Logback core QOS.CH Logback-core Expression Language Injection Vulnerability
MODERATECVE-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
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.
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.5.13</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.3.15</version>
</dependency>
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
CVE-2024-12798 Affected Logback core Versions
2 component(s)| 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?
Which Logback core versions are affected?
What version fixes CVE-2024-12798?
Is logback-core affected?
What CWE is associated with CVE-2024-12798?
How can I check Maven dependencies for CVE-2024-12798?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}