CVE-2024-36115
Published: 19 June 2024
Summary
CVE-2024-36115 is a high-severity Cross-site Scripting (CWE-79) vulnerability. Its CVSS base score is 7.1 (High).
Operationally, ranked in the top 9.7% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.
Deeper analysis
Reposilite, an open-source Maven repository manager for JVM artifacts, is affected by a same-origin policy violation that constitutes a stored cross-site scripting issue (CWE-79). Artifact content is served from the same protocol, host, and port as the administrative UI, so any HTML or JavaScript embedded in an artifact executes with access to the browser's local storage, where the authenticated user's token-secret is held.
An attacker who can publish a malicious artifact to a mirrored upstream repository such as Maven Central can trigger the vulnerability simply by causing an authenticated administrator to view the artifact in a browser. The injected script can exfiltrate the token, enabling full administrative API access, modification of settings and artifacts, and ultimately remote code execution on downstream systems that consume packages from the compromised Reposilite instance. The attack requires no direct interaction beyond the victim opening a link and works even when the instance is isolated behind a VPN.
The project has released version 3.5.12 containing the fix; the referenced GitHub Security Advisory GHSA-9w8w-34vr-65j2 and associated commits confirm that users should upgrade and that no workarounds are available. The EPSS score has remained flat at 0.0537 with no material increase since disclosure.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2024-2552
Vulnerability details
Reposilite is an open source, lightweight and easy-to-use repository manager for Maven based artifacts in JVM ecosystem. As a Maven repository manager, Reposilite provides the ability to view the artifacts content in the browser, as well as perform administrative tasks…
more
via API. The problem lies in the fact that the artifact's content is served via the same origin (protocol/host/port) as the Admin UI. If the artifact contains HTML content with javascript inside, the javascript is executed within the same origin. Therefore, if an authenticated user is viewing the artifacts content, the javascript inside can access the browser's local storage where the user's password (aka 'token-secret') is stored. It is especially dangerous in scenarios where Reposilite is configured to mirror third party repositories, like the Maven Central Repository. Since anyone can publish an artifact to Maven Central under its own name, such malicious packages can be used to attack the Reposilite instance. This issue may lead to the full Reposilite instance compromise. If this attack is performed against the admin user, it's possible to use the admin API to modify settings and artifacts on the instance. In the worst case scenario, an attacker would be able to obtain the Remote code execution on all systems that use artifacts from Reposilite. It's important to note that the attacker does not need to lure a victim user to use a malicious artifact, but just open a link in the browser. This link can be silently loaded among the other HTML content, making this attack unnoticeable. Even if the Reposilite instance is located in an isolated environment, such as behind a VPN or in the local network, this attack is still possible as it can be performed from the admin browser. Reposilite has addressed this issue in version 3.5.12. Users are advised to upgrade. There are no known workarounds for this vulnerability. This issue was discovered and reported by the GitHub Security lab and is also tracked as GHSL-2024-072.
- CWE(s)
Related Threats
No named actor attribution yet. ATT&CK technique mapping in progress for this CVE.
Affected Assets
Mitigating Controls
Likely Mitigating Controls AI
Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.
Penetration testing submits XSS payloads to web applications, detecting cross-site scripting flaws for subsequent remediation.
Validates web inputs to reject script-related content that could produce XSS.
Output validation against expected content can reject or sanitize script content in generated web pages, reducing XSS exploitability.