Skip to content
Heist/ feed
Back to feed
MediumFix available

python3 — security advisory

Type: advisorySources: OSVAdvisory ID: ALPINE-CVE-2023-40217

An issue was discovered in Python before 3.8.18, 3.9.x before 3.9.18, 3.10.x before 3.10.13, and 3.11.x before 3.11.5. It primarily affects servers (such as HTTP servers) that use TLS client authentication. If a TLS server-side socket is created, receives data into the socket buffer, and then is closed quickly, there is a brief window where the SSLSocket instance will detect the socket as "not connected" and won't initiate a handshake, but buffered data will still be readable from the socket buffer. This data will not be authenticated if the server-side TLS peer is expecting client certificate authentication, and is indistinguishable from valid TLS stream data. Data is limited in size to the amount that will fit in the buffer. (The TLS connection cannot directly be used for data exfiltration because the vulnerable code path requires that the connection be closed on initialization of the SSLSocket.)

Products
python3
Affected versions
Not specified
Fixed versions
3.10.13-r0, 3.11.5-r0, 3.9.18-r0
CVEs
CVE-2023-40217
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 14:59 UTC · Revision 1

Source evidence

ALPINE-CVE-2023-40217

core-osv · Original source

Published 25 Aug 2023, 01:15 UTC

An issue was discovered in Python before 3.8.18, 3.9.x before 3.9.18, 3.10.x before 3.10.13, and 3.11.x before 3.11.5. It primarily affects servers (such as HTTP servers) that use TLS client authentication. If a TLS server-side socket is created, receives data into the socket buffer, and then is closed quickly, there is a brief window where the SSLSocket instance will detect the socket as "not connected" and won't initiate a handshake, but buffered data will still be readable from the socket buffer. This data will not be authenticated if the server-side TLS peer is expecting client certificate authentication, and is indistinguishable from valid TLS stream data. Data is limited in size to the amount that will fit in the buffer. (The TLS connection cannot directly be used for data exfiltration because the vulnerable code path requires that the connection be closed on initialization of the SSLSocket.)

osv:ALPINE-CVE-2023-40217

python3

Fixed versions: 3.9.18-r0

python3

Fixed versions: 3.10.13-r0

python3

Fixed versions: 3.10.13-r0

python3

Fixed versions: 3.11.5-r0

python3

Fixed versions: 3.11.5-r0

python3

Fixed versions: 3.11.5-r0

python3

Fixed versions: 3.11.5-r0

python3

Fixed versions: 3.11.5-r0

python3

Fixed versions: 3.11.5-r0

python3

Fixed versions: 3.11.5-r0

Complete source record
{
  "id": "a78f43dfcfabd8ed92a443fa6bdf4942dbba1802ae96cfdf5b0ab18be7b33aa2",
  "url": "https://osv.dev/vulnerability/ALPINE-CVE-2023-40217",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "ALPINE-CVE-2023-40217",
    "summary": "An issue was discovered in Python before 3.8.18, 3.9.x before 3.9.18, 3.10.x before 3.10.13, and 3.11.x before 3.11.5. It primarily affects servers (such as HTTP servers) that use TLS client authentication. If a TLS server-side socket is created, receives data into the socket buffer, and then is closed quickly, there is a brief window where the SSLSocket instance will detect the socket as \"not connected\" and won't initiate a handshake, but buffered data will still be readable from the socket buffer. This data will not be authenticated if the server-side TLS peer is expecting client certificate authentication, and is indistinguishable from valid TLS stream data. Data is limited in size to the amount that will fit in the buffer. (The TLS connection cannot directly be used for data exfiltration because the vulnerable code path requires that the connection be closed on initialization of the SSLSocket.)",
    "evidence": "osv:ALPINE-CVE-2023-40217",
    "products": [
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.9.18-r0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.10.13-r0",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.10.13-r0",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.11.5-r0",
            "evidence": "/affected/3/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.11.5-r0",
            "evidence": "/affected/4/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.11.5-r0",
            "evidence": "/affected/5/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.11.5-r0",
            "evidence": "/affected/6/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.11.5-r0",
            "evidence": "/affected/7/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/8/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.11.5-r0",
            "evidence": "/affected/8/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "python3",
          "evidence": "/affected/9/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.11.5-r0",
            "evidence": "/affected/9/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "ALPINE-CVE-2023-40217",
      "aliases": [
        "ALPINE-CVE-2023-40217"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.9.18-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.15"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.10.13-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.16"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.10.13-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.17"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.11.5-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.18"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.11.5-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.19"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.11.5-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.20"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.11.5-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.21"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.11.5-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.22"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.11.5-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.23"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "3.11.5-r0"
                }
              ]
            }
          ],
          "package": {
            "name": "python3",
            "purl": "pkg:apk/alpine/python3?arch=source",
            "ecosystem": "Alpine:v3.24"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2023-40217.json"
          },
          "ecosystem_specific": {}
        }
      ],
      "modified": "2026-10-26T17:17:58.637926054Z",
      "provider": "osv",
      "upstream": [
        "CVE-2023-40217"
      ],
      "references": [
        "https://security.alpinelinux.org/vuln/CVE-2023-40217"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2023-40217",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 454485,
  "published_at": "2023-08-25T01:15:09.017+00:00"
}