ses 0.14.1 → 0.15.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/NEWS.md +53 -1
  3. package/README.md +0 -1
  4. package/dist/lockdown.cjs +1769 -990
  5. package/dist/lockdown.mjs +1769 -990
  6. package/dist/lockdown.umd.js +1769 -990
  7. package/dist/lockdown.umd.min.js +1 -1
  8. package/dist/ses.cjs +1769 -990
  9. package/dist/ses.mjs +1769 -990
  10. package/dist/ses.umd.js +1769 -990
  11. package/dist/ses.umd.min.js +1 -1
  12. package/index.d.ts +1 -0
  13. package/index.js +6 -13
  14. package/package.json +24 -11
  15. package/src/commons.js +44 -9
  16. package/src/compartment-evaluate.js +102 -0
  17. package/src/compartment-shim.js +78 -106
  18. package/src/enable-property-overrides.js +5 -4
  19. package/src/enablements.js +7 -2
  20. package/src/environment-options.js +125 -0
  21. package/src/error/assert.js +51 -39
  22. package/src/error/console.js +32 -14
  23. package/src/error/fatal-assert.js +2 -0
  24. package/src/error/stringify-utils.js +26 -3
  25. package/src/error/tame-console.js +12 -2
  26. package/src/error/tame-error-constructor.js +18 -17
  27. package/src/error/tame-v8-error-constructor.js +30 -14
  28. package/src/get-anonymous-intrinsics.js +11 -8
  29. package/src/get-source-url.js +4 -4
  30. package/src/global-object.js +33 -26
  31. package/src/intrinsics.js +76 -67
  32. package/src/lockdown-shim.js +111 -119
  33. package/src/make-eval-function.js +3 -5
  34. package/src/make-function-constructor.js +3 -4
  35. package/src/make-safe-evaluator.js +117 -0
  36. package/src/module-instance.js +31 -17
  37. package/src/module-link.js +11 -4
  38. package/src/module-load.js +169 -44
  39. package/src/module-proxy.js +12 -4
  40. package/src/scope-constants.js +6 -3
  41. package/src/scope-handler.js +41 -17
  42. package/src/tame-date-constructor.js +8 -2
  43. package/src/tame-domains.js +46 -0
  44. package/src/tame-function-constructors.js +1 -0
  45. package/src/tame-locale-methods.js +6 -6
  46. package/src/tame-math-object.js +2 -2
  47. package/src/tame-regexp-constructor.js +7 -7
  48. package/src/transforms.js +13 -6
  49. package/src/whitelist-intrinsics.js +9 -3
  50. package/src/evaluate.js +0 -98
