Skip to content

← Actionable
High, CVSS 7.8

TestNG is vulnerable to Path Traversal

CVE-2022-4065GHSA-rc2q-x9mf-w3vf

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (org.testng:testng 7.7.0, 7.5.1), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
7.8 · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
  • CVE-2022-4065: 0.97% estimated exploitation activity in the next 30 days; percentile 61.91 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

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 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.

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 1 · created ·

    Published from ghsa record GHSA-rc2q-x9mf-w3vf

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2022-4065

Advisory: TestNG is vulnerable to Path Traversal
IDs: CVE-2022-4065, GHSA-rc2q-x9mf-w3vf
Record: https://patchnext.com/advisories/cve-2022-4065 (revision 1, source checked 26 Oct 2026, 16:14 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: High (CVSS 7.8)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: org.testng:testng 7.7.0, 7.5.1. A vendor fix does not mean a deployment is fixed.

## Affected components
- Maven org.testng:testng: affected >= 6.13, < 7.5.1; >= 7.6.0, < 7.7.0; fixed in 7.5.1, 7.7.0

## Suggested inspection (read-only)
- Maven org.testng:testng: check the installed version with your package manager.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on org.testng:testng.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-rc2q-x9mf-w3vf (GitHub-reviewed advisory GHSA-rc2q-x9mf-w3vf lists affected ranges: Maven org.testng:testng >=6.13 =7.6.0 <7.7.0)

Commands are suggestions: review each one before running it.

Loading voting…