[MAVEN:GHSA-RC2Q-X9MF-W3VF] TestNG is vulnerable to Path Traversal

Severity High
Affected Packages 2
Fixed Packages 2
CVEs 1

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.
Package Affected Version
pkg:maven/org.testng/testng >= 7.6.0, < 7.7.0
pkg:maven/org.testng/testng >= 6.13, < 7.5.1
Package Fixed Version
pkg:maven/org.testng/testng = 7.7.0
pkg:maven/org.testng/testng = 7.5.1
ID
MAVEN:GHSA-RC2Q-X9MF-W3VF
Severity
high
URL
https://github.com/advisories/GHSA-rc2q-x9mf-w3vf
Published
2022-11-19T21:30:25
(22 months ago)
Modified
2023-10-20T22:23:16
(11 months ago)
Rights
Maven Security Team
Other Advisories
Type Package URL Namespace Name / Product Version Distribution / Platform Arch Patch / Fix
Affected pkg:maven/org.testng/testng org.testng testng >= 7.6.0 < 7.7.0
Fixed pkg:maven/org.testng/testng org.testng testng = 7.7.0
Affected pkg:maven/org.testng/testng org.testng testng >= 6.13 < 7.5.1
Fixed pkg:maven/org.testng/testng org.testng testng = 7.5.1
# CVE Description CVSS EPSS EPSS Trend (30 days) Affected Products Weaknesses Security Advisories Exploits PoC Pubblication Date Modification Date
# CVE Description CVSS EPSS EPSS Trend (30 days) Affected Products Weaknesses Security Advisories PoC Pubblication Date Modification Date
Loading...