CVE-2022-4065 cbeust testng XML File Parser JarFileUtils.java testngXmlExistsInJar path traversal
A path traversal vulnerability in TestNG allows remote attackers to read arbitrary files via crafted JAR files.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-4065?
CVE-2022-4065 is a medium-severity path traversal vulnerability in cbeust testng, published on 19 Nov 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
A vulnerability was found in cbeust testng 7.5.0/7.6.0/7.6.1/7.7.0. It has been declared as critical. Affected by this vulnerability is the function testngXmlExistsInJar of the file testng-core/src/main/java/org/testng/JarFileUtils.java of the component XML File Parser. The manipulation leads to path traversal. The attack can be launched remotely. Upgrading to version 7.5.1 and 7.7.1 is able to address this issue. The patch is named 9150736cd2c123a6a3b60e6193630859f9f0422b. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-214027.
Weakness: CWE-22
Which versions are affected by CVE-2022-4065?
4 open source packages ship an affected version, including org.testng:testng. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.testng:testng Maven | From 6.13 | 7.5.1 |
org.testng:testng Maven | From 6.13 | 7.5.1 |
org.testng:testng Maven | From 7.6.0 | 7.7.0 |
org.testng:testng Maven | From 7.6.0 | 7.7.0 |
Linux distribution packages (36)
testng SUSE:Enterprise Storage 7 | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Enterprise Storage 7.1 | All versions | 2.2-150200.3.15.1 |
testng SUSE:Enterprise Storage 7.1 | All versions | 7.10.1-150200.3.10.1 |
testng SUSE:Enterprise Storage 7.1 | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 7.10.1-150200.3.10.1 |
testng SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 7.4.0-150200.3.7.1 |
testng SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 7.10.1-150200.3.10.1 |
testng SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 7.10.1-150200.3.10.1 |
snakeyaml SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 7.10.1-150200.3.10.1 |
testng SUSE:Linux Enterprise Module for Development Tools 15 SP4 | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Linux Enterprise Module for Development Tools 15 SP5 | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise Module for Development Tools 15 SP5 | All versions | 7.10.1-150200.3.10.1 |
snakeyaml SUSE:Linux Enterprise Module for Development Tools 15 SP6 | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise Module for Development Tools 15 SP6 | All versions | 7.10.1-150200.3.10.1 |
mockito SUSE:Linux Enterprise Module for Package Hub 15 SP6 | All versions | 5.11.0-150200.3.7.1 |
testng SUSE:Linux Enterprise Real Time 15 SP3 | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 7.10.1-150200.3.10.1 |
testng SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 7.10.1-150200.3.10.1 |
testng SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 7.10.1-150200.3.10.1 |
snakeyaml SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 7.10.1-150200.3.10.1 |
testng SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 7.4.0-150200.3.7.1 |
snakeyaml SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 2.2-150200.3.15.1 |
testng SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 7.10.1-150200.3.10.1 |
testng SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 7.4.0-150200.3.7.1 |
Products include Testng Project Testng.
How do I fix CVE-2022-4065?
Upgrade org.testng:testng to a fixed version for your release line: 7.5.1 or 7.7.0.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2022-4065 being exploited?
There is no known exploitation of CVE-2022-4065 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Sources
Also known as GHSA-rc2q-x9mf-w3vf, MGASA-2023-0220, OESA-2024-1072, SUSE-SU-2023:1690-1, SUSE-SU-2024:2568-1, UBUNTU-CVE-2022-4065 and 1 more.