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

app.name may not be filesafe #1258

Closed
1 of 3 tasks
Black-Platypus opened this issue Oct 7, 2024 · 2 comments · Fixed by #1259
Closed
1 of 3 tasks

app.name may not be filesafe #1258

Black-Platypus opened this issue Oct 7, 2024 · 2 comments · Fixed by #1259

Comments

@Black-Platypus
Copy link
Contributor

Issue Type

  • Bug Report
  • Feature Request
  • Other

Current/Missing Behaviour

When using an app name that includes illegal characters for filenames, renaming nw.exe (etc) may fail or lead to unintended behavior (also maybe path traversal?)

Expected/Proposed Behaviour

The executable is renamed taking the above into account

Additional Info

  • Package version: 4.11.3
  • Operating System: Windows 10 x64
  • Node version: v20.9.0, 22.7.0
  • NW.js version: 0.92.0

Depending on whether the final executable path needs to be known after it was created or not, I think there should be a remedy either in the parsing stage or the renaming stage.
I would encourage getting everything prepared ahead of taking any action, so I'd like to suggest ideally having a theoretical stage where everything is prepared, or at least making sure the app.name is file safe in the parsing stage, to minimize issues arising from potential differences between app.name and the resulting executable name.

@Black-Platypus
Copy link
Contributor Author

PRs:
Parsing stage: #1259
Renaming stage (windows): #1260

@ayushmanchhabra
Copy link
Collaborator

@Black-Platypus Thanks for the PRs, I'll try to review them over next couple days

ayushmanchhabra added a commit that referenced this issue Oct 9, 2024
* This mitigates potential path traversal.

Fixes: #1258

---------

Co-authored-by: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants