[CVE-2022-28355] Scala.js should not provide a cryptographically insecure `UUID.randomUUID()` implementation
See original GitHub issueI’m specifically referencing this section of code:
The Java 8 docs for UUID.randomUUID()
state:
Static factory to retrieve a type 4 (pseudo randomly generated) UUID. The UUID is generated using a cryptographically strong pseudo random number generator.
Furthermore, https://github.com/tc39/proposal-uuid states that:
Developers who have not been exposed to RFC 4122 might naturally opt to invent their own approaches to UUID generation, potentially using
Math.random()
(in TIFU by usingMath.random()
there’s an in-depth discussion of why a Cryptographically-Secure-Pseudo-Random-Number-Generator (CSPRNG) should be used when generating UUIDs).
It’s unclear to me how a developer cross-compiling their library or application for Scala.js should become aware that in fact they cannot rely on UUID.randomUUID()
for cryptographically strong UUIDs.
This seems a lot like a CVE to me.
See also discussion in https://github.com/typelevel/cats-effect/issues/2882#issuecomment-1079502344.
PS would be good to set up a security policy at https://github.com/scala-js/scala-js/security.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:20 (18 by maintainers)
Top GitHub Comments
We received the CVE number CVE-2022-28355 for this issue.
Yes, that is expected. Please read the release notes: http://www.scala-js.org/news/2022/04/04/announcing-scalajs-1.10.0/