| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5500ae9 commit 1737352
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -74,6 +74,8 @@ const asyncHook = createHook({ | |||
| 74 | 74 | if (process.domain !== null && process.domain !== undefined) { | |
| 75 | 75 | // If this operation is created while in a domain, let's mark it | |
| 76 | 76 | pairing.set(asyncId, process.domain[kWeak]); | |
| 77 | + // Promises from other contexts, such as with the VM module, should not | ||
| 78 | + // have a domain property as it can be used to escape the sandbox. | ||
| 77 | 79 | if (type !== 'PROMISE' || resource instanceof Promise) { | |
| 78 | 80 | ObjectDefineProperty(resource, 'domain', { | |
| 79 | 81 | configurable: true, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,8 @@ const kEnabled = Symbol('enabled'); | |||
| 31 | 31 | // twice the async_wrap.Providers list is used to filter the events. | |
| 32 | 32 | const nativeProviders = new SafeSet(ObjectKeys(async_wrap.Providers)); | |
| 33 | 33 | const typeMemory = new SafeMap(); | |
| 34 | + | ||
| 35 | + // Promises are not AsyncWrap resources so they should emit trace_events here. | ||
| 34 | 36 | nativeProviders.delete('PROMISE'); | |
| 35 | 37 | ||
| 36 | 38 | function createHook() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments