Skip to content

Disallow trailing new line in PROJECT_NAME_RE #16278

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

Closed
wants to merge 2 commits into from

Conversation

twm
Copy link
Contributor

@twm twm commented Jul 15, 2024

I noticed this while working on #16260: the regex used to validate project names in some context permits trailing newlines in the project name. This is because in Python regexes $ matches the end of the string or a trailing newline. \Z is how you match the end of the string.

I do not think that this has any security implications because, though the equivalent Postgres constraint uses $, in Postgres $ matches only the end of the string. The constraint has been present since time immemorial.

@twm twm requested a review from a team as a code owner July 15, 2024 06:51
@twm twm force-pushed the project-name-regex branch from 3400430 to 9d7e726 Compare July 15, 2024 20:31
Copy link
Member

@miketheman miketheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable

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