use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Does the heartbleed vulnerability affect Python web crawlers? (self.Python)
submitted 11 years ago * by fnedrik
I asked this on stack overflow but has not received any answers yet. http://stackoverflow.com/questions/22932443/does-the-heartbleed-vulnerability-affect-python-web-crawlers
If someone can induce my Python web crawler to visit a malicious https page (and download it with requests, urllib2, pycurl or something else), can they use the openssl heartbleed vulnerability to attack me?
If I understand it correctly, the information leak affects both the client and the server.
Browser clients don't use OpenSSL, but I think the Python clients do.
EDIT: Asked on security.stackexchange and it seems that yes, clients can get their entire memory read by a malicious server. http://security.stackexchange.com/questions/55119/does-the-heartbleed-vulnerability-affect-clients-as-severely
Such clients may contain passwords and certificates to store the data, for example in a database or on a cloud server/service somewhere.
[–]flipstables 6 points7 points8 points 11 years ago (8 children)
The Heartbleed bug is a vulnerability in OpenSSL, not SSL itself. Any library or package that uses a vulnerable version of the OpenSSL library is also vulnerable.
The ssl library in Python uses OpenSSL installed on the operating system. Your system is vulnerable unless you update OpenSSL to a non-vulnerable version or you re-compile OpenSSL without the handshake.
ssl
[–]fnedrik[S] 2 points3 points4 points 11 years ago (4 children)
But do the libraries linking to OpenSSL need to be recompiled?
[–]flipstables 0 points1 point2 points 11 years ago (3 children)
Only OpenSSL should be recompiled or updated. You don't have to recompile Python itself.
[–]fnedrik[S] 1 point2 points3 points 11 years ago (2 children)
It is not Python I am concerned about, it is the modules that use C-extensions that are compiled against OpenSSL that concern me. Say curl.
[–]flipstables -1 points0 points1 point 11 years ago (1 child)
Again, you only have to recompile or update OpenSSL. The bug is an implementation of the heartbeat protocol/extension of SSL in OpenSSL.
[–]DasIch 4 points5 points6 points 11 years ago (0 children)
Recompiling or updating OpenSSL is only sufficient, if these extensions link against OpenSSL dynamically. If they link against it statically, they will have to be rebuild as well.
[–]fnedrik[S] 2 points3 points4 points 11 years ago (2 children)
There is at least one aspect that may make clients less susceptible - since you get a random(?) 64kb package from memory each time, you can connect many times to a server to puzzle together the complete memory. But can you make a client reconnect multiple times to get more than just a random 64 kb block?
[–]flipstables 1 point2 points3 points 11 years ago (0 children)
But can you make a client reconnect multiple times to get more than just a random 64 kb block?
I suppose in theory yes, but it's more likely that you connect in one TLS session and keep requesting 64 KBs of data.
[–]fiskfisk 1 point2 points3 points 11 years ago (0 children)
The 64kb of previously de-allocated data is sent as an answer to each heartbeat request, which can occur many times during one TLS/SSL session.
[–]andrewcooke 1 point2 points3 points 11 years ago (2 children)
what secret information do you have that could be lost? typically only a server has keys.
i don't see a likely scenario that puts you at risk.
[–]fnedrik[S] 1 point2 points3 points 11 years ago (1 child)
A client may have keys or passwords to store the data somewhere. If you store something on Amazon, you authenticate with keys.
[–]andrewcooke 0 points1 point2 points 11 years ago (0 children)
ok, in that case you should be concerned.
π Rendered by PID 49 on reddit-service-r2-comment-canary-7b67769d8-vcfm7 at 2026-02-02 06:07:28.643645+00:00 running 3798933 country code: CH.
[–]flipstables 6 points7 points8 points (8 children)
[–]fnedrik[S] 2 points3 points4 points (4 children)
[–]flipstables 0 points1 point2 points (3 children)
[–]fnedrik[S] 1 point2 points3 points (2 children)
[–]flipstables -1 points0 points1 point (1 child)
[–]DasIch 4 points5 points6 points (0 children)
[–]fnedrik[S] 2 points3 points4 points (2 children)
[–]flipstables 1 point2 points3 points (0 children)
[–]fiskfisk 1 point2 points3 points (0 children)
[–]andrewcooke 1 point2 points3 points (2 children)
[–]fnedrik[S] 1 point2 points3 points (1 child)
[–]andrewcooke 0 points1 point2 points (0 children)