- Notifications
You must be signed in to change notification settings - Fork 147
Announcing Scala.js 1.10.0. #571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| | ||
| **This releases addresses a security vulnerability in `java.util.UUID.randomUUID()`.** | ||
| We strongly recommend that all users upgrade to Scala.js 1.10.0 as soon as possible. | ||
| Read [the security advisory](https://github.com/scala-js/scala-js/security/advisories) for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure that somewhere, we list the affected Scala.js versions of this (IIUC, basically all of them, but it's still important we make that clear).
| | ||
| ### `java.util.UUID.randomUUID()` now depends on `java.security.SecureRandom`, which is provided by external libraries | ||
| | ||
| Until Scala.js 1.9.x, `java.util.UUID.randomUUID()` was implemented using `java.util.Random`, which was not cryptographically secure, and was therefore a security issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd propose using present tense:
which is not cryptographically secure.
There is ambiguity in whether "which" refers to the randomUUID implementation or ju.Random. If interpreted as referring to ju.Random, this might be construed as ju.Random now being cryptographically secure. If interpreted as referring to the implementation, it is merely a change of tense about the previous statement.
| This means that code that was previously calling `java.util.UUID.randomUUID()` will now fail to link. | ||
| To preserve binary compatibility, we introduce two variants of a library that provides `java.security.SecureRandom`: | ||
| | ||
| * [`scalajs-java-securerandom`](https://github.com/scala-js/scala-js-java-securerandom) provides a *correct*, cryptographically secure implementation of `java.security.SecureRandom`, but relies on the Node.js `crypto` package or the Web Crypto API `crypto.getRandomValues` to be available (e.g., in browsers). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/package/module/ ? IIUC a package in this context would mean something you need to install via npm. Which is not necessary.
| | ||
| As mentioned above, this will only work in environments that either provide the Web Crypto API, or Node.js' `crypto` package. | ||
| | ||
| If you need random UUID generation in other environments, we encourage you to implement it yourselves, in a way that corresponds to your requirements in terms of security and collision likelihood. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is good that we try to provide guidance that goes beyond "use fake insecure otherwise". However, wouldn't the next step here be something like: "Find if your environment has a cryptographic random primitive and PR it to scalajs-java-securerandom"? Maybe with an intermediate "shim it onto crypto.getRandomValues".
| | ||
| If you need random UUID generation in other environments, we encourage you to implement it yourselves, in a way that corresponds to your requirements in terms of security and collision likelihood. | ||
| | ||
| If you have **no other choice**, depend on `scalajs-fake-insecure-securerandom` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good that this cannot be copy pasted from the release notes.
| | ||
| If you have **no other choice**, depend on `scalajs-fake-insecure-securerandom` instead. | ||
| As its name implies, this is an *insecure* implementation, and you should get rid of this dependency as soon as possible. | ||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for completeness, a short paragraph about the optimizations you're teasing in the introduction would be nice I think.
0d8e702 to c9e5c45 Compare | Updated. I think I have addressed all comments. I also added release notes and documentation for |
fb903b4 to c2d0512 Compare
Writing this up in advance.