Skip to content

Commit 0470e42

Browse files
author
Jake Champion
committed
Update to version 0.5.2 of js-compute-runtime
This version of js-compute-runtime includes a security fix for the `crypto.getRandomValues` method to ensure it always uses sufficiently random values. The previous version when compiled to WebAssembly, would use the same seed value for each execution of the WebAssembly module, meaning the sequence of numbers generated was predictable for a specific WebAssembly module. The new version uses a different seed value for each execution.
1 parent 01bde62 commit 0470e42

File tree

3 files changed

+41
-18
lines changed

3 files changed

+41
-18
lines changed

sdk/js-compute/CHANGELOG.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
## 0.5.2
1+
## 0.5.3 (2022-09-16)
22

3-
### Fixes
3+
### Security Fixes
4+
5+
* [CVE-2022-39218](https://github.com/fastly/js-compute-runtime/security/advisories/GHSA-cmr8-5w4c-44v8):
6+
Fixed `Math.random` and `crypto.getRandomValues` methods to always use sufficiently random values. The previous versions would use a PRNG (pseudorandom number generator) which we would seed with a random value however due to our use of [Wizer](https://github.com/bytecodealliance/wizer), the initial value to seed the PRNG was baked-in to the final WebAssembly module meaning the sequence of numbers generated was predictable for that specific WebAssembly module. The new implementations of both `Math.random` and `crypto.getRandomValues` do not use a PRNG and instead pull random values from WASI (WebAssembly System Interface) libc’s `random_get` function, which is always a sufficiently random value.
7+
8+
An attacker with access to the same WebAssembly module that calls the affected methods could use the fixed seed to predict random numbers generated by these functions. This information could be used to bypass cryptographic security controls, for example to disclose sensitive data encrypted by functions that use these generators.
9+
10+
Developers should update affected modules after applying this patch. Any secrets generated using affected versions should be rotated. Any sensitive ciphertext generated using affected versions should be considered unsafe, e.g. and be deleted or re-generated.
11+
12+
### Fixed
13+
14+
- Updated the Typescript definitions for the `console` methods to indicate that they now accept any number of objects. ([#258](https://github.com/fastly/js-compute-runtime/pull/258))
15+
16+
- Store the Object-Store key string into a native object to avoid it becoming garbage collected before being used within `ObjectStore.prototype.get` or `ObjectStore.prototype.put` (([381242](https://github.com/fastly/js-compute-runtime/commit/3812425a955e52c2fd7229e762ef3e691cb78745))
17+
18+
19+
## 0.5.2 (2022-09-02)
20+
21+
### Fixed
422

523
- Explicitly declare void as the return type for functions which return nothing - this allows our package to work with typescript's `strict:true` option ([#253](https://github.com/fastly/js-compute-runtime/pull/253))
624

7-
- Declare ambient types for our npm package instead of exports as we do not yet export anythink from the package ([#252](https://github.com/fastly/js-compute-runtime/pull/252))
25+
- Declare ambient types for our npm package instead of exports as we do not yet export anything from the package ([#252](https://github.com/fastly/js-compute-runtime/pull/252))
826

927

10-
## 0.5.1
28+
## 0.5.1 (2022-08-31)
1129

12-
### Fixes
30+
### Fixed
1331

1432
- Removed `type: "module"` from the @fastly/js-compute package.json file as the package still uses `require`
1533

16-
## 0.5.0
34+
## 0.5.0 (2022-08-30)
1735

1836
### Features
1937

@@ -79,36 +97,41 @@ console.log(request); // outputs `Request: {method: POST, url: https://www.fastl
7997
```
8098

8199

82-
### Summary
100+
### Added
83101

84102
* Implemented ObjectStore and ObjectStoreEntry classes for interacting with Fastly ObjectStore ([#110](https://github.com/fastly/js-compute-runtime/issues/110))
85-
* Improved console output for all types ([#204](https://github.com/fastly/js-compute-runtime/issues/204))
86103
* add btoa and atob native implementations ([#227](https://github.com/fastly/js-compute-runtime/issues/227)) ([8b8c31f](https://github.com/fastly/js-compute-runtime/commit/8b8c31fa9ad70337b1060a3242b8e3495ae47df3))
87104

105+
### Changed
106+
107+
* Improved console output for all types ([#204](https://github.com/fastly/js-compute-runtime/issues/204))
88108

89-
## 0.4.0
109+
## 0.4.0 (2022-07-28)
90110

91-
### Enhancements
111+
### Added
92112

93113
- Implement the DecompressionStream builtin [`#160`](https://github.com/fastly/js-compute-runtime/pull/160)
94114
- Improve performace of Regular Expression literals via precompilation [`#146`](https://github.com/fastly/js-compute-runtime/pull/146)
95115

96-
### Fixes
116+
### Fixed
97117

98118
- Calling `tee` on the client request no longer causes the application to hang [`#156`](https://github.com/fastly/js-compute-runtime/pull/156)
99119

100120
## 0.3.0 (2022-06-29)
101121

102-
### Enhancements
122+
### Added
103123

104124
- Implement the CompressionStream builtin
105125
[#84](https://github.com/fastly/js-compute-runtime/pull/84)
126+
127+
### Changed
128+
106129
- Removed the requirement for a fastly.toml file to be present when using js-compute-runtimes CLI to compile a WASM file
107130
- **Breaking change:** Removed --skip-pkg argument from js-compute-runtime's CLI
108131
[#108](https://github.com/fastly/js-compute-runtime/pull/108)
109132
- **Breaking change:** Removed `console.trace` method
110133

111-
### Fixes
134+
### Fixed
112135

113136
- Fix the response error message text
114137
- Throw an error if constructors are called as plain functions

sdk/js-compute/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/js-compute/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@fastly/js-compute",
3-
"version": "0.5.2",
4-
"js-compute-runtime-version": "0.5.0",
3+
"version": "0.5.3",
4+
"js-compute-runtime-version": "0.5.2",
55
"engines": {
66
"node": "^16 || ^18"
77
},
@@ -39,4 +39,4 @@
3939
"dependencies": {
4040
"typedoc-loopingz-theme": "^1.1.3"
4141
}
42-
}
42+
}

0 commit comments

Comments
 (0)