Vulnerabilities in pkg:npm/generator-jhipster-entity-audit

PACKAGE
Advisory Identifier: GHSA-7rmp-3g9f-cvq8
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/generator-jhipster-entity-audit

1 Known Advisory Record(s)

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

CVE Identifier CVE-2025-31119
GHSA Identifier GHSA-7rmp-3g9f-cvq8
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Affected Product Generator jhipster entity audit
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

generator-jhipster-entity-audit fixed: 5.9.1
npm install generator-jhipster-entity-audit@5.9.1
Verify Direct and Transitive Dependencies

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

### 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.

CVE-2025-31119 Affected Generator jhipster entity audit Versions

1 component(s)
Fixed Versions:
5.9.1
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?
CVE-2025-31119 is a security vulnerability in Generator jhipster entity audit involving generator-jhipster-entity-audit vulnerable to Unsafe Reflection when having Javers selected as Entity Audit Framework under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection').
Which Generator jhipster entity audit versions are affected?
Affected versions include releases prior to 5.9.1 across affected packages: generator-jhipster-entity-audit.
What version fixes CVE-2025-31119?
Upgrading to 5.9.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is generator-jhipster-entity-audit affected?
Yes, generator-jhipster-entity-audit is affected in releases prior to 5.9.1. Upgrade your dependency to 5.9.1 or later.
What is the CVSS score of CVE-2025-31119?
CVE-2025-31119 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2025-31119?
CVE-2025-31119 is classified under CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') (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.).
How can I check npm dependencies for CVE-2025-31119?
Run the dependency tree command: 'npm ls generator-jhipster-entity-audit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}