GHSA-7rmp-3g9f-cvq8

Suggest an improvement
Source
https://github.com/advisories/GHSA-7rmp-3g9f-cvq8
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/04/GHSA-7rmp-3g9f-cvq8/GHSA-7rmp-3g9f-cvq8.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-7rmp-3g9f-cvq8
Aliases
Published
2025-04-04T14:06:35Z
Modified
2025-04-04T14:57:15.473236Z
Severity
  • 7.6 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H CVSS Calculator
Summary
generator-jhipster-entity-audit vulnerable to Unsafe Reflection when having Javers selected as Entity Audit Framework
Details

Summary

CWE-470 (Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') when having Javers selected as Entity Audit Framework

Details

In the following two occurences, user input directly leads to class loading without checking against e.g. a whitelist of allowed classes. This is also known as CWE-470 https://github.com/jhipster/generator-jhipster-entity-audit/blob/e21e83135d10c77d92203c89cb0b0063914e8fe0/generators/spring-boot-javers/templates/src/main/java/package/web/rest/JaversEntityAuditResource.java.ejs#L88 https://github.com/jhipster/generator-jhipster-entity-audit/blob/e21e83135d10c77d92203c89cb0b0063914e8fe0/generators/spring-boot-javers/templates/src/main/java/package/web/rest/JaversEntityAuditResource.java.ejs#L124

So, if an attacker manages to place some malicious classes into the classpath and also has access to these REST interface for calling the mentioned REST endpoints, using these lines of code can lead to unintended remote code execution.

PoC

  1. Place an arbitrary class with the right package name (starting with JHIpster applications path name) and make it available in class path
  2. Gain access to view entity's audit changelogs (Role: ADMIN)
  3. pass in the malicious class name part as entityType (first mentioned part) // qualifiedName (second mentioned occurence)
  4. class gets loaded and static code blocks in there get executed

--> Should be limited to the already existing whitelist of classes (see first method in that mentioned class)

Impact

Remote Code execution. You need to have some access to place malicious classes into the class path and you need to have a user with ADMIN role on the system.

Database specific
{
    "github_reviewed": true,
    "nvd_published_at": "2025-04-03T20:15:25Z",
    "severity": "HIGH",
    "cwe_ids": [
        "CWE-470"
    ],
    "github_reviewed_at": "2025-04-04T14:06:35Z"
}
References

Affected packages

npm / generator-jhipster-entity-audit

Package

Name
generator-jhipster-entity-audit
View open source insights on deps.dev
Purl
pkg:npm/generator-jhipster-entity-audit

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.9.1

Database specific

source

"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/04/GHSA-7rmp-3g9f-cvq8/GHSA-7rmp-3g9f-cvq8.json"