warehouse icon indicating copy to clipboard operation
warehouse copied to clipboard

Disallow trailing new line in `PROJECT_NAME_RE`

Open twm opened this issue 1 year ago • 0 comments

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 avatar Jul 15 '24 06:07 twm