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

$ and : should be illegal in uploaded filenames #909

Open
kb-1000 opened this issue Apr 25, 2024 · 5 comments
Open

$ and : should be illegal in uploaded filenames #909

kb-1000 opened this issue Apr 25, 2024 · 5 comments
Labels
bug For issues where things aren't working as intended

Comments

@kb-1000
Copy link

kb-1000 commented Apr 25, 2024

Describe the bug

Especially on Windows, those characters are illegal in filenames and will break anything that just uses the filename provided by modrinth in the API or URL. On some platforms, filenames containing .. (two dots) may have special meaning as well.

Steps to reproduce

  1. Upload a file containing : in its name
  2. It uploads successfully without escaping.

Expected behavior

It should fail.

Additional context

This has been found thanks to https://cdn.modrinth.com/data/PmwWNPV6/versions/5v69ptOa/Technical%20Electrical%3A%20Whimsical%20Wonders-4.1.3.mrpack

@kb-1000 kb-1000 added the bug For issues where things aren't working as intended label Apr 25, 2024
@brawaru
Copy link
Contributor

brawaru commented Apr 28, 2024

The sanitisation of the paths is the responsibility of the program. Some elements illegal in Windows paths aren't illegal in Unix paths, and vice versa. Modrinth modpacks are distributed outside of Modrinth as well, so if you trust on Modrinth to do the basic security stuff for you, you set yourself for failure.

@TacoGS
Copy link

TacoGS commented Apr 30, 2024

That is an interesting mentality for an API to take. Instead of resolving illegal characters issue as a single upstream source they kick it down to the downstream app developers to do it X number of times.

@kb-1000
Copy link
Author

kb-1000 commented Apr 30, 2024

Note that I'm not referring to the files mentioned by the modpack index, I'm referring to the filename of the modpack file, or other uploaded files.

@Prospector
Copy link
Member

We could probably fix this going forward but anything that downloads files should do the job of sanitizing the file name for the operating system. For example, this is what browsers do if you try to download that file in a browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For issues where things aren't working as intended
Development

No branches or pull requests

5 participants