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

Uploaded asset names with unsupported characters are not checked against asset spec, and cannot be downloaded #188

Open
nmichlo opened this issue Jun 20, 2023 · 0 comments

Comments

@nmichlo
Copy link

nmichlo commented Jun 20, 2023

After diving into the code, modelkit lists the following regex for asset names:

GENERIC_ASSET_NAME_RE = (
    r"(([A-Z]:\\)|/)?[a-zA-Z0-9]([a-zA-Z0-9\-\_\.\/\\]*[a-zA-Z0-9])?"
)

However:

  1. uploaded assets and sub-files are not checked against this.
  2. This does not include all valid URI and file name characters.

I uploaded a file that was named something similar to file__id==version, and because == is invalid according to the regex. The file could be uploaded, but when specified in a model config for the asset it freezes when trying to resolve the asset and no error is throw. The asset also cannot be downloaded via code.

@nmichlo nmichlo changed the title Uploaded asset names are not checked against asset spec Uploaded asset names with unsupported characters are not checked against asset spec, and cannot be downloaded Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant