diff --git a/graph.fabro b/graph.fabro new file mode 100644 index 000000000..68f937b78 --- /dev/null +++ b/graph.fabro @@ -0,0 +1,31 @@ +digraph SWEBench { + graph [goal="UsernameValidator allows trailing newline in usernames +Description + +ASCIIUsernameValidator and UnicodeUsernameValidator use the regex +r'^[\w.@+-]+$' +The intent is to only allow alphanumeric characters as well as ., @, +, and -. However, a little known quirk of Python regexes is that $ will also match a trailing newline. Therefore, the user name validators will accept usernames which end with a newline. You can avoid this behavior by instead using \A and \Z to terminate regexes. For example, the validator regex could be changed to +r'\A[\w.@+-]+\Z' +in order to reject usernames that end with a newline. +I am not sure how to officially post a patch, but the required change is trivial - using the regex above in the two validators in contrib.auth.validators. +"] + rankdir=LR + + start [shape=Mdiamond] + exit [shape=Msquare] + + setup [label="Setup", shape=parallelogram, script="git clone https://github.com/django/django.git . && git checkout d26b2424437dabeeca94d7900b37d2df4410da0c && python -m pip install -e ."] + solve [label="Solve", prompt="Fix this GitHub issue in the repository. Make the minimal code change needed.\n\nUsernameValidator allows trailing newline in usernames +Description + +ASCIIUsernameValidator and UnicodeUsernameValidator use the regex +r'^[\w.@+-]+$' +The intent is to only allow alphanumeric characters as well as ., @, +, and -. However, a little known quirk of Python regexes is that $ will also match a trailing newline. Therefore, the user name validators will accept usernames which end with a newline. You can avoid this behavior by instead using \A and \Z to terminate regexes. For example, the validator regex could be changed to +r'\A[\w.@+-]+\Z' +in order to reject usernames that end with a newline. +I am not sure how to officially post a patch, but the required change is trivial - using the regex above in the two validators in contrib.auth.validators. +"] + extract_patch [label="Extract Patch", shape=parallelogram, script="git diff"] + + start -> setup -> solve -> extract_patch -> exit +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 000000000..cf012f182 --- /dev/null +++ b/manifest.json @@ -0,0 +1,13 @@ +{ + "run_id": "01KKTJ36NGEFF7W3RGFTYKHRKA", + "workflow_name": "SWEBench", + "goal": "UsernameValidator allows trailing newline in usernames\nDescription\n\t\nASCIIUsernameValidator and UnicodeUsernameValidator use the regex \nr'^[\\w.@+-]+$'\nThe intent is to only allow alphanumeric characters as well as ., @, +, and -. However, a little known quirk of Python regexes is that $ will also match a trailing newline. Therefore, the user name validators will accept usernames which end with a newline. You can avoid this behavior by instead using \\A and \\Z to terminate regexes. For example, the validator regex could be changed to\nr'\\A[\\w.@+-]+\\Z'\nin order to reject usernames that end with a newline.\nI am not sure how to officially post a patch, but the required change is trivial - using the regex above in the two validators in contrib.auth.validators.\n", + "start_time": "2026-03-16T05:32:31.642306Z", + "node_count": 5, + "edge_count": 4, + "run_branch": "fabro/run/01KKTJ36NGEFF7W3RGFTYKHRKA", + "base_sha": "470fcfe1200b2102c0cdf91c73b0ed8d925f258a", + "base_branch": "main", + "workflow_slug": "django__django-11099", + "host_repo_path": "/Users/bhelmkamp/p/fabro-sh/fabro/evals/swe-bench/results/haiku-baseline/runs/django__django-11099" +} \ No newline at end of file diff --git a/sandbox.json b/sandbox.json new file mode 100644 index 000000000..c60db964c --- /dev/null +++ b/sandbox.json @@ -0,0 +1,5 @@ +{ + "provider": "daytona", + "working_directory": "/home/daytona/workspace", + "identifier": "fabro-01KKTJ36NGEFF7W3RGFTYKHRKA" +} \ No newline at end of file