Skip to content

[3.14] gh-134698: Hold a lock when the thread state is detached in ssl (GH-134724) #137107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.14
Choose a base branch
from

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Jul 25, 2025

Lock when the thread state is detached.
(cherry picked from commit e047a35)

… in `ssl` (pythonGH-134724)

Lock when the thread state is detached.
(cherry picked from commit e047a35)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

Thanks for doing the backport.

@gpshead
Copy link
Member Author

gpshead commented Jul 25, 2025

@hugovk - up to you when this should merge for 3.14. it is a bug, but it has been around for a while. Traditionally RMs pick and choose what go in an RC to minimize changes to reduce release surprises, leaving whatever they deem less urgent as bug fixes for the .1 release. Your call.

@gpshead
Copy link
Member Author

gpshead commented Jul 25, 2025

intentionally not marking this as a release blocker as it doesn't seem that fundamental.

@Conobi
Copy link

Conobi commented Jul 26, 2025

it doesn't seem that fundamental

I'm not sure I understand the basis for this reasoning @gpshead, as the direct consequence of this is that any application that takes advantage of concurrency (for e.g FastAPI/Django Channels/LiteStart/Celery with Eventelet) and uses mTLS authentication for calling an API (for example with Requests, which hasn't released a fix yet), is then vulnerable. As the mTLS authentication pattern is very common in banking/finance/governemental apps, it means that Python apps in these orgs are very likely to vulnerable to DOS attacks.

It was the case for our app, I'm sure it's the case for a lot of others one in the nature.

@Conobi
Copy link

Conobi commented Jul 26, 2025

As of a consequence of not backporting it @gpshead, is that no app can be fixed (unless a manual monkeypatch) until the Requests nor Python 3.14 release. It means thousands of apps vulnerables in the nature to a very simple DOS attack until then.

@gpshead
Copy link
Member Author

gpshead commented Jul 26, 2025

rationale: The bug this fixes has existed for a very long time and seems likely to be present in all basically all Python releases. Not something that needs to be a priority release blocker during our release candidate phase. ie: It isn't a regression in behavior or compatibility present only in 3.14.

If you want it to be considered a security bug, please report it with some form of proof of concept of being able to trigger the hang or crash remotely to security@python.org. (without that, we won't be back porting this to anything earlier than 3.13)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge topic-SSL type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy