7.7high
CWE-470 in generator-jhipster-entity-audit when having Javers selected as Entity Audit Framework
- Severity
- 7.7high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.54% (higher than 46% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-7rmp-3g9f-cvq8
Description
generator-jhipster-entity-audit is a JHipster module to enable entity audit and audit log page. Prior to 5.9.1, generator-jhipster-entity-audit allows unsafe reflection when having Javers selected as Entity Audit Framework. 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. This vulnerability is fixed in 5.9.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| jhipster generator-jhipster-entity-audit | < 5.9.1 | CVE List |
| generator-jhipster-entity-audit (npm) | before 5.9.1 | GitHub Advisory Database |
All scores
| GitHub_M | 7.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H |
| GitHub | 7.6high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
generator-jhipster-entity-audit is a JHipster module to enable entity audit and audit log page. Prior to 5.9.1, generator-jhipster-entity-audit allows unsafe reflection when having Javers selected as Entity Audit Framework. 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. This vulnerability is fixed in 5.9.1.
GitHub Advisory Database
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
- Place an arbitrary class with the right package name (starting with JHIpster applications path name) and make it available in class path
- Gain access to view entity's audit changelogs (Role: ADMIN)
- pass in the malicious class name part as
entityType(first mentioned part) //qualifiedName(second mentioned occurence) - 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.
NVD (es)
generator-jhipster-entity-audit es un módulo de JHipster que habilita la auditoría de entidades y la página de registro de auditoría. En versiones anteriores a la versión 5.9.1, generator-jhipster-entity-audit permitía la reflexión insegura al seleccionar Javers como marco de auditoría de entidades. Si un atacante logra insertar clases maliciosas en la ruta de clases y, además, tiene acceso a estas interfaces REST para llamar a los endpoints REST mencionados, el uso de estas líneas de código puede provocar la ejecución remota no intencionada de código. Esta vulnerabilidad se corrigió en la versión 5.9.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-31119 changed 2025-04-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7rmp-3g9f-cvq8 changed 2025-04-04 | CC-BY-4.0 |
| NVD | CVE-2025-31119 changed 2026-06-17 | Public domain |