| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
this should be benchmarked as it is a pretty central function. |
Sorry, something went wrong.
|
I've made a few changes based on the suggestions, there are more to be made still (such as fixing imports) I'll go through the file tonight |
Sorry, something went wrong.
|
When ready, I'll squash |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
It should be faster, but I dont think we can benchmark it as it "only" speeds up the startup time of node. |
Sorry, something went wrong.
Yes, most of the time. I've noticed that is it used during runtime (a bit).
|
Sorry, something went wrong.
StringPrototypeSlice is probably slower than String.prototype.slice |
Sorry, something went wrong.
Probably a tiny bit, but it presents less of a security issue, as a user can overwrite String.prototype.slice |
Sorry, something went wrong.
|
Just for the performance comparison: |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
|
I'll fix the lint issue and squash today. |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
I'm ready to merge when you are |
Sorry, something went wrong.
This PR requires a full CI run before landing. However, because there's a security release in preparation, the CI request is queued up (notice your PR has the request-ci Add this label to start a Jenkins CI on a PR. label). Once the security release is out, the CI will be unlocked, and it will start processing PRs. |
Sorry, something went wrong.
|
I think the proposition in the PR description is misleading - primordials are not a security measure and they never will be because we will never enforce them throughout the codebase. They are only a UX enhancement (e.g. don't blow up the process just because someone patched a global prototype). |
Sorry, something went wrong.
|
I think further special casing in JS land is not ideal - we should just add --no- entries to the options map/dictionary. And to that end we should split the map into two - one for option -> value pairs, another for option -> option information, so the first one can have additional --no- entries while the second one doesn't need it. I opened #52451 to implement that. |
Sorry, something went wrong.
There was a problem hiding this comment.
Hey, thanks for this PR! I don't understand this change - this code runs when Node boots before an user code runs when options values are checked (right?)
I think that implies that prototypes cannot be polluted at this point doesn't it?
Sorry, something went wrong.
While this code is ran before runtime, it code is also used during runtime. This means that prototype pollution, while not possible for all cli arguments, is possible for some. |
Sorry, something went wrong.
Can you give an example? |
Sorry, something went wrong.
Sorry, something went wrong.
Sure! With a snippet like const startsWith = String.prototype.startsWith;
Object.defineProperty(String.prototype, "startsWith", {
value: function (search, pos) {
if (search === "--no-") {
process.nextTick(() => {
console.log(this, search, pos);
});
}
return startsWith.call(this, search, pos);
}
})we can see exactly what uses it during runtime. For example, when I run fetch("https://www.google.com/"), I get the following output: [String: '--network-family-autoselection'] --no- undefined [String: '--insecure-http-parser'] --no- undefined [String: '--trace-tls'] --no- undefined [String: '--tls-keylog'] --no- undefined [String: '--tls-cipher-list'] --no- undefined [String: '--tls-min-v1.0'] --no- undefined [String: '--tls-min-v1.1'] --no- undefined [String: '--tls-min-v1.2'] --no- undefined [String: '--tls-min-v1.3'] --no- undefined [String: '--tls-max-v1.3'] --no- undefined [String: '--tls-max-v1.2'] --no- undefined [String: '--max-http-header-size'] --no- undefined |
Sorry, something went wrong.
|
out/Release/node /Users/iojs/build/workspace/node-test-commit-osx-arm/nodes/osx11/test/pummel/test-crypto-timing-safe-equal-benchmarks.js Failed a test run, I don't think this change had anything to do with it, but idk |
Sorry, something went wrong.
There was a problem hiding this comment.
Ah, didn't realize, thanks makes sense (as reliability)
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
Hi Team, I noticed that the CI bot keeps re-CI-ing this PR, isn't that a waste of resources? Is there a reason for this? |
Sorry, something went wrong.
|
It's not re-CI it's manual due to flakiness |
Sorry, something went wrong.
Ah, thanks! |
Sorry, something went wrong.
|
@aduh95 you beat me to it with adding the commit queue label 😃 |
Sorry, something went wrong.
|
Great work, everyone! |
Sorry, something went wrong.
🎉 |
Sorry, something went wrong.
PR-URL: #52440 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #52440 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #52440 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
| Back | FazBrowse Home | New Git URL |
This PR replaces the use of overridable functions (in strings) with alternatives, to prevent user interference when processing cli options