Repository navigation
--policy-integrity - #28734
--policy-integrity#28734bmeck wants to merge 19 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
commented
Jul 17, 2019
|
@vsemozhetbyt can do |
Co-Authored-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
| are used to provide a kind of selective "early warning" mechanism that | ||
| developers may leverage to detect deprecated API usage. | ||
|
|
||
| ### `--policy-integrity` |
There was a problem hiding this comment.
This should be --policy-integrity=checksum with some explanation about the expected format of the argument (checksum or a more appropriate word if the argument isn't actually a checksum).
There was a problem hiding this comment.
Yes, I think linking to mdn should be ok. (and rename my suggested parameter name to sri instead of checksum).
Co-Authored-By: Richard Lau <riclau@uk.ibm.com>
Co-Authored-By: mscdex <mscdex@users.noreply.github.com>
Co-Authored-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Co-Authored-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
| [experimental ECMAScript Module]: esm.html#esm_resolve_hook | ||
| [libuv threadpool documentation]: http://docs.libuv.org/en/latest/threadpool.html | ||
| [remote code execution]: https://www.owasp.org/index.php/Code_Injection | ||
| [Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity No newline at end of file |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
these don't seem to be in alphabetical order though?
There was a problem hiding this comment.
Bottom references are usually sorted in ASCII order, case and punctuation are taken into account.
| Emit pending deprecation warnings. | ||
| . | ||
| .It Fl -policy-integrity=sri | ||
| Instructs Node.js to error prior to running any code if the policy does not have the specified integrity. It expects a [Subresource Integrity] string as a parameter. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Co-Authored-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Co-Authored-By: Richard Lau <riclau@uk.ibm.com>
commented
Jul 19, 2019
|
Should the flag be explicitly labeled Experimental stability the way (for example) |
|
@bmeck Actually, I wonder if this is showing a potential problem for cross-platform teams using these policy files anyway. Maybe the thing to do is calculate the hash (All this is me assuming the hash value is the problem to begin with and not something else. Feel free to hide my comments if I'm making the wrong assumption.) |
commented
Jul 19, 2019
|
Surely the same problem would apply to all files managed by the policy? Such that some time of sanitization in the integrity process might make sense? Eg to define that the integrity in the policy is the integrity of the source with any |
commented
Jul 19, 2019
|
(ah sorry @Trott you beat me to it!) |
commented
Jul 19, 2019
People can generate multiple values and place them into the policy file since SRI allows you to have multiple integrity values. We could do that for these tests or we could swap the policy file we use. I think having the same policy with the multiple integrity values makes more sense.
Anytime someone changes value in a file this is true. If someone converted
We don't want to do that to binary files and I'm not keen on even doing this to CJS/JSON. Just add the expected alternative integrity to your policy file. Lack of magic is ideal here. A system altering line endings could have some unknown affect and should be added to the policy as a valid integrity for a resource. |
commented
Jul 19, 2019
@bmeck Ah, yes, that sounds ideal. |
commented
Jul 20, 2019
commented
Jul 20, 2019
commented
Jul 20, 2019
|
Tests now pass on Windows Just a few insignificant JS linting things to tidy in the test and then I think we're good.... |
commented
Jul 20, 2019
|
Took the liberty of doing the ESLint fixes myself and pushing to the branch. Will run CI again. |
This comment has been minimized.
This comment has been minimized.
commented
Jul 20, 2019
commented
Jul 20, 2019
|
Landed in 6c288a7 |
This allows mitigating if a policy file is changed on disk and prevents
nodefrom running with the modified file. An attacker would need to modify the command that runsnodein order to escape this mitigation.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes