Skip to content
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

process: make source map getter resistant against prototype tampering #30228

Closed
wants to merge 3 commits into from

Conversation

@addaleax
Copy link
Member

addaleax commented Nov 2, 2019

Since this code runs during process and Worker shutdown, it should not
call user-provided code and thereby e.g. provide a way to break out of
worker.terminate().

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Since this code runs during process and Worker shutdown, it should not
call user-provided code and thereby e.g. provide a way to break out of
`worker.terminate()`.
@addaleax addaleax requested a review from bcoe Nov 2, 2019
@addaleax addaleax added the source maps label Nov 2, 2019
…mpering
Copy link
Member

joyeecheung left a comment

LGTM % a nit

lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
@bcoe
bcoe approved these changes Nov 4, 2019
Copy link
Member

bcoe left a comment

this looks reasonable to me, you tested the earlier example you shared with me:

const builtInForEach = Array.prototype.forEach;
Array.prototype.forEach = function(...args) {
  process._rawDebug('ran JS after being terminated at', new Error().stack);
  return builtInForEach.call(this, ...args);
}
lib/internal/source_map/source_map_cache.js Outdated Show resolved Hide resolved
…mpering
@nodejs-github-bot

This comment has been minimized.

@targos
targos approved these changes Nov 4, 2019
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@jasnell
jasnell approved these changes Nov 5, 2019
@nodejs-github-bot

This comment has been minimized.

addaleax added a commit that referenced this pull request Nov 5, 2019
Since this code runs during process and Worker shutdown, it should not
call user-provided code and thereby e.g. provide a way to break out of
`worker.terminate()`.

PR-URL: #30228
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax

This comment has been minimized.

Copy link
Member Author

addaleax commented Nov 5, 2019

Landed in f17e414

@addaleax addaleax closed this Nov 5, 2019
@addaleax addaleax deleted the addaleax:source-map-tampering branch Nov 5, 2019
MylesBorins added a commit that referenced this pull request Nov 17, 2019
Since this code runs during process and Worker shutdown, it should not
call user-provided code and thereby e.g. provide a way to break out of
`worker.terminate()`.

PR-URL: #30228
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Nov 19, 2019
targos added a commit that referenced this pull request Dec 1, 2019
Since this code runs during process and Worker shutdown, it should not
call user-provided code and thereby e.g. provide a way to break out of
`worker.terminate()`.

PR-URL: #30228
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Dec 9, 2019
MylesBorins added a commit that referenced this pull request Dec 17, 2019
Since this code runs during process and Worker shutdown, it should not
call user-provided code and thereby e.g. provide a way to break out of
`worker.terminate()`.

PR-URL: #30228
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.