bpo-42967: only use '&' as a query string separator #24297
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
bpo-42967: [security] urllib.parse.parse_qsl(): Web cache poisoning - `;` as a query args separator
|
@AdamGold I went ahead and re-ran the CLA bot and it seems you signed the CLA here :). BTW, what are your thoughts about combining our PRs into one? I already added you as a Co-author to PR-24271, meaning the final commit will show us both as commit authors. I also wanted to use some really nice ideas from this PR if you're okay with it. |
|
@Fidget-Spinner Sounds like a good idea, do you want me to checkout to your branch and push a commit? |
|
@AdamGold sorry I changed my mind, I decided to close my PR in favor of this one, because I think 2 open PRs might split core devs' attention. I'll just review this one instead. |
|
Some things:
Other than those nits, and waiting for decision on the bpo about whether to boolean switch or allow user selection, I think this PR is quite well done :). |
|
@Fidget-Spinner Thanks! much appreciated. |
Yup, however it uses parse_qsl internally somewhere, so I'm guessing we probably still have to pass it in (most of its |
From the docs:
I honestly don't know enough about CGI to tell - how is the query string being used there? |
So I didn't know this either, but a POST form can contain a query string too... |
|
I prefered the other version that always split on |
@Fidget-Spinner implemented. |
|
Just a process note: github’s user experience is not great for reviewers when a PR has its history rewritten. |
|
@merwok Just saw this comment - noted, will be following this from now on. |
@merwok - This is a good thinking, and I originally thought along the lines of stick with '&' or just '&' and ';' in some form. Taking werkzeug package example (used in Flask and other projects) made it think that it's very reasonable to with a separator argument, with default as
is taken care by this patch.
The breaking change is disallowing both |
|
I think, using the separator with '&' as default seems much better than not providing any option change and strictly use '&' as this moment. We will only need a documentation that highlights this behavior and change in behavior from past and this patch can be merged. |
|
@orsenthil Where should I write this documentation? |
|
Sorry, @AdamGold and @orsenthil, I could not cleanly backport this to |
|
Sorry @AdamGold and @orsenthil, I had trouble checking out the |
|
Sorry, @AdamGold and @orsenthil, I could not cleanly backport this to |
|
Sorry @AdamGold and @orsenthil, I had trouble checking out the |
bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]> (cherry picked from commit fcbe0cb)
…4297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]>. (cherry picked from commit fcbe0cb) Co-authored-by: Adam Goldschmidt <[email protected]>
|
GH-24528 is a backport of this pull request to the 3.9 branch. |
bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]> (cherry picked from commit fcbe0cb)
…4297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]>. (cherry picked from commit fcbe0cb) Co-authored-by: Adam Goldschmidt <[email protected]>
|
GH-24529 is a backport of this pull request to the 3.8 branch. |
bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]> (cherry picked from commit fcbe0cb)
…4297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]>. (cherry picked from commit fcbe0cb) Co-authored-by: Adam Goldschmidt <[email protected]>
|
GH-24531 is a backport of this pull request to the 3.7 branch. |
bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]> (cherry picked from commit fcbe0cb)
…4297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]>. (cherry picked from commit fcbe0cb) Co-authored-by: Adam Goldschmidt <[email protected]>
|
GH-24532 is a backport of this pull request to the 3.6 branch. |
|
CVE-2021-23336 has been assigned. |
…24528) (cherry picked from commit fcbe0cb) * [3.9] bpo-42967: only use '&' as a query string separator (GH-24297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Adam Goldschmidt <[email protected]>
…24529) * bpo-42967: only use '&' as a query string separator (#24297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]> (cherry picked from commit fcbe0cb) * [3.8] bpo-42967: only use '&' as a query string separator (GH-24297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Éric Araujo <[email protected]>. (cherry picked from commit fcbe0cb) Co-authored-by: Adam Goldschmidt <[email protected]> * Update correct version information. * fix docs and make logic clearer Co-authored-by: Adam Goldschmidt <[email protected]> Co-authored-by: Fidget-Spinner <[email protected]>
…H-24531) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Adam Goldschmidt <[email protected]> (cherry picked from commit fcbe0cb)
…H-24532) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <[email protected]> Co-authored-by: Ken Jin <[email protected]> Co-authored-by: Adam Goldschmidt <[email protected]>
bpo-42967: [security] urllib.parse.parse_qsl(): Web cache poisoning -
;as a query args separatorhttps://bugs.python.org/issue42967
Co-authored-by: Ken Jin [email protected]