[Bug 1969810] [NEW] python 3.10: SSLObject does not raise SSLEOFError on OpenSSL 3

Simon Chopin 1969810 at bugs.launchpad.net
Thu Apr 21 16:30:02 UTC 2022


*** This bug is a security vulnerability ***

Public security bug reported:

>From https://github.com/python/cpython/issues/90471 :

--------

PR bpo-25309 (#25309) changed OpenSSL behavior so that it ignores
unexpected EOFs by default. This was detected by the test suites of both
trio and AnyIO when running on OpenSSL 3.

We worked around the problem by explicitly unsetting the
SSL_OP_IGNORE_UNEXPECTED_EOF flag and then checking if the "strerror"
attribute of SSLError contains the text "UNEXPECTED_EOF_WHILE_READING".

The remedy in the standard library would be twofold:

    Revert the change of enabling SSL_OP_IGNORE_UNEXPECTED_EOF by default
    Handle the condition properly so that SSLEOFError is raised instead of the generic SSLError

As SSLSockets ignore SSLEOFError by default, this fix should work fine
for those too.

--------

There isn't any upstream PR associated with this AFAICT.

** Affects: python3.10 (Ubuntu)
     Importance: High
         Status: New


** Tags: rls-jj-incoming

** Tags added: rls-jj-incoming

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python3.10 in Ubuntu.
https://bugs.launchpad.net/bugs/1969810

Title:
  python 3.10: SSLObject does not raise SSLEOFError on OpenSSL 3

Status in python3.10 package in Ubuntu:
  New

Bug description:
  From https://github.com/python/cpython/issues/90471 :

  --------

  PR bpo-25309 (#25309) changed OpenSSL behavior so that it ignores
  unexpected EOFs by default. This was detected by the test suites of
  both trio and AnyIO when running on OpenSSL 3.

  We worked around the problem by explicitly unsetting the
  SSL_OP_IGNORE_UNEXPECTED_EOF flag and then checking if the "strerror"
  attribute of SSLError contains the text
  "UNEXPECTED_EOF_WHILE_READING".

  The remedy in the standard library would be twofold:

      Revert the change of enabling SSL_OP_IGNORE_UNEXPECTED_EOF by default
      Handle the condition properly so that SSLEOFError is raised instead of the generic SSLError

  As SSLSockets ignore SSLEOFError by default, this fix should work fine
  for those too.

  --------

  There isn't any upstream PR associated with this AFAICT.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3.10/+bug/1969810/+subscriptions




More information about the foundations-bugs mailing list