python / cpython

The Python programming language
https://www.python.org
Other
63.06k stars 30.2k forks source link

[CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator #87133

Closed 99717c59-66e9-4e07-93e9-a8e50a019e9e closed 3 years ago

99717c59-66e9-4e07-93e9-a8e50a019e9e commented 3 years ago
BPO 42967
Nosy @malemburg, @gpshead, @orsenthil, @ned-deily, @mcepl, @merwok, @encukou, @ambv, @serhiy-storchaka, @pablogsal, @miss-islington, @ret2libc, @erlend-aasland, @Fidget-Spinner, @AdamGold
PRs
  • python/cpython#24271
  • python/cpython#24297
  • python/cpython#24528
  • python/cpython#24529
  • python/cpython#24531
  • python/cpython#24532
  • python/cpython#24536
  • python/cpython#24818
  • python/cpython#25344
  • python/cpython#25345
  • Files
  • CVE-2021-23336-only-amp-as-query-sep.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/orsenthil' closed_at = created_at = labels = ['type-security', '3.8', '3.9', '3.10', 'release-blocker', '3.7', 'library'] title = '[CVE-2021-23336] urllib.parse.parse_qsl(): Web cache poisoning - `; ` as a query args separator' updated_at = user = 'https://github.com/AdamGold' ``` bugs.python.org fields: ```python activity = actor = 'vstinner' assignee = 'orsenthil' closed = True closed_date = closer = 'orsenthil' components = ['Library (Lib)'] creation = creator = 'AdamGold' dependencies = [] files = ['49839'] hgrepos = [] issue_num = 42967 keywords = ['patch'] message_count = 57.0 messages = ['385266', '385332', '385337', '385341', '385342', '385344', '385346', '385352', '385495', '385496', '385497', '385513', '385527', '385544', '385549', '385565', '385566', '385567', '385582', '385585', '385590', '385865', '386003', '386785', '386787', '386788', '386954', '386957', '386960', '386968', '386980', '387027', '387037', '387039', '387040', '387045', '387049', '387069', '387638', '387712', '387735', '387756', '388368', '388433', '388434', '388440', '388447', '388486', '388574', '390782', '390784', '390790', '391231', '405721', '405723', '405725', '405728'] nosy_count = 15.0 nosy_names = ['lemburg', 'gregory.p.smith', 'orsenthil', 'ned.deily', 'mcepl', 'eric.araujo', 'petr.viktorin', 'lukasz.langa', 'serhiy.storchaka', 'pablogsal', 'miss-islington', 'rschiron', 'erlendaasland', 'kj', 'AdamGold'] pr_nums = ['24271', '24297', '24528', '24529', '24531', '24532', '24536', '24818', '25344', '25345'] priority = 'release blocker' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'security' url = 'https://bugs.python.org/issue42967' versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10'] ```

    99717c59-66e9-4e07-93e9-a8e50a019e9e commented 3 years ago

    The urlparse module treats semicolon as a separator (https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L739) - whereas most proxies today only take ampersands as separators. Link to a blog post explaining this vulnerability: https://snyk.io/blog/cache-poisoning-in-popular-open-source-packages/

    When the attacker can separate query parameters using a semicolon (;), they can cause a difference in the interpretation of the request between the proxy (running with default configuration) and the server. This can result in malicious requests being cached as completely safe ones, as the proxy would usually not see the semicolon as a separator, and therefore would not include it in a cache key of an unkeyed parameter - such as utm_* parameters, which are usually unkeyed. Let’s take the following example of a malicious request:

    GET /?link=http://google.com&utm_content=1;link='><t>alert(1)</script> HTTP/1.1
    
    Host: somesite.com
    
    Upgrade-Insecure-Requests: 1        
    
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
    
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,imag e/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate         
    
    Accept-Language: en-US,en;q=0.9 Connection: close           

    urlparse sees 3 parameters here: link, utm_content and then link again. On the other hand, the proxy considers this full string: 1;link='><t>alert(1)</script> as the value of utm_content, which is why the cache key would only contain somesite.com/?link=http://google.com.

    A possible solution could be to allow developers to specify a separator, like werkzeug does:

    https://github.com/pallets/werkzeug/blob/6784c44673d25c91613c6bf2e614c84465ad135b/src/werkzeug/urls.py#L833

    vstinner commented 3 years ago

    Oops, I missed this issue. I just marked my bpo-42975 issue as a duplicate of this one.

    My message:

    urllib.parse.parse_qsl() uses "&" *and* ";" as separators:

    >>> urllib.parse.parse_qsl("a=1&b=2&c=3")
    [('a', '1'), ('b', '2'), ('c', '3')]
    >>> urllib.parse.parse_qsl("a=1&b=2;c=3")
    [('a', '1'), ('b', '2'), ('c', '3')]

    But the W3C standards evolved and now suggest against considering semicolon (";") as a separator:

    https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#url-encoded-form-data

    "This form data set encoding is in many ways an aberrant monstrosity, the result of many years of implementation accidents and compromises leading to a set of requirements necessary for interoperability, but in no way representing good design practices. In particular, readers are cautioned to pay close attention to the twisted details involving repeated (and in some cases nested) conversions between character encodings and byte sequences."

    "To decode application/x-www-form-urlencoded payloads (...) Let strings be the result of strictly splitting the string payload on U+0026 AMPERSAND characters (&)."

    Maybe we should even go further in Python 3.10 and only split at "&" by default, but let the caller to opt-in for ";" separator as well.

    malemburg commented 3 years ago

    On 20.01.2021 12:07, STINNER Victor wrote:

    Maybe we should even go further in Python 3.10 and only split at "&" by default, but let the caller to opt-in for ";" separator as well.

    +1.

    Personally, I've never seen URLs encoded with ";" as query parameter separator in practice on the server side.

    The use of ";" was recommended in the HTML4 spec, but only in an implementation side note:

    https://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2

    and not in the main reference:

    https://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#h-17.13.4.1

    Browsers are also pretty relaxed about seeing non-escaped ampersands in link URLs and do the right thing, so the suggested work-around for avoiding escaping is not really needed.

    malemburg commented 3 years ago

    Sorry for the title mess: It seems that when replying to a ticket, RoundUp uses the subject line as the new header regardless of what it was set to before.

    vstinner commented 3 years ago

    Sorry for the title mess: It seems that when replying to a ticket, RoundUp uses the subject line as the new header regardless of what it was set to before.

    Yeah, it's annoying :-( I like to put a module name in the issue title, to help bug triage.

    serhiy-storchaka commented 3 years ago

    It looks to me, that this is an issue of proxies, not Python. Python implementation obeys contemporary standards, and they are not formally cancelled yet. If we add an option in parse_qsl() or change its default behavior, it should be considered as a new feature which helps to mitigate proxies' issues.

    vstinner commented 3 years ago

    Python implementation obeys contemporary standards

    The contemporary standard is HTML5 and HTML5 asks to only split at "&", no?

    Fidget-Spinner commented 3 years ago

    FWIW, a surprising amount of things rely on treating ';' as a valid separator in the standard test suite.

    From just a cursory look:

    test_cgi test_urlparse

    A change in the public API of urlparse will also require a change in cgi.py's FieldStorage, FieldStorage.read_multi, parse and parse_multipart to expose that parameter since those functions forward arguments directly to urllib.parse.parse_qs internally.

    If we backport this, it seems that we will *also* need to backport all those changes to cgi's public API. Otherwise, just backporting the security fix part without allowing the user to switch would break existing code.

    Just my 2 cents on the issue. I'm not too familiar with security fixes in cpython anyways ;).

    Fidget-Spinner commented 3 years ago

    Adam, I linked a PR 2 days ago here https://github.com/python/cpython/pull/24271 , it has the test suite passing and the appropriate changes to cgi.py. Would you like to review it? Or since you submitted a PR, would you prefer I close mine instead?

    orsenthil commented 3 years ago

    Ken, Please don't close your PR. I will review it. It has a CLA signed which is helpful.

    On Fri, Jan 22, 2021 at 4:53 AM Ken Jin \report@bugs.python.org\ wrote:

    Ken Jin \kenjin4096@gmail.com\ added the comment:

    Adam, I linked a PR 2 days ago here https://github.com/python/cpython/pull/24271 , it has the test suite passing and the appropriate changes to cgi.py. Would you like to review it? Or since you submitted a PR, would you prefer I close mine instead?

    ----------


    Python tracker \report@bugs.python.org\ \https://bugs.python.org/issue42967\


    99717c59-66e9-4e07-93e9-a8e50a019e9e commented 3 years ago

    I haven't noticed, I'm sorry. I don't mind closing mine, just thought it could be a nice first contribution. Our PRs are different though - I feel like if we are to implement this, we should let the developer choose the separator and not limit to just & and ; - but that discussion probably belongs in the PR.

    merwok commented 3 years ago

    Too bad that semicolon is not recommended nowadays, it was a nice way to avoid ampersand HTML escape issues!

    One server software that generates links using semicolons is debbugs: https://bugs.debian.org/cgi-bin/pkgreport.cgi?archive=both;package=gtk3-engines-xfce;package=gtk2-engines-xfce

    Fidget-Spinner commented 3 years ago

    @Adam:

    I haven't noticed, I'm sorry. I don't mind closing mine, just thought it could be a nice first contribution.

    No worries :), please don't close yours.

    Our PRs are different though - I feel like if we are to implement this, we should let the developer choose the separator and not limit to just & and ; - but that discussion probably belongs in the PR.

    You're right, I think that's an elegant solution. In the unlikely event web standards change again in another 5 years, the user can change the arguments themselves and cpython won't have to change. And like Eric pointed out, some people do need ';'.

    @senthil I might make some changes soon, so it may not be ready for review yet. If I go ahead with the separator idea, I'll credit Adam as a co-author in the PR, which will require them to sign the CLA too.

    Fidget-Spinner commented 3 years ago

    I updated the PR to take in a sequence of separators from the user - eg:

    >>> urllib.parse.parse_qsl('a=1&b=2;c=3', separators=('&', ';'))
    [('a', '1'), ('b', '2'), ('c', '3')]
    >>> urllib.parse.parse_qsl('a=1&b=2;c=3', separators=('&',))
    [('a', '1'), ('b', '2;c=3')]

    I _didn't_ change the default - it will allow both '&' and ';' still. Eric showed a link above that still uses semicolon. So I feel that it's strange to break backwards compatibility in a patch update. Maybe we can make just '&' the default in Python 3.10, while backporting the ability to specify separators to older versions so it's up to users?

    I'm not sure, any thoughts on this? Opinions would be greatly appreciated.

    merwok commented 3 years ago

    I feel like if we are to implement this, we should let the developer choose the separator and not limit to just & and ;

    That doesn’t feel necessary to me. I suspect most links use &, some use ;, nothing else is valid at the moment and I don’t expect a new separator to suddenly appear. IMO the boolean parameter to also recognize ; was better.

    but that discussion probably belongs in the PR.

    PR discussions are generally about how to achieve the goal (fix or new feature) and quality of implementation, but tickets is where we agree on what the goal is and how to fix it (big picture).

    99717c59-66e9-4e07-93e9-a8e50a019e9e commented 3 years ago

    I _didn't_ change the default - it will allow both '&' and ';' still. Eric showed a link above that still uses semicolon. So I feel that it's strange to break backwards compatibility in a patch update. Maybe we can make just '&' the default in Python 3.10, while backporting the ability to specify separators to older versions so it's up to users?

    I like this implementation. I definitely think we should not break backwards compatibility and only change the default in Python 3.10.

    99717c59-66e9-4e07-93e9-a8e50a019e9e commented 3 years ago

    That doesn’t feel necessary to me. I suspect most links use &, some use ;, nothing else is valid at the moment and I don’t expect a new separator to suddenly appear. IMO the boolean parameter to also recognize ; was better.

    That's reasonable. However, I think that we are making this change in order to treat the semicolon as a "custom" separator. In that case, why not let the developer decide on a different custom separator for their own use cases? What's the difference between a semicolon and something else?

    merwok commented 3 years ago

    The difference is that semicolon is defined in a previous specification.

    I don’t see this change as providing support for custom delimiters in URL parsing, but offering an option to pick between two specifications.

    Fidget-Spinner commented 3 years ago

    Dear all, now that Adam has signed the CLA, I have closed my PR in favor of Adam's because I think 2 open PRs might split everyone's attention. Instead, I'll focus on reviewing Adam's PR. Sorry for any inconvenience caused.

    99717c59-66e9-4e07-93e9-a8e50a019e9e commented 3 years ago

    The difference is that semicolon is defined in a previous specification.

    I understand, but this will limit us in the future if the spec changes - though I don't have strong feelings regarding this one.

    Dear all, now that Adam has signed the CLA, I have closed my PR in favor of Adam's because I think 2 open PRs might split everyone's attention. Instead, I'll focus on reviewing Adam's PR. Sorry for any inconvenience caused.

    merwok commented 3 years ago

    Senthil, what is your opinion here?

    ned-deily commented 3 years ago

    Resolution of this issue is blocking 3.7.x and 3.6.x security releases and threatens to block upcoming maintenance releases.

    orsenthil commented 3 years ago

    Ned, and others watching.

    In future versions of Python, we can use only "&" based separator. But I am not certain what should be proposed for the older releases of Python.

    Adam's Patch is a good one to specify explicitly specify the separator, but it changes the expectations in our test cases and is not backwards compatible.

    Victor / Marc-Andre: Need your recommendation here.

    ned-deily commented 3 years ago

    Ping. This issue has been delaying 3.7.x and 3.6.x security releases. I would prefer to have it resolved before releasing.

    orsenthil commented 3 years ago

    Sorry for that, Ned. I will take a decision on this by Saturday (13-Feb).

    I did some research, but could come way conclusively. I have not heard any opinions (+ves or -ves) on this. This will be a breaking change, so necessary to support it with documentation, alerts etc.

    orsenthil commented 3 years ago

    I meant, "I did some research, but couldn't come away conclusively".

    orsenthil commented 3 years ago

    I finished reviewing this PR https://github.com/python/cpython/pull/24297

    With the contexts given in W3C recommendation, Synk.io Security Report and pattern of usage in libraries like werkzeug and bottle, instead of ignoring this and letting this behavior be handled at proxy software level, addressing this in stdlib as safe-guard seems like a much better choice to me.

    The change and the approach taken by Adam's patch looks good to me. I have requested for documentation updates and news entry and it will be merged for Python 3.10 and ported to earlier versions.

    merwok commented 3 years ago

    I also have concerns about specifics of the implementation (see PR) and in general the behaviour change in point releases. Maybe have a thread on python-dev?

    orsenthil commented 3 years ago

    Éric, I considered the possibility of bringing it in python-dev, but thought it could be decided in this ticket itself.

    1. This was already brought up by multiple Release Managers in Python-dev, and some conversation seems to have happened there previously, especially regarding backwards incompatiblity. Ofcourse, we didn't debate the implementation, but debating that seems to better to focused here and in OR. On wider group, we only to acknowledge that a backwards incompatibility is introduced.

    2. Other interested core-devs seems to have given shared their thoughts early in the bug too.

    So, once I reviewed these, I thought, it seems to okay for us to make a decision here. If there is anything particular you wanted to bring, we could.

    orsenthil commented 3 years ago

    New changeset fcbe0cb04d35189401c0c880ebfb4311e952d776 by Adam Goldschmidt in branch 'master': bpo-42967: only use '&' as a query string separator (bpo-24297) https://github.com/python/cpython/commit/fcbe0cb04d35189401c0c880ebfb4311e952d776

    vstinner commented 3 years ago

    I agree with changing the default in Python 3.6-3.10.

    orsenthil commented 3 years ago

    New changeset a2f0654b0a5b4c4f726155620002cc1f5f2d206a by Ken Jin in branch 'master': bpo-42967: Fix urllib.parse docs and make logic clearer (GH-24536) https://github.com/python/cpython/commit/a2f0654b0a5b4c4f726155620002cc1f5f2d206a

    orsenthil commented 3 years ago

    New changeset c9f07813ab8e664d8c34413c4fc2d4f86c061a92 by Senthil Kumaran in branch '3.9': [3.9] bpo-42967: only use '&' as a query string separator (GH-24297) (bpo-24528) https://github.com/python/cpython/commit/c9f07813ab8e664d8c34413c4fc2d4f86c061a92

    ambv commented 3 years ago

    New changeset e3110c3cfbb7daa690d54d0eff6c264c870a71bf by Senthil Kumaran in branch '3.8': [3.8] bpo-42967: only use '&' as a query string separator (GH-24297) (bpo-24529) https://github.com/python/cpython/commit/e3110c3cfbb7daa690d54d0eff6c264c870a71bf

    ned-deily commented 3 years ago

    New changeset d0d4d30882fe3ab9b1badbecf5d15d94326fd13e by Senthil Kumaran in branch '3.7': [3.7] bpo-42967: only use '&' as a query string separator (GH-24297) (GH-24531) https://github.com/python/cpython/commit/d0d4d30882fe3ab9b1badbecf5d15d94326fd13e

    ned-deily commented 3 years ago

    New changeset 5c17dfc5d70ce88be99bc5769b91ce79d7a90d61 by Senthil Kumaran in branch '3.6': [3.6] bpo-42967: only use '&' as a query string separator (GH-24297) (GH-24532) https://github.com/python/cpython/commit/5c17dfc5d70ce88be99bc5769b91ce79d7a90d61

    orsenthil commented 3 years ago

    This is resolved in all version of Python now. Thank you all for your contributions!

    vstinner commented 3 years ago

    I created https://python-security.readthedocs.io/vuln/urllib-query-string-semicolon-separator.html to track fixes of this vulnerability.

    gpshead commented 3 years ago

    FYI - This was somewhat of an unfortuate API change. I'm coming across code that relies on ; also being treated as a separator by parse_qs(). That code is now broken with no easy way around it.

    And I'm only seeing things lucky enough to have an explicit test that happens to rely in some way on that behavior. How much code doesn't?

    It's been a mix of some clearly broken code (ex & appearing in the URI being parsed) and code where it is not so immediately obvious if there is a problem or not (up to the code owners to dive in and figure that out...).

    The workarounds for people implementing "fixes" to previously working as intended rather than "oops that was a html charref" code are annoying. Our new separator= parameter does not allow one to achieve the previous behavior if mixing and matching & And ; was intended to be allowed, as it is a single separator rather than a set of separators.

    For security fixes, a way for people to explicitly opt-in to now-deemed-undesirable-by-default behavior they got from the API is desirable. We failed to provide that here.

    Just a heads up with no suggested remediation for now. I'm still unsure how big a problem this will turn out to be or not or if it is identifying actual worthwhile issues in code. It's certainly a headache for a few.

    4fce49d7-9c43-4783-b6f9-bd43eb64c326 commented 3 years ago

    FYI - This was somewhat of an unfortuate API change. I'm coming across code that relies on ; also being treated as a separator by parse_qs(). That code is now broken with no easy way around it.

    So far, we at openSUSE had to package at least SQLAlchemy, Twisted, yarl and furl. The author of the first one acknowledged use of semicolon as a bug. I don't think it was so bad.

    4fce49d7-9c43-4783-b6f9-bd43eb64c326 commented 3 years ago

    Port of the patch to 2.7.18.

    gpshead commented 3 years ago

    An example code snippet to detect if the API supports the new parameter at runtime for code that wants to use to use something other than the default '&'.

    if 'separator' in inspect.signature(urllib.parse.parse_qs).parameters:
        ... parse_qs(..., separator=';')
    else:
        ... parse_qs(...)

    calling it with the arg and catching TypeError if that fails would also work, but might not be preferred as catching things like TypeError is non-specific and could hide other problems, making it a code maintenance headache.

    75812c17-adc1-4b01-a122-893c543968a9 commented 3 years ago

    This CVE was reported against Python, however it does not seem to be Python's fault for supporting the ; separator, which was a valid separator for older standards.

    @AdamGold for this issue to become a real security problem, it seems that the proxy has to be configured to ignore certain parameters in the query. For NGINX and Varnish proxies mentioned in the article it seems that by default they use the entire request path, host included, and other things as cache key. For NGINX in particular I could find some snippets online to manipulate the query arguments and split them in arguments, so to remove the "utm_*" arguments, however this does not seem a standard(or at least default) behaviour, nor something easily supported.

    I think that if that is the case and a user has to go out of his way to configure the (wrong) splitting of arguments in the proxy, it is not fair to blame python for accepting ; as separator and assigning a CVE against it may cause confusion.

    For distributions this is problematic as they have 2 choices: 1) "fix" python but with the risk of breaking user's programs/scripts relying on the previous API 2) keep older version/unpatched python so that user's programs still work, but with a python version "vulnerable" to this CVE.

    None of these options is really ideal, especially if the problem is somewhere else.

    @AdamGold Could you elaborate a bit more on how common it is and how much configuration is required for proxies to make ; a problem in python?

    encukou commented 3 years ago

    With the fix, parse_qs[l] doesn't handle bytes separators correctly. There is an explicit type check for str/bytes:

        if not separator or (not isinstance(separator, (str, bytes))):
            raise ValueError("Separator must be of type string or bytes.")

    but a bytes separator fails further down:

    >>> import urllib.parse
    >>> urllib.parse.parse_qs('a=1,b=2', separator=b',')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/pviktori/dev/cpython/Lib/urllib/parse.py", line 695, in parse_qs
        pairs = parse_qsl(qs, keep_blank_values, strict_parsing,
      File "/home/pviktori/dev/cpython/Lib/urllib/parse.py", line 748, in parse_qsl
        pairs = [s1 for s1 in qs.split(separator)]
    TypeError: must be str or None, not bytes
    orsenthil commented 3 years ago

    Petr, thank you. Let's treat it as a new issue linked to this.

    75812c17-adc1-4b01-a122-893c543968a9 commented 3 years ago

    So far, we at openSUSE had to package at least SQLAlchemy, Twisted, yarl and furl. The author of the first one acknowledged use of semicolon as a bug. I don't think it was so bad.

    Did you upstream fixes for those packages?

    Asking because if this is considered a vulnerability in Python, it should be considered a vulnerability for every other tool/library that accept ; as separator. For example, Twisted seems to have a parse_qs method in web/http.py file that splits by both ; and &.

    Again, I feel like we are blaming the wrong piece of the stack, unless proxies are usually ignoring some arguments (e.g. utm_*) as part of the cache key, by default or in a very easy way.

    gpshead commented 3 years ago

    Riccardo - FWIW I agree, the wrong part of the stack was blamed and a CVE was wrongly sought for against CPython on this one.

    It's sewage under the bridge at this point. The API change has shipped in several different stable releases and thus is something virtually Python all code must now deal with.

    Why was this a bad change to make? Python's parse_qsl obeyed the prevailing HTML 4 standard at the time it was written:

    https://www.w3.org/TR/html401/appendix/notes.html#ampersands-in-uris

    ''' We recommend that HTTP server implementors, and in particular, CGI implementors support the use of ";" in place of "&" '''

    That turns out to have been bad advice in the standard. 15 years later the html5 standard quoted in Adam's snyk blog post links to its text on this which leaves no room for that interpretation.

    In that light, the correct thing to do for this issue would be to:

    Afterall, the existence of html5 didn't magically fix all of the html and web applications written in the two decades of web that came before it. Ask any browser author...

    encukou commented 3 years ago

    There's another part of the new implementation that looks a bit fishy: the separator argument now allows multi-character strings, so you can parse 'a=1b=2' with separator=''. Was this intentional?

    orsenthil commented 3 years ago

    Petr,

    On

    the separator argument now allows multi-character strings, so you can parse 'a=1b=2' with separator=''. Was this intentional?

    No, this was not intentional. The separator arg was just coice, for compatibility, if some wanted to use ; like the some URLs that were shared as use case. We didn't restrict about what was allowed or length of the separator.

    orsenthil commented 3 years ago

    New changeset b38601d49675d90e1ee6faa47f7adaeca992d02d by Ken Jin in branch 'master': bpo-42967: coerce bytes separator to string in urllib.parse_qs(l) (bpo-24818) https://github.com/python/cpython/commit/b38601d49675d90e1ee6faa47f7adaeca992d02d