CVE-2019-16303
JHipster Kotlin using insecure source of randomness `RandomStringUtils` before v1.2.0
A class generated by the Generator in JHipster before 6.3.0 and JHipster Kotlin through 1.1.0 produces code that uses an insecure source of randomness (apache.commons.lang3 RandomStringUtils). This allows an attacker (if able to obtain their own password reset URL) to compute the value for all other password resets for other accounts, thus allowing privilege escalation or account takeover.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
A class generated by the Generator in JHipster before 6.3.0 and JHipster Kotlin through 1.1.0 produces code that uses an insecure source of randomness (apache.commons.lang3 RandomStringUtils). This allows an attacker (if able to obtain their own password reset URL) to compute the value for all other password resets for other accounts, thus allowing privilege escalation or account takeover.
- Record
CVE-2019-16303- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-338
- Updated
- 2026-11-02
CVE List No score
A class generated by the Generator in JHipster before 6.3.0 and JHipster Kotlin through 1.1.0 produces code that uses an insecure source of randomness (apache.commons.lang3 RandomStringUtils). This allows an attacker (if able to obtain their own password reset URL) to compute the value for all other password resets for other accounts, thus allowing privilege escalation or account takeover.
- Record
CVE-2019-16303- Updated
- 2026-11-02
EUVDEUVD-2020-0493 No score
A class generated by the Generator in JHipster before 6.3.0 and JHipster Kotlin through 1.1.0 produces code that uses an insecure source of randomness (apache.commons.lang3 RandomStringUtils). This allows an attacker (if able to obtain their own password reset URL) to compute the value for all other password resets for other accounts, thus allowing privilege escalation or account takeover.
- Record
EUVD-2020-0493- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-j3rh-8vwq-wh84
9.8
JHipster Kotlin using insecure source of randomness `RandomStringUtils` before v1.2.0
JHipster Kotlin is using an insecure source of randomness to generate all of its random values. JHipster Kotlin relies upon apache commons lang3 RandomStringUtils.
From the documentation:
Caveat: Instances of Random, upon which the implementation of this class relies, are not cryptographically secure. - https://commons.apache.org/proper/commons-lang/javadocs/api-3.9/org/apache/commons/lang3/RandomStringUtils.html
Here are the examples of JHipster Kotlin's use of an insecure PRNG:
Proof Of Concepts Already Exist
There has been a POC of taking one RNG value generated RandomStringUtils and reversing it to generate all of the past/future RNG values public since March 3rd, 2018.
POC Repository: https://github.com/alex91ar/randomstringutils
Potential Impact Technical
All that is required is to get one password reset token from a JHipster Kotlin generated service and using the POC above, you can reverse what all future password reset tokens to be generated by this server. This allows an attacker to pick and choose what account they would like to takeover by sending account password reset requests for targeted accounts.
Potential Impact Scale
Not as large as for the original jhipster project as the kotlin blueprint is not that widely used.
Patches
Update your generated applications to > 1.2.0
Workarounds
Change the content of RandomUtil.kt like this:
import java.security.SecureRandom
import org.apache.commons.lang3.RandomStringUtils
private const val DEF_COUNT = 20
object RandomUtil {
private val secureRandom: SecureRandom = SecureRandom()
init {
secureRandom.nextBytes(byteArrayOf(64.toByte()))
}
private fun generateRandomAlphanumericString(): String {
return RandomStringUtils.random(DEF_COUNT, 0, 0, true, true, null, secureRandom)
}
/**
* Generate a password.
*
* @return the generated password.
*/
fun generatePassword(): String = generateRandomAlphanumericString()
}
Important is to exchange every call of RandomStringUtils.randomAlphaNumeric.
For more information
If you have any questions or comments about this advisory:
- Open an issue in JHipster Kotlin
- Record
GHSA-j3rh-8vwq-wh84- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-338
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-mwp6-j9wf-968c
9.8
Critical severity vulnerability that affects generator-jhipster
Account takeover and privilege escalation is possible in applications generated by generator-jhipster before 6.3.0. This is due to a vulnerability in the generated java classes: CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Generated applications must be manually patched, following instructions in the release notes: https://www.jhipster.tech/2019/09/13/jhipster-release-6.3.0.html
- Record
GHSA-mwp6-j9wf-968c- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-338
- Updated
- 2026-11-02
OSV
9.8
A class generated by the Generator in JHipster before 6.3.0 and JHipster Kotlin through 1.1.0 produces code that uses an insecure source of randomness (apache.commons.lang3 RandomStringUtils). This allows an attacker (if able to obtain their own password reset URL) to compute the value for all other password resets for other accounts, thus allowing privilege escalation or account takeover.
- Record
CVE-2019-16303- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVGHSA-j3rh-8vwq-wh84
9.8
JHipster Kotlin using insecure source of randomness `RandomStringUtils` before v1.2.0
JHipster Kotlin is using an insecure source of randomness to generate all of its random values. JHipster Kotlin relies upon apache commons lang3 RandomStringUtils.
From the documentation:
Caveat: Instances of Random, upon which the implementation of this class relies, are not cryptographically secure. - https://commons.apache.org/proper/commons-lang/javadocs/api-3.9/org/apache/commons/lang3/RandomStringUtils.html
Here are the examples of JHipster Kotlin's use of an insecure PRNG:
Proof Of Concepts Already Exist
There has been a POC of taking one RNG value generated RandomStringUtils and reversing it to generate all of the past/future RNG values public since March 3rd, 2018.
POC Repository: https://github.com/alex91ar/randomstringutils
Potential Impact Technical
All that is required is to get one password reset token from a JHipster Kotlin generated service and using the POC above, you can reverse what all future password reset tokens to be generated by this server. This allows an attacker to pick and choose what account they would like to takeover by sending account password reset requests for targeted accounts.
Potential Impact Scale
Not as large as for the original jhipster project as the kotlin blueprint is not that widely used.
Patches
Update your generated applications to > 1.2.0
Workarounds
Change the content of RandomUtil.kt like this:
import java.security.SecureRandom
import org.apache.commons.lang3.RandomStringUtils
private const val DEF_COUNT = 20
object RandomUtil {
private val secureRandom: SecureRandom = SecureRandom()
init {
secureRandom.nextBytes(byteArrayOf(64.toByte()))
}
private fun generateRandomAlphanumericString(): String {
return RandomStringUtils.random(DEF_COUNT, 0, 0, true, true, null, secureRandom)
}
/**
* Generate a password.
*
* @return the generated password.
*/
fun generatePassword(): String = generateRandomAlphanumericString()
}
Important is to exchange every call of RandomStringUtils.randomAlphaNumeric.
For more information
If you have any questions or comments about this advisory:
- Open an issue in JHipster Kotlin
- Record
GHSA-j3rh-8vwq-wh84- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-338
- Updated
- 2026-11-02
OSVGHSA-mwp6-j9wf-968c
9.8
Critical severity vulnerability that affects generator-jhipster
Account takeover and privilege escalation is possible in applications generated by generator-jhipster before 6.3.0. This is due to a vulnerability in the generated java classes: CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)
Generated applications must be manually patched, following instructions in the release notes: https://www.jhipster.tech/2019/09/13/jhipster-release-6.3.0.html
- Record
GHSA-mwp6-j9wf-968c- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-338
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
generator-jhipster-kotlinnpm |
before 1.2.0 | 1.2.0 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2019-16303 is a critical vulnerability (CVSS 9.8) in Jhipster, published September 13, 2019. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.67%, the 89th percentile. Fixed in generator-jhipster-kotlin 1.2.0.
References
github.com/jhipster/generator-jhipster/security/advisories/GHSA-mwp6-j9wf-968c
github.com/jhipster/generator-jhipster/issues/10401
github.com/jhipster/generator-jhipster/commit/88448b85fd3e8e49df103f0061359037c2c68ea7
github.com/jhipster/jhipster-kotlin/issues/183
jhipster.tech/2019/09/13/jhipster-release-6.3.0.html
lists.apache.org/thread.html/r6d243e7e3f25daeb242dacf3def411fba32a9388d3ff84918cb28ddd%40%3Cissues.commons.apache.org%3E
Show 14 moreShow less
lists.apache.org/thread.html/rc87fa35a48b5d70b06af6fb81785ed82e82686eb83307aae6d250dc9%40%3Cissues.commons.apache.org%3E
lists.apache.org/thread.html/rc3f00f5d3d2ec0e2381a3b9096d5f5b4d46ec1587ee7e251a3dbb897%40%3Cissues.commons.apache.org%3E
github.com/jhipster/jhipster-kotlin/security/advisories/GHSA-j3rh-8vwq-wh84
nvd.nist.gov/vuln/detail/CVE-2019-16303
snyk.io/vuln/SNYK-JS-GENERATORJHIPSTER-466980
npmjs.com/advisories/1187
npmjs.com/advisories/1188
lists.apache.org/thread.html/r6d243e7e3f25daeb242dacf3def411fba32a9388d3ff84918cb28ddd@%3Cissues.commons.apache.org%3E
lists.apache.org/thread.html/rc3f00f5d3d2ec0e2381a3b9096d5f5b4d46ec1587ee7e251a3dbb897@%3Cissues.commons.apache.org%3E
lists.apache.org/thread.html/rc87fa35a48b5d70b06af6fb81785ed82e82686eb83307aae6d250dc9@%3Cissues.commons.apache.org%3E
github.com/jhipster/jhipster-kotlin/commit/deec3587ef7721cf5de5b960d43e9b68beff6193
github.com/advisories/GHSA-j3rh-8vwq-wh84
github.com/advisories/GHSA-mwp6-j9wf-968c
github.com/jhipster/generator-jhipster