Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:

> @xtreak the encoded null-byte test would be an extra test case to consider. 
> It is reasonable to test as many known invalid sequences as possible. 
> Changing that byte to encoded notation would just replace one test with 
> another effectively changing the semantics of it.

Agreed that it's slightly different but I also admit I was also relying on the 
fact that encoded request will also be decoded by the server as done in most 
web frameworks to act upon the decoded payload. There could be systems where 
raw null byte might need to be transferred where the receiving system might not 
decode the payload but it seemed to be a workaround to ensure the required 
exception of serving null byte included static file was handled properly by 
CherryPy and also seemed to be adopted by others like urllib3.

> To me, it's quite weird that it's considered a CVE at all: it's happening on 
> the client side and it doesn't prevent the user from just feeding the proper 
> bytes right into the socket so why overcomplicate things?

The impacted function in http is used by functions like urllib.urlopen which is 
often feeded with input from the user that is not validated properly with some 
expectation that the function itself might handle the URL parsing and is safe 
enough. In this case it could lead to things like SSRF where malicious input 
could end up executing arbitrary code in some of the systems like Redis as 
demonstrated in the report. As for the CVE in question it was originally 
reported to golang and the same attack was also found out to be vulnerable. The 
fix adopted also seemed to have address few other security reports of similar 
nature.

Thanks Jason, as issue38216 is now a separate issue we can discuss around 
there. I guess this issue then is not a 3.7 only regression anymore since the 
original issue reported predates 3.7.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36274>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to