Skip to content

Remove redundant check in ID validation logic #43

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheFocusDevHUN
Copy link

Since INVALID_TOKEN_PATTERN catches the dot character, the path.contains(".") check appears to be redundant when validating paste ids.
regex
Feel free to correct me if I'm wrong or missing something.

@lucko
Copy link
Owner

lucko commented Jun 14, 2025

Was just an abundance of caution - very keen to avoid path traversal vulnerabilities

@TheFocusDevHUN
Copy link
Author

TheFocusDevHUN commented Jun 14, 2025

Was just an abundance of caution - very keen to avoid path traversal vulnerabilities

Okay, so you want to leave it there? I still don't really get it's purpose considering the regex. Are there some weird edge cases that I'm not aware of where this simple pattern cannot catch dots? Could you elaborate?

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

Successfully merging this pull request may close these issues.

2 participants