CVE-2023-40828: Pf4j Remote Code Execution Vulnerability
HIGHCVE-2023-40828 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Pf4j libraries in the Maven ecosystem. The issue involves pf4j vulnerable to remote code execution via expandifzip method in the extract function. Remediation is available in the latest vendor maintenance releases.
CVE-2023-40828 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2023-40828
To remediate this vulnerability, upgrade all affected Pf4j 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>org.pf4j</groupId>
<artifactId>pf4j</artifactId>
<version>Latest secure release</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.pf4j
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2023-40828, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.pf4j
Analyze the terminal output to locate any version of Pf4j in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.pf4j 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Pf4j, 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-2023-40828 Affected Pf4j Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.pf4j:pf4j
|
Maven |
≤ 3.9.0
|
|
References
Frequently Asked Questions
What is CVE-2023-40828?
Which Pf4j versions are affected?
What version fixes CVE-2023-40828?
Is pf4j affected?
What is the CVSS score of CVE-2023-40828?
What CWE is associated with CVE-2023-40828?
How can I check Maven dependencies for CVE-2023-40828?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cj8w-v588-p8wx",
"modified" : "2023-08-31T14:49:19Z",
"published" : "2023-08-29T00:32:04Z",
"aliases" : [ "CVE-2023-40828" ],
"summary" : "pf4j vulnerable to remote code execution via expandIfZip method in the extract function",
"details" : "An issue in pf4j pf4j v.3.9.0 and before allows a remote attacker to obtain sensitive information and execute arbitrary code via the expandIfZip method in the extract function.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.pf4j:pf4j"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "3.9.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-40828"
}, {
"type" : "WEB",
"url" : "https://github.com/pf4j/pf4j/pull/537"
}, {
"type" : "WEB",
"url" : "https://github.com/pf4j/pf4j/pull/538"
}, {
"type" : "WEB",
"url" : "https://github.com/pf4j/pf4j/commit/8e0aa198c4e652cfc1eb9e05ca9b64397f67cc72"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pf4j/pf4j"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22", "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-29T17:40:51Z",
"nvd_published_at" : "2023-08-28T22:15:09Z"
}
}