CVE-2026-40975: Weak RNG
Values produced by ${random.value} are not suitable for use as secrets. ${random.uuid} is not affected. ${random.int} and ${random.long} should never be used for secrets as they are numeric values with a predictable range.
Affected: Spring Boot 4.0.0–4.0.5 (fix 4.0.6), 3.5.0–3.5.13 (fix 3.5.14), 3.4.0–3.4.15 (fix 3.4.16), 3.3.0–3.3.18 (fix 3.3.19), 2.7.0–2.7.32 (fix 2.7.33); random value property source / weak PRNG for secrets. Versions that are no longer supported are also affected per vendor advisory.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Spring Bootto a version that resolves this vulnerability.Fixed in 4.0.6 - Upgrade
Upgrade
Spring Bootto a version that resolves this vulnerability.Fixed in 3.5.14 - Upgrade
Upgrade
Spring Bootto a version that resolves this vulnerability.Fixed in 3.4.16 - Upgrade
Upgrade
Spring Bootto a version that resolves this vulnerability.Fixed in 3.3.19 - Upgrade
Upgrade
Spring Bootto a version that resolves this vulnerability.Fixed in 2.7.33 - Configuration
Do not use ${random.int}, ${random.long}, or ${random.value} for secrets because they produce numeric values with predictable range / are not suitable for secrets; ${random.uuid} is not affected.
Spring Boot random value property source secret_generation = Do not use ${random.int}, ${random.long}, or ${random.value} for secrets
Event History
Frequently Asked Questions
What is the severity of CVE-2026-40975?
CVE-2026-40975 is classified as a medium severity vulnerability.
How do I fix CVE-2026-40975?
To fix CVE-2026-40975, upgrade to Spring Boot version 4.0.6, 3.5.14, or any later patched version.
What are the affected versions for CVE-2026-40975?
CVE-2026-40975 affects Spring Boot versions 4.0.0 to 4.0.5, 3.5.0 to 3.5.13, and earlier versions below 2.7.32.
What potential risks are posed by CVE-2026-40975?
CVE-2026-40975 poses risks related to the generation of predictable secret values, compromising application security.
Which methods should be avoided due to CVE-2026-40975?
Due to CVE-2026-40975, methods ${random.int} and ${random.long} should be avoided for generating secrets.