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

[Minor-Security] String formatting function is prone to misuse / abuse #2336

Closed
2 of 4 tasks
espoal opened this issue Oct 17, 2023 · 1 comment
Closed
2 of 4 tasks

Comments

@espoal
Copy link

espoal commented Oct 17, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The string formatting function is prone to misuse / abuse, due to poor behaviour on special characters.

In a monorepo setup you could overwrite the main package.json by mistake.

With a little bit of creativity it's possible to use shell expansion to do a bit of damage to the filesystem by overwriting possibly important files.

Minimum reproduction code

https://github.com/espoal/kebab-or-snake

Steps to reproduce

Type

nest new -s

When prompted for a name give

$test

Expected behavior

The $ should be dropped from the name (or kept) and the app should be created in the test ($test) folder.

Package version

10.1.7

NestJS version

No response

Node.js version

18.16.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

Incidentally, this issue is fixed by these PRs:

@espoal espoal changed the title [Minor][Security] String formatting function is prone to misuse / abuse [Minor-Security] String formatting function is prone to misuse / abuse Oct 17, 2023
@kamilmysliwiec
Copy link
Member

Let's track this here then #2208

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

No branches or pull requests

2 participants