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

script: Filename and folder name testing is too restrictive and unsecure #1386

Open
theVAX opened this issue Jan 24, 2025 · 1 comment · May be fixed by #1388
Open

script: Filename and folder name testing is too restrictive and unsecure #1386

theVAX opened this issue Jan 24, 2025 · 1 comment · May be fixed by #1388
Labels
bug(fix) Something isn't working or address a specific issue or vulnerability

Comments

@theVAX
Copy link
Member

theVAX commented Jan 24, 2025

Currently, the regular expressions defined in the script.py module (at this location) do not allow spaces in filenames or folder names. This restriction may prevent the use of scripts in directories or files with spaces in their names, which is a common scenario.

Expected Behavior
The regular expressions should accommodate spaces in both filenames and folder names. For example:

A filename like my script.py should be valid.
A folder like project files/ should also be valid.
Suggested Changes
Update the regular expressions in the script.py file to include support for spaces. Specifically:

Allow spaces (\s) where filenames or folder names are defined in the regular expression.
Ensure that this change does not break any existing functionality or introduce regressions.
Additional Notes

Be mindful of potential edge cases where spaces at the beginning or end of filenames/folder names could cause issues.
If applicable, add or update unit tests to validate the new behavior.
Environment

Thank you for considering this improvement!

@phorward phorward changed the title Allow Spaces in Filenames and Folder Names in Regular Expressions Script: Allow spaces in filenames and folder names Jan 24, 2025
@phorward
Copy link
Member

phorward commented Jan 24, 2025

We should just use File.is_valid_filename() for this.

@phorward phorward added this to the ViUR-core v3.7 milestone Jan 24, 2025
@phorward phorward added the bug(fix) Something isn't working or address a specific issue or vulnerability label Jan 24, 2025
@phorward phorward changed the title Script: Allow spaces in filenames and folder names script: Filename and folder name testing is too restrictive and unsecure Jan 24, 2025
phorward added a commit to phorward/viur-core that referenced this issue Jan 24, 2025
@phorward phorward linked a pull request Jan 24, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug(fix) Something isn't working or address a specific issue or vulnerability
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants