You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CWE-367 has been discovered by codeql in dist/main.js file #243
Hi @fabasoad - that CWE has very little information and doesn't appear to link to anything specific. Are you able to identify a specific dependency or source code with an issue?
Hi @mcous! I've just scanned the code with codeql and it seems dist/main.js has this vulnerability inside. Since dist/main.js is a bundle, it might be from the own code as well as from some dependency. But I haven't done the research on where this problem originally came from. Anyway, I thought you might be interested in this finding, so I've shared it with you.
Looking at the js/file-system-race description, it seems the problem here is that race condition might occur between if condition and calling readFileSync method. All this logic exists in listFileSync function which is from [email protected] dependency. So, once it is fixed in tar then it should not be detected in the current repository.
listFileSync function is not used in the current repository, but it is used in list function in tar. And list function is used in the current repository, so problematic code is reachable.
Thanks for the analysis! Do you see a viable "attack" here? Certainly I'm down to keep the tar dependency up to date, but tar only comes into play if you provide a tarball to this action's input. In addition, we only read the tarball to find a package.json file.
If something were to maliciously mess with the tarball in a way that could exploit this race, at worst, the publish action would misunderstand the version of the package being published. I struggle to see how this could be reasonably exploited, given the npm registry itself will reject bad versions
TL;DR: I'm more than happy to keep tar up to date, but as of now, I don't see any actionable security issue here. As I've mentioned before, I think the most secure option is to avoid using this action and call npm publish directly
If something were to maliciously mess with the tarball in a way that could exploit this race, at worst, the publish action would misunderstand the version of the package being published. I struggle to see how this could be reasonably exploited, given the npm registry itself will reject bad versions
Agree with the conclusion. Feel free to close the issue if you feel that it is not relevant or it's not going to be addressed. Thank you for quick responses.
Thanks for your diligence! Might be worth flagging in node-tar if you haven't already, but otherwise I'm gonna close this issue in favor of regular Dependabot alerts
Activity
mcous commentedon Sep 18, 2025
Hi @fabasoad - that CWE has very little information and doesn't appear to link to anything specific. Are you able to identify a specific dependency or source code with an issue?
fabasoad commentedon Sep 18, 2025
Hi @mcous! I've just scanned the code with
codeqland it seemsdist/main.jshas this vulnerability inside. Sincedist/main.jsis a bundle, it might be from the own code as well as from some dependency. But I haven't done the research on where this problem originally came from. Anyway, I thought you might be interested in this finding, so I've shared it with you.fabasoad commentedon Sep 18, 2025
Let me look into it now 👀
fabasoad commentedon Sep 18, 2025
In total there are 2 places:
Place 1: main.js, line 3635
Looking at the js/file-system-race description, it seems the problem here is that race condition might occur between
ifcondition and callingreadFileSyncmethod. All this logic exists inlistFileSyncfunction which is from[email protected]dependency. So, once it is fixed intarthen it should not be detected in the current repository.listFileSyncfunction is not used in the current repository, but it is used inlistfunction intar. Andlistfunction is used in the current repository, so problematic code is reachable.Place 2: main.js, line 3639
It is basically very much the same. Same function (just in
elsestatement). Same dependency. Same reachability.IMO, there are 2 ways to solve this problem:
tarlibrary, release new version and then use new version in this repository.tarlibrary (or at leastlistFileSyncfunction from it) and use something else.mcous commentedon Sep 18, 2025
Thanks for the analysis! Do you see a viable "attack" here? Certainly I'm down to keep the
tardependency up to date, buttaronly comes into play if you provide a tarball to this action's input. In addition, we only read the tarball to find apackage.jsonfile.If something were to maliciously mess with the tarball in a way that could exploit this race, at worst, the publish action would misunderstand the
versionof the package being published. I struggle to see how this could be reasonably exploited, given the npm registry itself will reject bad versionsTL;DR: I'm more than happy to keep
tarup to date, but as of now, I don't see any actionable security issue here. As I've mentioned before, I think the most secure option is to avoid using this action and callnpm publishdirectlyfabasoad commentedon Sep 19, 2025
Agree with the conclusion. Feel free to close the issue if you feel that it is not relevant or it's not going to be addressed. Thank you for quick responses.
mcous commentedon Sep 19, 2025
Thanks for your diligence! Might be worth flagging in
node-tarif you haven't already, but otherwise I'm gonna close this issue in favor of regular Dependabot alertsfabasoad commentedon Sep 22, 2025
Just for the reference, I've opened a pull request in
node-tarrepository to fix this problem: isaacs/node-tar#444