CVE-2019-16303: Critical severity vulnerability that affects generator-jhipster

CVE-2019-16303 · Severity: low · CVSS 3.1 · Published 2019-09-13

JHipster Kotlin is a code generator that creates backend applications with user authentication and password reset functionality. The generator uses a cryptographically weak random number generator (Java's Random class via Apache Commons) for creating password reset tokens and other security-sensitive values. An attacker who obtains a single password reset token can mathematically reverse-engineer all future tokens, enabling them to take over any user account without authorization.

Technologies: generator-jhipster (npm). Vendors: npm.

Quick answers

Is CVE-2019-16303 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2019-16303 being exploited in the wild.
How severe is CVE-2019-16303?
Low severity, with a CVSS score of 3.1, published 13 September 2019.
Which products and versions are affected?
generator-jhipster (npm) SEMVER:introduced=0,fixed=6.3.0; generator-jhipster-kotlin (npm) SEMVER:introduced=0,fixed=1.2.0.
Is there a fix for CVE-2019-16303?
Yes. generator-jhipster (npm): upgrade to 6.3.0 or later; generator-jhipster-kotlin (npm): upgrade to 1.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2019-16303 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2019-16303?
Check whether you run generator-jhipster (npm) or generator-jhipster-kotlin (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • generator-jhipster (npm): upgrade to 6.3.0 or later
    npm install generator-jhipster@6.3.0
  • generator-jhipster-kotlin (npm): upgrade to 1.2.0 or later
    npm install generator-jhipster-kotlin@1.2.0

Technical details

JHipster Kotlin uses Apache Commons Lang3's RandomStringUtils class, which relies on java.util.Random for token generation. java.util.Random is not cryptographically secure and uses a linear congruential generator that is predictable given a single output value. The vulnerability (CWE-338) allows an attacker to obtain one password reset token from a target application and use publicly available proof-of-concept tools to determine the seed and predict all past and future token values. This enables account takeover through targeted password reset requests. Affected versions are before 1.2.0; the fix involves replacing RandomStringUtils calls with SecureRandom-backed alternatives as documented in the patch release notes.

Affected products

  • JHipster Kotlin before 1.2.0

Identifiers

  • CVE-2019-16303
  • GHSA-j3rh-8vwq-wh84
  • GHSA-mwp6-j9wf-968c

Timeline

  • 2019-09-13: disclosed
  • 2020-06-26: advisory
  • 2020-06-26: patched: v1.2.0 released

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.