Repository navigation
Bump starlette to 1.3.1 for bounded form parsing - #73302
Conversation
|
Independently reproduced this and landed on the same fix, so here's a second data point on the boundary. Ran the failing test against the published wheels either side of it:
So 1.3.1 is exactly right, not off by one. The mechanism matches the description: through 1.3.0, Two things that might be worth adding to the description, since both bear on how risky the bump is: It doesn't drag It narrows the tested range rather than widening it. One note on verification: Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting |
Was generative AI tooling used to co-author this PR?
What
Fix for CI https://github.com/apache/airflow/actions/runs/35265542917
airflow-coredeclaredstarlette>=1.0.1, so lowest-direct resolution installed 1.0.1, a version whoseapplication/x-www-form-urlencodedparser enforces no limits at all.Current behaviour
In Starlette 1.0.1, only the multipart parser enforces
max_fields. The urlencodedFormParserhas no field-count or field-size bound, andRequest._get_formdoes not wrap it in theMultiPartExceptiontoHTTPException(400)translation that the multipart branch gets.parse_login_bodyrelies on that translation: it only convertsClientDisconnect, and deliberately lets Starlette's own 400 ("Too many fields...") propagate rather than flattening it into the generic message. Below Starlette1.3.1that reliance does not hold: a 2000-field body parses cleanly,usernameandpasswordcome backNone, andLoginBodyvalidation answers 422.Beyond the test, this means the declared floor claimed support for a configuration in which the unauthenticated
POST /auth/tokenroute parses a urlencoded body with nofield-countorfield-sizebound.Changes of Note
1.3.1 is the exact boundary, established by bisecting the published wheels:
max_fieldsStarlette's 1.3.1 notes: "Enforce
max_fieldsandmax_part_sizeinFormParser" and "EnforceFormParserlimits in parser callbacks".{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.