Skip to content
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

Crashes (and potential code injection) if pwd contains spaces or special characters #12

Closed
jimrandomh opened this issue Dec 6, 2022 · 2 comments · Fixed by #31
Closed
Labels

Comments

@jimrandomh
Copy link

https://github.com/gajus/pg-formatter/blob/master/src/format.js#L112 runs perl with an executablePath which is not properly quoted. If the working-directory name contains spaces or other special characters, they will be interpreted as shell syntax. In the normal case, someone made the mistake of checking out their project to a directory with spaces in a parent path, and this winds up crashing. (This happened to another developer on my team). In the worst case, admittedly an unlikely case given how this library would normally be used but definitely not impossible, this is running in a context where the parent path has an attacker-controlled directory name in it, and this injects arbitrary shell or perl code.

@github-actions
Copy link

github-actions bot commented Oct 6, 2023

🎉 This issue has been resolved in version 2.0.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@npdev453
Copy link
Contributor

npdev453 commented Oct 6, 2023

@jimrandomh, Hi! Could you please review a changes in new release? And maybe can ask another developer on your team to check it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants