-
Notifications
You must be signed in to change notification settings - Fork 72
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
fix(ses): Add Node.js domain hazard mitigation #850
Conversation
ht @dominictarr for investigating the technique applied here. |
Looks like this is going to have to sit around until we can remove support for RESM, and this will be a breaking change. |
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.
LGTM -- I hope we can merge this for real soon!
At https://github.com/endojs/endo/pull/850/checks?check_run_id=3138995713 |
This is an easy fix for a problem I’ve seen before. Instead of using The error with the -r esm packaging test is not solvable. We can’t land this until all our dependees can migrate off RESM. |
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.
Please add a section to lockdown-options.md describing this option. While you're there, please check that it does still document all options.
LGTM
@@ -0,0 +1,16 @@ | |||
# SES failed to lockdown, Node.js domains have been initialized (SES_NO_DOMAINS) |
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.
This text should also mention domainTaming
and link to an explanation.
packages/ses/src/lockdown-shim.js
Outdated
@@ -139,6 +140,7 @@ export const repairIntrinsics = ( | |||
overrideTaming = 'moderate', | |||
overrideDebug = [], | |||
stackFiltering = 'concise', | |||
domainTaming = 'unsafe', // To become 'safe' by default in next-breaking-release. |
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.
Put a TODO
in this comment text?
globalThis.process, | ||
'domain', | ||
); | ||
if (domainDescriptor !== undefined && domainDescriptor.get !== undefined) { |
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.
Why the get
test?
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.
This is an important distinction and I’ve added a comment to the effect. Node.js initializes process with a process.domain === null and replaces this with a get/set pair when domain
initializes.
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.
XXX METAMASK
|
Fixes #126