Skip to content

Conversation

matrixise
Copy link
Member

@matrixise matrixise commented Feb 6, 2019

Copy link
Contributor

@eamanu eamanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@push0ebp
Copy link
Contributor

push0ebp commented Feb 7, 2019

Sorry, I'm late. I'm this bug reporter.
I recommend you to encode URL, but for the previous versions, it will cause double encoding.
it may be better not to encode. after splitting lines, If it gets only the first line without remains lines, the availability may be broken. it may be OK? How about removing line breaks for preserving all of the lines. If you don't need to recommit against this commit necessarily, I also think that this commit may be OK.

@matrixise
Copy link
Member Author

@push0ebp encode the URL?

@push0ebp
Copy link
Contributor

yes, but because the previous versions haven't encoded the URL, I think that urlopen() shouldn't encode the URL. it may avoid encoding(quote) two times in previous versions.
So, truncating remained lines will be OK?. How about remove CRLF for preserving the other lines?.
or raise the exception?
Actually, 3.4.6- versions which aren't be affected by this vulnerability raise the exception(no host ~~blabla).
try it with same payload.

https://bugs.python.org/issue35906#msg335005

@tomashek
Copy link

tomashek commented Apr 4, 2019

Is this part of the accepted resolution of CVE-2019-9947? If so, what is blocking the merging of this PR? There has been no action for many weeks.

@mcepl
Copy link
Contributor

mcepl commented Apr 15, 2019

I would vote for accepting this solution. Could anybody tell me any perceivable legal URL containing \r\n combination?

@matrixise
Copy link
Member Author

matrixise commented Apr 15, 2019 via email

@Plazmaz
Copy link

Plazmaz commented Apr 15, 2019

@mcepl There are no urls that are valid containing unencoded \r\n as far as I can tell. In cases where newlines are needed (such as in params) they should be url encoded

@mcepl
Copy link
Contributor

mcepl commented Apr 15, 2019

@mcepl There are no urls that are valid containing unencoded \r\n as far as I can tell. In cases where newlines are needed (such as in params) they should be url encoded

And if they are already not, that it is malformed URL and so it shouldn't be fixed but rejected. I am really turning towards OpenJDK has it right.

@Plazmaz
Copy link

Plazmaz commented Apr 15, 2019

There's two important things here.

  1. This is still unpatched and easily exploitable.
  2. The best way to fix it is whitelisting vs blacklisting
    I suggest getting a solution out the door ASAP, then change the approach to whitelisting valid characters moving forwards in a second release

@mcepl
Copy link
Contributor

mcepl commented Apr 17, 2019

OK, I am leaning against this PR and closer to putting #2303 as a patch to all SUSE packages. I just have to torture @vstinner to explain what did he mean by #2303 (comment) . Does it mean that the solution should be somewhere lower in the stack (http.client?).

@vstinner
Copy link
Member

OK, I am leaning against this PR and closer to putting #2303 as a patch to all SUSE packages. I just have to torture @vstinner to explain what did he mean by #2303 (comment) . Does it mean that the solution should be somewhere lower in the stack (http.client?).

https://bugs.python.org/issue30500 has been fixed differently and not directly related to https://bugs.python.org/issue30458

@csabella
Copy link
Contributor

csabella commented May 29, 2019

Thank you for the patch. Based on the last message on this ticket, this is fixed in bpo-30458, so I'm closing this pull request. Please add a comment to bpo-30458 if you believe needs further discussion. Thanks!

@csabella csabella closed this May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.