Title: CPython 3.13: consolidated memory-safety and concurrency bugs · Issue #157196 · python/cpython · GitHub
Open Graph Title: CPython 3.13: consolidated memory-safety and concurrency bugs · Issue #157196 · python/cpython
X Title: CPython 3.13: consolidated memory-safety and concurrency bugs · Issue #157196 · python/cpython
Description: Hello, This issue consolidates 25 reproducible CPython 3.13 bugs involving memory safety and concurrency. The bugs resulted from Python security research using static analysis. Each entry has a concrete PoC in the linked version-specific...
Open Graph Description: Hello, This issue consolidates 25 reproducible CPython 3.13 bugs involving memory safety and concurrency. The bugs resulted from Python security research using static analysis. Each entry has a con...
X Description: Hello, This issue consolidates 25 reproducible CPython 3.13 bugs involving memory safety and concurrency. The bugs resulted from Python security research using static analysis. Each entry has a con...
Opengraph URL: https://github.com/python/cpython/issues/157196
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CPython 3.13: consolidated memory-safety and concurrency bugs","articleBody":"Hello,\n\nThis issue consolidates 25 reproducible CPython 3.13 bugs involving memory safety and concurrency.\n\nThe bugs resulted from Python security research using static analysis. Each entry has a concrete PoC in the linked version-specific Gist. Although the collection is large, these bugs warrant inspection, especially the cases producing interpreter crashes, sanitizer failures, memory corruption, or similarly concrete failures.\n\nThis issue is associated with https://github.com/python/cpython/issues/157197 and https://github.com/python/cpython/issues/157198\n\n## Bugs\n\n1. [`asyncio` Future callback registry race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-001-asyncio-future-callback-registry-race-md) — Concurrent callback registration or removal can retire an unlocked callback-list item before `remove_done_callback()` promotes it, producing an ASan crash.\n2. [Unlocked `atexit` callback array](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-002-atexit-python-callback-array-unlocked-md) — Concurrent registry operations can use stale callback records and crash, while re-entrant comparison can delete an unrelated replacement callback.\n3. [`BaseException.__setstate__()` shared-dictionary race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-003-baseexception-setstate-shared-dict-race-md) — Concurrent value replacement can reclaim a dictionary entry between `PyDict_Next()` and reference promotion.\n4. [Bytearray methods using unlocked shared storage](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-004-bytearray-methods-unlocked-shared-storage-md) — Concurrent storage replacement causes out-of-bounds reads and mixed-generation results across several bytearray operations.\n5. [`bytes()` conversion of a shared list](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-005-bytes-from-shared-list-race-md) — The exact-list conversion path can promote an item reclaimed by concurrent clear or resize, producing an ASan crash.\n6. [Shared CSV Reader state race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-006-csv-shared-reader-state-race-md) — Concurrent `next()` calls can reallocate and corrupt the Reader's unlocked parser buffer and state.\n7. [Shared CSV Writer record-buffer race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-007-csv-shared-writer-buffer-race-md) — Concurrent `writerow()` calls can overwrite one another and emit a row containing mixed input generations.\n8. [`FrameLocalsProxy.__getitem__()` extra-local race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-008-frame-locals-proxy-extra-getitem-race-md) — Concurrent proxy assignment or deletion can reclaim a borrowed extra-local value before promotion.\n9. [Writable live-frame fast-local race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-009-frame-locals-proxy-fast-local-race-md) — Proxy replacement can free a fast-local value while the evaluator or `PyFrame_GetVar()` is acquiring it, causing impossible object state and allocator corruption.\n10. [Function closure replacement during frame initialization](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-010-function-set-closure-frame-init-race-md) — Concurrent closure replacement can release the tuple and cell while an unstarted frame initializes its free variables.\n11. [Unsynchronized whole-interpreter `PyConfig` access](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-011-interpreter-config-whole-copy-unlocked-md) — Concurrent configuration setters and readers produce heap-use-after-free failures in wide-string-list copying and conversion.\n12. [Shared itertools combinator advancement](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-012-itertools-combinator-shared-next-md) — Concurrent `next()` calls corrupt mutable state in `product`, `combinations`, `combinations_with_replacement`, and `permutations`.\n13. [Shared `itertools.tee` cache race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-013-itertools-tee-shared-data-race-md) — Concurrent advancement can expose an uninitialized shared-cache slot to `Py_NewRef`, crashing both same-branch and sibling-branch modes.\n14. [Managed `__dict__` replacement false miss](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-014-managed-inline-attribute-dict-replacement-race-md) — Attribute lookup can report `AttributeError` after inline storage is invalidated even though the replacement dictionary contains the attribute.\n15. [OrderedDict borrowed-value promotion race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-015-ordereddict-borrowed-value-promotion-race-md) — Fixed-key replacement can reclaim values consumed by `setdefault()`, `copy()`, or values iteration and corrupt the allocator.\n16. [OrderedDict unlocked node state](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-016-ordereddict-unlocked-node-state-md) — Concurrent structural operations can invalidate the coupled base-dictionary table, fast-node array, and linked nodes during lookup.\n17. [`partial.__repr__()` keyword-dictionary race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-017-partial-repr-keyword-dict-race-md) — Fixed-key replacement can reclaim a borrowed keyword value before formatting promotes it.\n18. [Exact-dictionary pickle batching race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-018-pickle-batch-dict-exact-unlocked-traversal-md) — Concurrent dictionary mutation can reclaim a borrowed entry before `batch_dict_exact` promotes it, producing an ASan crash.\n19. [Exact-list pickle batching race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-019-pickle-batch-list-exact-unpinned-item-md) — Concurrent list replacement or resize can reclaim an item before `batch_list_exact` promotes it.\n20. [`pickle.whichmodule()` `sys.modules` race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-020-pickle-whichmodule-unlocked-sys-modules-md) — Concurrent synthetic-module replacement can reclaim a borrowed module entry during the fallback scan and crash reference promotion.\n21. [`_PyConfig_FromDict()` nested-list race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-021-pyconfig-fromdict-shared-nested-list-md) — Concurrent mutation of `warnoptions` can retire a raw list item before its type check and conversion.\n22. [`globals[\"__builtins__\"]` replacement race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-022-shared-globals-builtins-borrow-race-md) — Evaluation can consume a borrowed builtins object after concurrent replacement frees it, causing stack or mutex corruption.\n23. [SQLite converter-registry race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-023-sqlite-converter-registry-borrow-race-md) — Concurrent public-registry replacement can finalize a borrowed converter before the cursor row-cast map owns it.\n24. [`str.maketrans()` shared-dictionary race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-024-unicode-maketrans-shared-dict-traversal-md) — Concurrent clear or replacement can retire borrowed keys and values, producing impossible translation tables or reclaimed objects.\n25. [`warnings.filters` list race](https://gist.github.com/Nievesjyl/575345587a5b226451c78b8f99155f6d#file-025-warnings-filter-list-race-md) — Direct list mutation can finalize a borrowed filter tuple before `get_filter()` inspects and promotes it, producing an ASan crash.\n","author":{"url":"https://github.com/Nievesjyl","@type":"Person","name":"Nievesjyl"},"datePublished":"2026-09-08T18:05:27Z","url":"https://github.com/python/cpython/issues/157196"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4e3bc6f2-c5de-ca64-72e2-94c7d2503368 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93E8:13A979:C1D3B1:FE652B:6AF85B12 |
| html-safe-nonce | 3c78804efc8c4e8492c61c50a1df8762fcea0876d1883657539ecbd309061bcf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0U4OjEzQTk3OTpDMUQzQjE6RkU2NTJCOjZBRjg1QjEyIiwidmlzaXRvcl9pZCI6IjkwNjc4MjM1NzQ2MTcxODUwNDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cbafb69d0fcfd3b1199d1175b616006732064d0d1e47aa58c8b93339829f5012 |
| hovercard-subject-tag | issue:5390227056 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/157196/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ccd1f08a28804931d351691605fd8117c0067b289f6ba1e3b27dc87b7bfaf318/python/cpython/issues/157196 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ccd1f08a28804931d351691605fd8117c0067b289f6ba1e3b27dc87b7bfaf318/python/cpython/issues/157196 |
| og:image:alt | Hello, This issue consolidates 25 reproducible CPython 3.13 bugs involving memory safety and concurrency. The bugs resulted from Python security research using static analysis. Each entry has a con... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Nievesjyl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 653be32ff5c755082a4db662491bfbbcfc9112c1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width