package/CHANGELOG.md CHANGED
@@ -3,6 +3,68 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.15.0](https://github.com/endojs/endo/compare/ses@0.14.4...ses@0.15.0) (2021-11-02)
7
+
8
+
9
+ ### ⚠ BREAKING CHANGES
10
+
11
+ * **ses:** Withdraw support for muli-lockdown (#921)
12
+ * **ses:** Domain taming safe by default (#917)
13
+
14
+ ### Features
15
+
16
+ * **ses:** Read lockdown options from environment ([#871](https://github.com/endojs/endo/issues/871)) ([789d639](https://github.com/endojs/endo/commit/789d639c25c6882153a8090f4bd74d350bb29721))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **ses:** Domain taming safe by default ([#917](https://github.com/endojs/endo/issues/917)) ([7039276](https://github.com/endojs/endo/commit/7039276ef91a2de2b048c91085a7557c8830f677))
22
+ * **ses:** Withdraw support for muli-lockdown ([#921](https://github.com/endojs/endo/issues/921)) ([99752b0](https://github.com/endojs/endo/commit/99752b046c2a3e2d866559bb9d58f625eb94b1a8)), closes [#814](https://github.com/endojs/endo/issues/814)
23
+
24
+
25
+
26
+ ### [0.14.4](https://github.com/endojs/endo/compare/ses@0.14.3...ses@0.14.4) (2021-10-15)
27
+
28
+
29
+ ### Features
30
+
31
+ * **ses:** lazily create evaluate ([f1cf92a](https://github.com/endojs/endo/commit/f1cf92a3b8e23aab3894f8431d8b65b4f75daa77))
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * **ses:** Add test and warning about the `has` hazard ([9066c97](https://github.com/endojs/endo/commit/9066c97b41b35a4e37fd12256a0802fb656af755))
37
+ * **ses:** more detailed `has` hazard test ([f010a9e](https://github.com/endojs/endo/commit/f010a9ebe09dadc72a8f22bd54caed8aa3787243))
38
+ * **ses:** Refactor Compartment to use shared evaluator ([dc0bad6](https://github.com/endojs/endo/commit/dc0bad6c1f963ff379e45f320852218228203050))
39
+
40
+
41
+
42
+ ### [0.14.3](https://github.com/endojs/endo/compare/ses@0.14.2...ses@0.14.3) (2021-09-18)
43
+
44
+
45
+ ### Features
46
+
47
+ * **eslint-plugin:** Add no-polymorphic-call rule ([03e8c5f](https://github.com/endojs/endo/commit/03e8c5f566a52d9d6e7fb9d876a67347ecf37324))
48
+ * **ses:** Lockdown option domainTaming ([ee3e4c3](https://github.com/endojs/endo/commit/ee3e4c309ece70249d6c95b806ca8d02549f1837))
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * **ses:** Fix reflexive imports ([d259db7](https://github.com/endojs/endo/commit/d259db75022941c4ea1881b4ca4005acc1a37a1c))
54
+ * **ses:** Search engine optimization ([#886](https://github.com/endojs/endo/issues/886)) ([ef03184](https://github.com/endojs/endo/commit/ef031843b445a4a9df7b717fba7a315371eadae0))
55
+ * add "name" to moderate override of all errors ([#867](https://github.com/endojs/endo/issues/867)) ([d608325](https://github.com/endojs/endo/commit/d608325c3edade0c64f9ca9a84379f8d3e3addf0))
56
+ * update NEWS with news of [#867](https://github.com/endojs/endo/issues/867) ([#869](https://github.com/endojs/endo/issues/869)) ([c3139d2](https://github.com/endojs/endo/commit/c3139d2ff7433afce3653639fc71a65dbe3c6313))
57
+
58
+
59
+
60
+ ### [0.14.2](https://github.com/endojs/endo/compare/ses@0.14.1...ses@0.14.2) (2021-08-14)
61
+
62
+ **Note:** Version bump only for package ses
63
+
64
+
65
+
66
+
67
+
6
68
  ### [0.14.1](https://github.com/endojs/endo/compare/ses@0.14.0...ses@0.14.1) (2021-08-13)
7
69
 
8
70
 
package/NEWS.md CHANGED
@@ -1,5 +1,57 @@
1
1
  User-visible changes in SES:
2
2
 
3
+ # 0.15.0 (2021-11-02)
4
+
5
+ - *BREAKING CHANGE*: The lockdown option `domainTaming` is now `safe` by
6
+ default, which will break any application that depends transtively on the
7
+ Node.js `domain` module.
8
+ Notably, [standard-things/esm](https://github.com/standard-things/esm)
9
+ uses domains and so SES will not support `node -r esm` going forward.
10
+
11
+ This protects against the unhardened `domain` property appearing on shared
12
+ objects like callbacks and promises.
13
+ This overcomes the last *known* obstacle toward object capability containment.
14
+ - Lockdown will now read options from the environment as defined by the Node.js
15
+ `process.env` parameter space.
16
+ - *BREAKING CHANGE*: Lockdown may no longer be called more than once.
17
+ Lockdown no longer returns a boolean to indicate whether it was effective
18
+ (true) or redundant (false). Instead, Lockdown will return undefined for
19
+ its first invocation or throw an error otherwise.
20
+
21
+ # 0.14.4 (2021-10-14)
22
+
23
+ - Fixes a defect in the per-compartment `Function` and `eval` functions, such
24
+ that these environments did not have the compartment's `globalLexicals`.
25
+ There is no known environment depending on this invariant for security
26
+ reasons, but such a scenario would be a program arranging a translator that
27
+ introduces run-time security checks, like metering, that depend on the
28
+ existence of a named global lexical.
29
+ [#898](https://github.com/endojs/endo/issues/898)
30
+ - The above fix incidentally improved the performance of compartment evaluation
31
+ for cases that do not require special global lexicals, by sharing a single
32
+ per-compartment evaluator.
33
+
34
+ # 0.14.3 (2021-09-18)
35
+
36
+ - Due to a peculiar bit of error handling code in Node 14, as explained at
37
+ [Hardened JavaScript interferes with Node.js 14 Error
38
+ construction](https://github.com/endojs/endo/issues/868),
39
+ we have added more overrides to the default `overrideTaming: 'moderate'`
40
+ setting. At this setting, assigning to the `name` property of a mutable error
41
+ instance should work. It will continue not to work at the `'min'` setting, so
42
+ use the default `'moderate'` setting if you need to.
43
+ - Adds a lockdown option `domainTaming` to detect whether Node.js domains have
44
+ been initialized and prevents them from being initialized afterward.
45
+ Domains otherwise presented a hazard to the integrity of SES containment on
46
+ Node.js.
47
+ The option defaults to `"unsafe"` in this version and will be switched to
48
+ `"safe"` by default in the next release that allows for breaking-changes, to
49
+ afford a gradual migration.
50
+ Thank you to @dominictarr with [Least Authority](https://leastauthority.com/)
51
+ for devising this feature.
52
+ - Fixes reflexive module imports. Previously, SES would fail to initialize a
53
+ module graph where a module imported an alias to itself.
54
+
3
55
  # 0.14.1 (2021-08-12)
4
56
 
5
57
  - Adds permits for `Array.prototype.at` and `String.prototype.at` which are
@@ -71,7 +123,7 @@ User-visible changes in SES:
71
123
  mistake. Most useful as `overrideTaming: 'severe', overrideDebug:
72
124
  ['constructor']`.
73
125
  - We reopened Safari bug
74
- [Object.defineProperties triggering a setter](https://bugs.webkit.org/show_bug.cgi?id=222538#c17)
126
+ [Object.defineProperties triggering a setter](https://bugs.webkit.org/show_bug.cgi?id=222538#c17)
75
127
  when we found that it was causing an infinite recursion initializing SES
76
128
  on Safari.
77
129
  - We revised an error message to include the error tag of a new error
package/README.md CHANGED
@@ -83,7 +83,6 @@ lexical versions that do not reveal the user locale.
83
83
 
84
84
  ```js
85
85
  import 'ses';
86
- import 'my-vetted-shim';
87
86
 
88
87
  lockdown();
89
88