Every CVE Search/ Get API key

CVE-2022-4065

cbeust testng XML File Parser JarFileUtils.java testngXmlExistsInJar path traversal

5.5 MediumPublic exploitFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
Low
User interaction
Required

What an attacker can affect

Confidentiality
Low
Integrity
Low
Availability
Low

Exploit likelihood

0.97%Up 0.1 points since Nov 20, 2022
90%50%10%1%

What each source reports

CVE List Score used 5.5

cbeust testng XML File Parser JarFileUtils.java testngXmlExistsInJar path traversal

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.

Record
CVE-2022-4065
CVSS 3.1
5.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
CVSS 3.0
5.5 MediumCVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
CVSS 2.0
6.5 AV:N/AC:L/Au:S/C:P/I:P/A:P
Weakness
CWE-22
Updated
2026-11-02
EUVDEUVD-2022-7421 5.5

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.

Record
EUVD-2022-7421
CVSS 3.1
5.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
Updated
2026-11-03
GitHub AdvisoriesGHSA-rc2q-x9mf-w3vf 7.8

TestNG is vulnerable to Path Traversal

Impact

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 only for .xml, .yaml and .yml files by default. The attack implies running an unsafe test JAR. However since that JAR can also contain executable code itself, the path traversal is unlikely to be the main attack.

Patches

A patch is available in version 7.7.0 at commit 9150736cd2c123a6a3b60e6193630859f9f0422b. It is recommended to apply a patch to fix this issue. The patch was pushed into the master branch but no releases have yet been made with the patch included.

