GHSA-M43G-M425-P68X
Vulnerability from github – Published: 2025-07-01 22:59 – Updated: 2025-07-01 22:59Summary
This vulnerability affects JUnit's support for writing Open Test Reporting XML files which is an opt-in feature of junit-platform-reporting.
If a repository is cloned using a GitHub token or other credentials in its URL, for example:
git clone https://${GH_APP}:${GH_TOKEN}@github.com/example/example.git
The credentials are captured by OpenTestReportGeneratingListener which produces (trimmed for brevity):
<infrastructure>
<git:repository originUrl="https://username:token@github.com/example/example.git" />
</infrastructure>
Details
https://github.com/junit-team/junit5/blob/6b7764dac92fd35cb348152d1b37f8726875a4e0/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/OpenTestReportGeneratingListener.java#L183
I think this should be configurable in some way to exclude select git information or exclude it entirely.
PoC
- Clone a repo using a GitHub token as shown above.
- Enable the listener
junit.platform.reporting.open.xml.enabled=true - Observe report captures credentials
Impact
Depending on the level of access of the token, it can be nothing, limited, or everything.
If these test reports are published or stored anywhere public, then there is the possibility that a rouge attacker can steal the token and perform elevated actions by impersonating the user or app.
Resolution
JUnit 5.13.2 and later replace credentials in the URL with ***. Moreover, including any Git metadata in the XML output is now an opt-in feature that can be enabled via the new junit.platform.reporting.open.xml.git.enabled=true configuration parameter but is not included by default.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 5.13.1"
},
"package": {
"ecosystem": "Maven",
"name": "org.junit.platform:junit-platform-reporting"
},
"ranges": [
{
"events": [
{
"introduced": "5.12.0"
},
{
"fixed": "5.13.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-53103"
],
"database_specific": {
"cwe_ids": [
"CWE-312"
],
"github_reviewed": true,
"github_reviewed_at": "2025-07-01T22:59:43Z",
"nvd_published_at": "2025-07-01T18:15:25Z",
"severity": "MODERATE"
},
"details": "### Summary\n\nThis vulnerability affects JUnit\u0027s support for writing Open Test Reporting XML files which is an opt-in feature of `junit-platform-reporting`.\n\nIf a repository is cloned using a GitHub token or other credentials in its URL, for example:\n\n```bash\ngit clone https://${GH_APP}:${GH_TOKEN}@github.com/example/example.git\n```\n\nThe credentials are captured by `OpenTestReportGeneratingListener` which produces (trimmed for brevity):\n\n```xml\n\u003cinfrastructure\u003e\n \u003cgit:repository originUrl=\"https://username:token@github.com/example/example.git\" /\u003e\n\u003c/infrastructure\u003e\n```\n\n### Details\n\nhttps://github.com/junit-team/junit5/blob/6b7764dac92fd35cb348152d1b37f8726875a4e0/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/OpenTestReportGeneratingListener.java#L183\n\nI think this should be configurable in some way to exclude select git information or exclude it entirely.\n\n### PoC\n\n1. Clone a repo using a GitHub token as shown above.\n2. Enable the listener `junit.platform.reporting.open.xml.enabled=true`\n3. Observe report captures credentials\n\n### Impact\n\nDepending on the level of access of the token, it can be nothing, limited, or everything.\n\nIf these test reports are published or stored anywhere public, then there is the possibility that a rouge attacker can steal the token and perform elevated actions by impersonating the user or app.\n\n### Resolution\n\nJUnit 5.13.2 and later replace credentials in the URL with `***`. Moreover, including any Git metadata in the XML output is now an opt-in feature that can be enabled via the new `junit.platform.reporting.open.xml.git.enabled=true` configuration parameter but is not included by default.",
"id": "GHSA-m43g-m425-p68x",
"modified": "2025-07-01T22:59:43Z",
"published": "2025-07-01T22:59:43Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/junit-team/junit-framework/security/advisories/GHSA-m43g-m425-p68x"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-53103"
},
{
"type": "WEB",
"url": "https://github.com/junit-team/junit-framework/commit/d4fc834c8c1c0b3168cd030c13551d1d041f51bc"
},
{
"type": "PACKAGE",
"url": "https://github.com/junit-team/junit-framework"
},
{
"type": "WEB",
"url": "https://github.com/junit-team/junit-framework/blob/6b7764dac92fd35cb348152d1b37f8726875a4e0/junit-platform-reporting/src/main/java/org/junit/platform/reporting/open/xml/OpenTestReportGeneratingListener.java#L183"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "junit-platform-reporting can leak Git credentials through its OpenTestReportGeneratingListener "
}
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.