Skip to content

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

Closed
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:source-map-tampering
Closed

process: make source map getter resistant against prototype tampering#30228
addaleax wants to merge 3 commits into
nodejs:masterfrom
addaleax:source-map-tampering

Conversation

@addaleax

Copy link
Copy Markdown
Member

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 bcoeNovember 2, 2019 20:23
@addaleaxaddaleax added the source maps Issues and PRs related to source map support. label Nov 2, 2019
Comment threadlib/internal/source_map/source_map_cache.js Outdated
Comment threadlib/internal/source_map/source_map_cache.js Outdated

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % a nit

Comment threadlib/internal/source_map/source_map_cache.js Outdated
bcoe
bcoe approved these changes Nov 4, 2019

@bcoebcoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

constbuiltInForEach=Array.prototype.forEach;Array.prototype.forEach=function(...args){process._rawDebug('ran JS after being terminated at',newError().stack);returnbuiltInForEach.call(this, ...args);}

Comment threadlib/internal/source_map/source_map_cache.js Outdated
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Nov 5, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
MemberAuthor

Landed in f17e414

@addaleaxaddaleax closed this Nov 5, 2019
@addaleax
addaleax deleted the source-map-tampering branch November 5, 2019 19:56
MylesBorins pushed 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>
@BridgeARBridgeAR mentioned this pull request Nov 19, 2019
targos pushed 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>
@BethGriggsBethGriggs mentioned this pull request Dec 9, 2019
MylesBorins pushed 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>
@BethGriggsBethGriggs mentioned this pull request Dec 23, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.source mapsIssues and PRs related to source map support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@addaleax@nodejs-github-bot@bcoe@jasnell@targos@joyeecheung@devsnek