A backport of the fix is available in [version 7.5.1]((https://github.com/cbeust/testng/releases/tag/7.5.1) for Java 8 projects.

Workaround

  • Specify which tests to run when invoking TestNG by configuring them on the CLI or in the build tool controlling the run.
  • Do not run tests with untrusted JARs on the classpath, this includes pull requests on open source projects.
Record
GHSA-rc2q-x9mf-w3vf
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-22
Updated
2026-11-02
NVD 5.5

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.

Record
CVE-2022-4065
CVSS 3.1
5.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CVSS 2.0
6.5 MediumAV:N/AC:L/Au:S/C:P/I:P/A:P
Weakness
CWE-22
Updated
2026-11-02
OSV 5.5

cbeust testng XML File Parser JarFileUtils.java testngXmlExistsInJar path traversal

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.

Record
CVE-2022-4065
CVSS 3.1
5.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
Weakness
CWE-22
Updated
2026-11-02
OSVGHSA-rc2q-x9mf-w3vf 7.8

TestNG is vulnerable to Path Traversal

Impact

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 only for .xml, .yaml and .yml files by default. The attack implies running an unsafe test JAR. However since that JAR can also contain executable code itself, the path traversal is unlikely to be the main attack.

Patches

A patch is available in version 7.7.0 at commit 9150736cd2c123a6a3b60e6193630859f9f0422b. It is recommended to apply a patch to fix this issue. The patch was pushed into the master branch but no releases have yet been made with the patch included.

A backport of the fix is available in [version 7.5.1]((https://github.com/cbeust/testng/releases/tag/7.5.1) for Java 8 projects.

Workaround

  • Specify which tests to run when invoking TestNG by configuring them on the CLI or in the build tool controlling the run.
  • Do not run tests with untrusted JARs on the classpath, this includes pull requests on open source projects.
Record
GHSA-rc2q-x9mf-w3vf
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-22
Updated
2026-11-02
Show 6 moreShow less
OSVOESA-2024-1072 7.8

testng security update

TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionality that make it more powerful and easier to use, such as: * Annotations. * Run your tests in arbitrarily big thread pools with various policies available (all methods in their own thread, one thread per test class, etc...). * Test that your code is multithread safe. * Flexible test configuration. * Support for data-driven testing (with @DataProvider). * Support for parameters. * Powerful execution model (no more TestSuite). * Supported by a variety of tools and plug-ins (Eclipse, IDEA, Maven, etc...). * Embeds BeanShell for further flexibility. * Default JDK functions for runtime and logging (no dependencies). * Dependent methods for application server testing.

Security Fix(es):

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.(CVE-2022-4065)

Record
OESA-2024-1072
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2022-4065 5.5

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.

Record
UBUNTU-CVE-2022-4065
CVSS 3.1
5.5 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVMGASA-2023-0220 No score

Updated testng packages fix security vulnerability

Path traversal in zip files (CVE-2022-4065)

Record
MGASA-2023-0220
Updated
2026-11-02
OSVopenSUSE-SU-2024:12533-1 No score

testng-7.4.0-3.1 on GA media

These are all security issues fixed in the testng-7.4.0-3.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:12533-1
Updated
2026-11-02
OSVSUSE-SU-2023:1690-1 No score

Security update for testng

This update for testng fixes the following issues:

  • CVE-2022-4065: Fixed a path traversal in zip files (bsc#1205628).
Record
SUSE-SU-2023:1690-1
Updated
2026-11-02
OSVSUSE-SU-2024:2568-1 No score

Security update for mockito, snakeyaml, testng

This update for mockito, snakeyaml, testng fixes the following issues:

mockito was updated to version 5.11.0:

  • Added bundle manifest to the mockito-core artifact

  • Mockito 5 is making core changes to ensure compatibility with future JDK versions.

  • Switch the Default MockMaker to mockito-inline (not applicable to mockito-android)

    • Mockito 2.7.6 introduced the mockito-inline mockmaker based on the 'inline bytecode' principle, offering compatibility advantages over the subclass mockmaker
    • This change avoids JDK restrictions, such as violating module boundaries and leaking subclass creation
  • Legitimate use cases for the subclass mockmaker:

    • Scenarios where the inline mockmaker does not function, such as on Graal VM's native image
    • If avoiding mocking final classes, the subclass mockmaker remains a viable option, although issues may arise on JDK 17+
    • Mockito aims to support both mockmakers, allowing users to choose based on their requirements.
  • Update the Minimum Supported Java Version to 11

    • Mockito 5 raised the minimum supported Java version to 11
    • Community member @reta contributed to this change.
    • Users still on JDK 8 can continue using Mockito 4, with minimal API differences between versions
  • New type() Method on ArgumentMatcher

    • The ArgumentMatcher interface now includes a new type() method to support varargs methods, addressing previous limitations
    • Users can now differentiate between matching calls with any exact number of arguments or match any number of arguments
    • Mockito 5 provides a default implementation of the new method, ensuring backward compatibility.
    • No obligation for users to implement the new method; Mockito 5 considers Void.type by default for varargs handling
    • ArgumentCaptor is now fully type-aware, enabling capturing specific subclasses on a generic method.
  • byte-buddy does not bundle asm, but uses objectweb-asm as external library

snake-yaml was updated to version 2.2:

  • Changes of version 2.2:

    • Define default scalar style as PLAIN (for polyglot Maven)
    • Add missing 'exports org.yaml.snakeyaml.inspector' to module-info.java
  • Changes of version 2.1:

    • Heavy Allocation in Emitter.analyzeScalar(String) due to Regex Overhead
    • Use identity in toString() for sequences to avoid OutOfMemoryError
    • NumberFormatException from SnakeYAML due to int overflow for corrupt YAML version
    • Document size limit should be applied to single document notthe whole input stream
    • Detect invalid Unicode code point (thanks to Tatu Saloranta)
    • Remove Trusted*Inspector classes from main sources tree
  • Changes of version 2.0:

    • Rollback to Java 7 target
    • Add module-info.java
    • Migrate to Java 8
    • Remove many deprecated constructors
    • Remove long deprecated methods in FlowStyle
    • Do not allow global tags by default
    • Yaml.LoadAs() signature to support Class<? super T> type instead of Class<T>
    • CustomClassLoaderConstructor takes LoaderOptions
    • Check input parameters for non-null values

testng was updated to version 7.10.1:

  • Security issues fixed:

    • CVE-2022-4065: Fixed Zip Slip Vulnerability (bsc#1205628)
  • Changes of version 7.10.1:

    • Fixed maven build with junit5
  • Changes of version 7.10.0:

    • Minor discrepancy fixes
    • Deleting TestNG eclipse plugin specific classes
    • Remove deprecated JUnit related support in TestNG
    • Handle exceptions in emailable Reporter
    • Added wrapperbot and update workflow order
    • Support ITestNGFactory customisation
    • Streamlined data provider listener invocation
    • Streamlined Guice Module creation in concurrency.
    • Copy test result attributes when unexpected failures
    • chore: use explicit dependency versions instead of refreshVersions
    • Removed Ant
    • Support ordering of listeners
    • Added errorprone
    • Allow custom thread pool executors to be wired in.
    • Allow data providers to be non cacheable
    • Use Locks instead of synchronised keyword
    • Document…
Record
SUSE-SU-2024:2568-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
org.testng:testng
Maven
6.13 up to 7.5.1
7.5.1
org.testng:testng
Maven
7.6.0 up to 7.7.0
7.7.0
org.testng:testng
Maven
6.13 up to 7.5.1, plus listed versions
6.13.16.14.26.14.37.0.07.0.0-beta1
Show 8 moreShow less
7.0.0-beta27.0.0-beta37.0.0-beta47.0.0-beta77.1.07.3.07.4.07.5
7.5.1
org.testng:testng
Maven
7.6.0 up to 7.7.0, plus listed versions
7.6.1
7.7.0
testng
Mageia:8
before 6.14.3-4.1.mga8
6.14.3-4.1.mga8
testng
openEuler:20.03-LTS-SP1
before 6.14.3-7.oe1
6.14.3-7.oe1
testng
openEuler:20.03-LTS-SP4
before 6.14.3-7.oe2003sp4
6.14.3-7.oe2003sp4
testng
openEuler:22.03-LTS
before 6.14.3-7.oe2203sp3
6.14.3-7.oe2203sp3
testng
openEuler:22.03-LTS-SP1
before 6.14.3-7.oe2203sp1
6.14.3-7.oe2203sp1
testng
openEuler:22.03-LTS-SP2
before 6.14.3-7.oe2203sp2
6.14.3-7.oe2203sp2
Show 56 moreShow less
Affected packages
PackageAffectedFixed
testng
openEuler:22.03-LTS-SP3
before 6.14.3-7.oe2203sp3
6.14.3-7.oe2203sp3
testng
SUSE:Linux Enterprise Module for Development Tools 15 SP4
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Linux Enterprise Real Time 15 SP3
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Linux Enterprise Server 15 SP2-LTSS
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Linux Enterprise Server 15 SP3-LTSS
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Linux Enterprise Server for SAP Applications 15 SP2
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Linux Enterprise Server for SAP Applications 15 SP3
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Enterprise Storage 7
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
SUSE:Enterprise Storage 7.1
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
testng
openSUSE:Leap 15.4
before 7.4.0-150200.3.7.1
7.4.0-150200.3.7.1
snakeyaml
SUSE:Linux Enterprise Module for Development Tools 15 SP5
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise Module for Development Tools 15 SP5
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise Module for Development Tools 15 SP6
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise Module for Development Tools 15 SP6
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
mockito
SUSE:Linux Enterprise Module for Package Hub 15 SP6
before 5.11.0-150200.3.7.1
5.11.0-150200.3.7.1
snakeyaml
SUSE:Manager Server Module 4.3
before 2.2-150200.3.15.1
2.2-150200.3.15.1
snakeyaml
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise Server 15 SP2-LTSS
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise Server 15 SP2-LTSS
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise Server 15 SP3-LTSS
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise Server 15 SP3-LTSS
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise Server 15 SP4-LTSS
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise Server 15 SP4-LTSS
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise Server for SAP Applications 15 SP2
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise Server for SAP Applications 15 SP2
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise Server for SAP Applications 15 SP3
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise Server for SAP Applications 15 SP3
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Linux Enterprise Server for SAP Applications 15 SP4
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Linux Enterprise Server for SAP Applications 15 SP4
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
snakeyaml
SUSE:Enterprise Storage 7.1
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
SUSE:Enterprise Storage 7.1
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
mockito
openSUSE:Leap 15.5
before 5.11.0-150200.3.7.1
5.11.0-150200.3.7.1
snakeyaml
openSUSE:Leap 15.5
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
openSUSE:Leap 15.5
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
mockito
openSUSE:Leap 15.6
before 5.11.0-150200.3.7.1
5.11.0-150200.3.7.1
snakeyaml
openSUSE:Leap 15.6
before 2.2-150200.3.15.1
2.2-150200.3.15.1
testng
openSUSE:Leap 15.6
before 7.10.1-150200.3.10.1
7.10.1-150200.3.10.1
testng
Ubuntu:14.04:LTS
All versions, plus listed versions
5.11+dfsg-3build16.8.7-2
None known
testng
Ubuntu:16.04:LTS
All versions, plus listed versions
6.9.5-1
None known
testng
Ubuntu:18.04:LTS
All versions, plus listed versions
6.9.12-26.9.12-2ubuntu1
None known
testng
Ubuntu:20.04:LTS
All versions, plus listed versions
6.9.12-4
None known
testng
Ubuntu:22.04:LTS
All versions, plus listed versions
6.9.12-4
None known
testng
Ubuntu:24.04:LTS
All versions, plus listed versions
6.9.12-4
None known
testng
Ubuntu:25.10
All versions, plus listed versions
6.9.12-4
None known
testng
Ubuntu:26.10
All versions, plus listed versions
6.9.12-5
None known
testng
Ubuntu:26.04:LTS
All versions, plus listed versions
6.9.12-46.9.12-5
None known

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
PoC in GitHubshoucheng3/testng-team__testng_CVE-2022-4065_7-52025-08-17

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV, PoC in GitHub

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-4065 is a medium vulnerability (CVSS 5.5) in Cbeust Testng, published November 19, 2022. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.97%, the 62nd percentile. Fixed in org.testng:testng 7.5.1.

References

Show 17 moreShow less
This page doesn't list everything

Left out here: the rest of 1 source description. The JSON record has them.

MoveEnter Open