-
Notifications
You must be signed in to change notification settings - Fork 32
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
Ignore files that have a null
byte
#30
Comments
Interesting, thanks @brianmhunt So let's see if I understand—null bytes are a security concern for |
Yes, that is my understanding. |
To add to this issue, I'm also getting it with @jlmakes Would you be interested in a PR as @brianmhunt suggested above, to simply ignore any file names with a null byte in them? This happens to be holding back a major PR for our codebase. 😕 |
If it's just the one-liner he suggested I don't mind implementing it and bumping to Edit: Just cut a new release. Let me know if this bug still bites @OverZealous @brianmhunt |
That would be awesome! It fixed my issue when I added it manually. I just did this: Watch.prototype.start = function() {
this.clean()
this.buffer.forEach(m => {
if (m.includes('\u0000')) { return } /// <-- here
if (!this.watchList.has(m)) { But it could just as easily be merged with existing |
Worked great for me! Thanks a ton! |
Cross-linking rollup/rollup-plugin-commonjs#268
rollup-plugin-commonjs generates a file with a null byte called
\u0000commonjsHelpers
. This causesfs.stat
to fail via the path here (with long paths shortened to...
):There is probably a better way, but the best I can figure is karma-rollup-preprocessor is the easiest place to fix this, by simply checking for the presence of a null byte before adding a file to the watch list. If a filename has a null byte, ignore it.
A better solution would to be to not have filenames generated in plugins and injected into the watch list, but I'm sure there's a good reason for that.
The test is just
if (m.includes('\u0000')) { return }
inside the respectiveforEach
functions atWatch.prototype.start
andWatch.prototype.clean
.Generally it's considered a security issue if a filename has a null byte, and disallowed in many languages (e.g. Python), so I expect it's a safe change. See eg https://security.stackexchange.com/a/45958/2914
The text was updated successfully, but these errors were encountered: