ghsa-rc2q-x9mf-w3vf
Vulnerability from github
Published
2022-11-19 21:30
Modified
2023-05-09 17:53
Summary
TestNG is vulnerable to Path Traversal
Details

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.
Show details on source website


{
  "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"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…