Skip to content

Commit e03a0fb

Browse files
committed
python-ecosys/requests: Security: Add a comment documenting a problem.
HTTPS requests made with this module are hideously insecure.
1 parent 92e9b22 commit e03a0fb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

python-ecosys/requests/requests/__init__.py

+11
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ def request(
101101
s.connect(ai[-1])
102102
if proto == "https:":
103103
context = tls.SSLContext(tls.PROTOCOL_TLS_CLIENT)
104+
# TODO: This is a security vulnerability.
105+
# HTTPS is providing nearly zero security, because of the next
106+
# line. We disable all the protection against MiTM attacks!
107+
#
108+
# I mean... with this configuration, HTTPS still provides
109+
# protection against passive eavesdropping, so there's that?
110+
# But with modern network design, and modern attacks, anyone
111+
# able to passively eavesdrop is almost certainly able to MiTM
112+
# too. So the safety level is technically not quite zero, but
113+
# it is very close to zero, and is far less than people using
114+
# HTTPS expect.
104115
context.verify_mode = tls.CERT_NONE
105116
s = context.wrap_socket(s, server_hostname=host)
106117
s.write(b"%s /%s HTTP/1.0\r\n" % (method, path))

0 commit comments

Comments
 (0)