ses 0.18.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NEWS.md +26 -1
- package/README.md +4 -4
- package/dist/lockdown.cjs +3516 -3332
- package/dist/lockdown.mjs +3516 -3332
- package/dist/lockdown.umd.js +3516 -3332
- package/dist/lockdown.umd.min.js +1 -1
- package/dist/ses.cjs +3516 -3332
- package/dist/ses.mjs +3516 -3332
- package/dist/ses.umd.js +3516 -3332
- package/dist/ses.umd.min.js +1 -1
- package/index.js +3 -31
- package/package.json +12 -7
- package/src/assert-shim.js +4 -0
- package/src/assert-sloppy-mode.js +11 -0
- package/src/compartment-shim.js +11 -288
- package/src/compartment.js +292 -0
- package/src/enablements.js +1 -1
- package/src/error/console.js +4 -0
- package/src/error/internal-types.js +2 -2
- package/src/error/note-log-args.js +2 -3
- package/src/error/tame-console.js +38 -4
- package/src/error/types.js +4 -4
- package/src/get-anonymous-intrinsics.js +1 -1
- package/src/global-object.js +8 -6
- package/src/lockdown-shim.js +19 -379
- package/src/lockdown.js +409 -0
- package/src/make-safe-evaluator.js +2 -2
- package/src/permits.js +14 -5
- package/src/tame-date-constructor.js +37 -21
- package/src/tame-math-object.js +20 -1
- package/types.d.ts +29 -9
package/NEWS.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
User-visible changes in SES:
|
|
2
2
|
|
|
3
|
+
# v0.18.8 (2023-09-11)
|
|
4
|
+
|
|
5
|
+
- Extracts `repairIntrinsics(options)` and `hardenIntrinsics()` from the
|
|
6
|
+
behavior of `lockdown(options)` so vetted shims can run between these
|
|
7
|
+
calls.
|
|
8
|
+
Any modifications to shared intrinsics survive if applied after
|
|
9
|
+
`repairIntrinsics()`.
|
|
10
|
+
- In the SES-shim implementation of HardenedJS, all constructed compartments
|
|
11
|
+
get the same safe `Date` constructor, that does not provide the ability to
|
|
12
|
+
measure duration.
|
|
13
|
+
It used to do this by having `Date.now()` return `NaN`, and to have calls on
|
|
14
|
+
the constructor that would normally have returned an indication of the
|
|
15
|
+
current date, instead return the corresponding invalid date indication.
|
|
16
|
+
Now, all of these throw a `TypeError` whose message begins with `'secure
|
|
17
|
+
mode'`.
|
|
18
|
+
This aligns with the XS implementation of HardenedJS.
|
|
19
|
+
- Similarly, In the SES-shim implementation of HardenedJS, all constructed
|
|
20
|
+
compartments get the same safe `Math` namespace object that does not provide
|
|
21
|
+
a working `random()` function.
|
|
22
|
+
It used to do that by omitting the `random` property from the safe `Math`
|
|
23
|
+
namespace object.
|
|
24
|
+
Now, the safe shared `Math` namespace object has a `Math.random()` function
|
|
25
|
+
that throws a `TypeError whose message begins with `'secure mode'`.
|
|
26
|
+
This again aligns with the XS implementation of HardenedJS.
|
|
27
|
+
|
|
3
28
|
# v0.18.6 (2023-08-07)
|
|
4
29
|
|
|
5
30
|
- Censors the pattern `{...import(specifier)`}.
|
|
@@ -44,7 +69,7 @@ User-visible changes in SES:
|
|
|
44
69
|
- Fixes a bug for SES initialization in a no-unsafe-eval
|
|
45
70
|
Content-Security-Policy.
|
|
46
71
|
- Fixes a bug where reexport of multiple named exports of the same name was
|
|
47
|
-
causing them to be overridden by the last value. Now named exports are
|
|
72
|
+
causing them to be overridden by the last value. Now named exports are
|
|
48
73
|
handled in the same manner as `export *`.
|
|
49
74
|
- Allows Compatment `importHook` implementations to return aliases: module
|
|
50
75
|
descriptors that refer to a module by its specifier in the same or a
|
package/README.md
CHANGED
|
@@ -194,7 +194,8 @@ c1.globalThis.JSON === c2.globalThis.JSON; // true
|
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
The global scope of every compartment includes a shallow, specialized copy of
|
|
197
|
-
the JavaScript intrinsics,
|
|
197
|
+
the JavaScript intrinsics, disabling `Math.random`, `Date.now` and the
|
|
198
|
+
behaviors of the `Date` constructor which would reveal the current time.
|
|
198
199
|
Comaprtments leave these out since they can be used as covert communication
|
|
199
200
|
channels between programs.
|
|
200
201
|
However, a compartment may be expressly given access to these objects
|
|
@@ -722,7 +723,7 @@ have found the object capability model that `ses` provides to be sound.
|
|
|
722
723
|
Hardened JavaScript is also within the scope of the [Agoric bug bounty
|
|
723
724
|
program](https://hackerone.com/agoric), which rewards researchers for surfacing valid
|
|
724
725
|
bugs in our code. We welcome the opportunity to cooperate with researchers,
|
|
725
|
-
whose efforts will undoubtedly yield stronger, more resilient code.
|
|
726
|
+
whose efforts will undoubtedly yield stronger, more resilient code.
|
|
726
727
|
|
|
727
728
|
## Bug Disclosure
|
|
728
729
|
|
|
@@ -768,7 +769,7 @@ provide some place to include text like
|
|
|
768
769
|
> option.
|
|
769
770
|
> Specifically, [link to source in the project] does not work correctly in such
|
|
770
771
|
> an environment.
|
|
771
|
-
>
|
|
772
|
+
>
|
|
772
773
|
> Please consider increasing support by replacing assignments to object
|
|
773
774
|
> properties inherited from intrinsics with use of `Object.defineProperties`
|
|
774
775
|
> (thereby working around the JavaScript "override mistake"), and if applicable
|
|
@@ -791,4 +792,3 @@ intrinsics, including `ses`.
|
|
|
791
792
|
[SES proposal]: https://github.com/tc39/proposal-ses
|
|
792
793
|
[SES Strategy Group]: https://groups.google.com/g/ses-strategy
|
|
793
794
|
[SES Strategy Recordings]: https://www.youtube.com/playlist?list=PLzDw4TTug5O1jzKodRDp3qec8zl88oxGd
|
|
794
|
-
|