CVE-2025-31119: CWE-470 in generator-jhipster-entity-audit when having Javers selected as Entity Audit Framework

Published Apr 3, 2025
·
Updated

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.

Other sources

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.

— MITRE

Affected Software

2 affected componentsFixes available
JHipster generator-jhipster-entity-audit<5.9.1
npm/generator-jhipster-entity-audit<5.9.1
5.9.1

Event History

Apr 3, 2025
CVE Published
via MITRE·07:11 PM
Data Sourced
via MITRE·07:11 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:15 PM
DescriptionSeverityWeakness
Apr 4, 2025
Advisory Published
via GitHub·02:06 PM

Frequently Asked Questions

1

What is the severity of CVE-2025-31119?

CVE-2025-31119 has a high severity due to the potential for unsafe reflection leading to remote code execution.

2

How do I fix CVE-2025-31119?

To fix CVE-2025-31119, upgrade the generator-jhipster-entity-audit module to version 5.9.1 or later.

3

What software is affected by CVE-2025-31119?

CVE-2025-31119 affects versions of generator-jhipster-entity-audit prior to 5.9.1.

4

What type of vulnerability is CVE-2025-31119?

CVE-2025-31119 is a code execution vulnerability that involves unsafe reflection.

5

Can exploiting CVE-2025-31119 lead to data compromise?

Yes, successful exploitation of CVE-2025-31119 can potentially allow an attacker to compromise sensitive data.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203