cbeust testng XML File Parser JarFileUtils.java testngXmlExistsInJar path traversal
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Path traversal vulnerability in TestNG's XML parser allows remote attackers to read arbitrary files.
Root
Cause The vulnerability resides in the function testngXmlExistsInJar in testng-core/src/main/java/org/testng/JarFileUtils.java. The function does not properly sanitize file paths, allowing an attacker to traverse directories and access files outside the intended scope [1]. This is a classic path traversal flaw.
Exploitation
An attacker can exploit this vulnerability remotely by supplying a crafted XML file that triggers the vulnerable code path. No authentication is required, making the attack surface broad [1]. The specific attack vector involves manipulating the input to testngXmlExistsInJar, which is part of the XML file parsing component [1].
Impact
Successful exploitation allows an attacker to read arbitrary files on the system, potentially leading to disclosure of sensitive information such as configuration files, source code, or credentials [1]. The vulnerability is rated as critical with a CVSS score indicating high severity.
Mitigation
The vulnerability has been patched in TestNG versions 7.5.1 and 7.7.1 [3][4]. Users are strongly recommended to upgrade to these versions or later. The patch commit is 9150736cd2c123a6a3b60e6193630859f9f0422b [1].
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.testng:testngMaven | >= 6.13, < 7.5.1 | 7.5.1 |
org.testng:testngMaven | >= 7.6.0, < 7.7.0 | 7.7.0 |
Affected products
42- ghsa-coords40 versionspkg:maven/org.testng/testngpkg:rpm/opensuse/mockito&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/mockito&distro=openSUSE%20Leap%2015.6pkg:rpm/opensuse/snakeyaml&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/snakeyaml&distro=openSUSE%20Leap%2015.6pkg:rpm/opensuse/testng&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/testng&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/testng&distro=openSUSE%20Leap%2015.6pkg:rpm/suse/mockito&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP6pkg:rpm/suse/snakeyaml&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-ESPOSpkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-LTSSpkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP5pkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP6pkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP4-LTSSpkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/snakeyaml&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP4pkg:rpm/suse/snakeyaml&distro=SUSE%20Manager%20Server%20Module%204.3pkg:rpm/suse/testng&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/testng&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-ESPOSpkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-LTSSpkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP4pkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP5pkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP6pkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3pkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP4-LTSSpkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/testng&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP4
>= 6.13, < 7.5.1+ 39 more
- (no CPE)range: >= 6.13, < 7.5.1
- (no CPE)range: < 5.11.0-150200.3.7.1
- (no CPE)range: < 5.11.0-150200.3.7.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.10.1-150200.3.10.1
- (no CPE)range: < 7.10.1-150200.3.10.1
- (no CPE)range: < 5.11.0-150200.3.7.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 2.2-150200.3.15.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.10.1-150200.3.10.1
- (no CPE)range: < 7.10.1-150200.3.10.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.10.1-150200.3.10.1
- (no CPE)range: < 7.10.1-150200.3.10.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.10.1-150200.3.10.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.4.0-150200.3.7.1
- (no CPE)range: < 7.10.1-150200.3.10.1
- cbeust/testngv5Range: 7.5.0
Patches
19150736cd2c1Merge pull request #2806 from BulkSecurityGeneratorProjectV2/fix/JLL/zip-slip-vulnerability
1 file changed · +3 −0
testng-core/src/main/java/org/testng/JarFileUtils.java+3 −0 modified@@ -76,6 +76,9 @@ private boolean testngXmlExistsInJar(File jarFile, List<String> classes) throws if (Parser.canParse(jeName.toLowerCase())) { InputStream inputStream = jf.getInputStream(je); File copyFile = new File(file, jeName); + if (!copyFile.toPath().normalize().startsWith(file.toPath().normalize())) { + throw new IOException("Bad zip entry"); + } copyFile.getParentFile().mkdirs(); Files.copy(inputStream, copyFile.toPath()); if (matchesXmlPathInJar(je)) {
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
11- github.com/cbeust/testng/commit/9150736cd2c123a6a3b60e6193630859f9f0422bghsapatchWEB
- github.com/cbeust/testng/releases/tag/7.7.1ghsapatchWEB
- github.com/advisories/GHSA-rc2q-x9mf-w3vfghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-4065ghsaADVISORY
- github.com/cbeust/testng/pull/1596ghsaWEB
- github.com/cbeust/testng/pull/2806ghsaissue-trackingWEB
- github.com/cbeust/testng/releases/tag/7.7.0ghsaWEB
- github.com/testng-team/testng/pull/2899ghsaWEB
- github.com/testng-team/testng/releases/tag/7.5.1ghsaWEB
- vuldb.comghsasignaturepermissions-requiredWEB
- vuldb.comghsavdb-entrytechnical-descriptionWEB
News mentions
0No linked articles in our index yet.