Vulnerabilities in pkg:npm/generator-jhipster-entity-audit
PACKAGECVE-2025-31119 is a HIGH (CVSS 7.6) generator-jhipster-entity-audit vulnerable to unsafe reflection vulnerability (CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')) affecting Generator jhipster entity audit libraries in the npm ecosystem. The issue involves generator-jhipster-entity-audit vulnerable to unsafe reflection when having javers selected as entity audit framework. Remediation is available by upgrading affected packages to version 5.9.1.
pkg:npm/generator-jhipster-entity-audit
Vulnerability advisories affecting package pkg:npm/generator-jhipster-entity-audit. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-7rmp-3g9f-cvq8 | CVE-2025-31119 | HIGH | generator-jhipster-entity-audit vulnerable to Unsafe Reflection when having Javers selected as Entity Audit Framework |
CVE-2025-31119 at a Glance
Security Impact
CVSS: 7.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H).
How to Fix CVE-2025-31119
To remediate this vulnerability, upgrade all affected Generator jhipster entity audit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install generator-jhipster-entity-audit@5.9.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls generator-jhipster-entity-audit
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-31119, inspect your project dependencies using npm:
npm ls generator-jhipster-entity-audit
Analyze the terminal output to locate any version of Generator jhipster entity audit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.9.1), your application is affected.
Note: The npm ls generator-jhipster-entity-audit command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection'), where the product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code. In Generator jhipster entity audit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-31119 Affected Generator jhipster entity audit Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
generator-jhipster-entity-audit
|
npm |
< 5.9.1
|
5.9.1
|
References
Frequently Asked Questions
What is CVE-2025-31119?
Which Generator jhipster entity audit versions are affected?
What version fixes CVE-2025-31119?
Is generator-jhipster-entity-audit affected?
What is the CVSS score of CVE-2025-31119?
What CWE is associated with CVE-2025-31119?
How can I check npm dependencies for CVE-2025-31119?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7rmp-3g9f-cvq8",
"modified" : "2025-04-04T14:06:35Z",
"published" : "2025-04-04T14:06:35Z",
"aliases" : [ "CVE-2025-31119" ],
"summary" : "generator-jhipster-entity-audit vulnerable to Unsafe Reflection when having Javers selected as Entity Audit Framework",
"details" : "### Summary\nCWE-470 (Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') when having Javers selected as Entity Audit Framework\n\n### Details\nIn 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\nhttps://github.com/jhipster/generator-jhipster-entity-audit/blob/e21e83135d10c77d92203c89cb0b0063914e8fe0/generators/spring-boot-javers/templates/src/main/java/_package_/web/rest/JaversEntityAuditResource.java.ejs#L88\nhttps://github.com/jhipster/generator-jhipster-entity-audit/blob/e21e83135d10c77d92203c89cb0b0063914e8fe0/generators/spring-boot-javers/templates/src/main/java/_package_/web/rest/JaversEntityAuditResource.java.ejs#L124\n\nSo, 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.\n\n### PoC\n\n1. Place an arbitrary class with the right package name (starting with JHIpster applications path name) and make it available in class path\n2. Gain access to view entity's audit changelogs (Role: ADMIN)\n3. pass in the malicious class name part as `entityType` (first mentioned part) // `qualifiedName` (second mentioned occurence)\n4. class gets loaded and static code blocks in there get executed\n\n--> Should be limited to the already existing whitelist of classes (see first method in that mentioned class)\n\n### Impact\nRemote 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "generator-jhipster-entity-audit"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.9.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jhipster/generator-jhipster-entity-audit/security/advisories/GHSA-7rmp-3g9f-cvq8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-31119"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jhipster/generator-jhipster-entity-audit"
}, {
"type" : "WEB",
"url" : "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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-470" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-04-04T14:06:35Z",
"nvd_published_at" : "2025-04-03T20:15:25Z"
}
}