GHSA-RC2Q-X9MF-W3VF
Vulnerability from github – Published: 2022-11-19 21:30 – Updated: 2023-05-09 17:53Impact
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.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.testng:testng"
},
"ranges": [
{
"events": [
{
"introduced": "6.13"
},
{
"fixed": "7.5.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.testng:testng"
},
"ranges": [
{
"events": [
{
"introduced": "7.6.0"
},
{
"fixed": "7.7.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-4065"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2022-12-02T22:31:06Z",
"nvd_published_at": "2022-11-19T19:15:00Z",
"severity": "HIGH"
},
"details": "### Impact\n\nAffected 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`.\n\nThe 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.\n\n### Patches\n\nA patch is available in [version 7.7.0](https://github.com/cbeust/testng/releases/tag/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.\n\nA 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.\n\n### Workaround\n\n* Specify which tests to run when invoking TestNG by configuring them on the CLI or in the build tool controlling the run.\n* Do not run tests with untrusted JARs on the classpath, this includes pull requests on open source projects.",
"id": "GHSA-rc2q-x9mf-w3vf",
"modified": "2023-05-09T17:53:32Z",
"published": "2022-11-19T21:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-4065"
},
{
"type": "WEB",
"url": "https://github.com/cbeust/testng/pull/1596"
},
{
"type": "WEB",
"url": "https://github.com/cbeust/testng/pull/2806"
},
{
"type": "WEB",
"url": "https://github.com/testng-team/testng/pull/2899"
},
{
"type": "WEB",
"url": "https://github.com/cbeust/testng/commit/9150736cd2c123a6a3b60e6193630859f9f0422b"
},
{
"type": "PACKAGE",
"url": "https://github.com/cbeust/testng"
},
{
"type": "WEB",
"url": "https://github.com/cbeust/testng/releases/tag/7.7.0"
},
{
"type": "WEB",
"url": "https://github.com/cbeust/testng/releases/tag/7.7.1"
},
{
"type": "WEB",
"url": "https://github.com/testng-team/testng/releases/tag/7.5.1"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.214027"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.214027"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "TestNG is vulnerable to Path Traversal"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.