question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CVE-2022-28355] Scala.js should not provide a cryptographically insecure `UUID.randomUUID()` implementation

See original GitHub issue

I’m specifically referencing this section of code:

https://github.com/scala-js/scala-js/blob/058532aa8c504b76431b40e3e1b51b2cdef87643/javalib/src/main/scala/java/util/UUID.scala#L139-L147

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 using Math.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:closed
  • Created a year ago
  • Reactions:1
  • Comments:20 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
sjrdcommented, Apr 2, 2022

We received the CVE number CVE-2022-28355 for this issue.

1reaction
gzm0commented, Apr 6, 2022

Yes, that is expected. Please read the release notes: http://www.scala-js.org/news/2022/04/04/announcing-scalajs-1.10.0/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing Scala.js 1.10.0
Until Scala.js 1.9.x, java.util.UUID.randomUUID() was implemented using java.util.Random , which is not cryptographically secure.
Read more >
CVE-2022-28355
Scala.js should not provide a cryptographically insecure `UUID.randomUUID()` implementation · Issue #4657 · scala-js/scala-js · GitHub ...
Read more >
Scala.js on Twitter: "#Scala.js 1.10.0 is released! It fixes a ...
#Scala.js 1.10.0 is released! It fixes a security issue in java.util.UUID.randomUUID(), registered as CVE-2022-28355. We strongly recommend all ...
Read more >
Security Vulnerabilities Related To CWE-330 - CVE Details
# CVE ID CWE ID Publish Date Update Date Score Gained Access Level 1 CVE‑2022‑44795 330 2022‑11‑07 2022‑11‑08 0.0 None 2 CVE‑2022‑42787 330 2022‑11‑10 2022‑12‑02...
Read more >
Cautionary note: UUIDs generally do not meet security ...
I illustrate that it is absolutely trivial to break the JavaScript randomUUID() when it is used for something like authentication tokens. This ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found