Title: `unpackb()` may return corrupted `ExtraData.extra` for non-contiguous input · Issue #720 · msgpack/msgpack-python · GitHub
Open Graph Title: `unpackb()` may return corrupted `ExtraData.extra` for non-contiguous input · Issue #720 · msgpack/msgpack-python
X Title: `unpackb()` may return corrupted `ExtraData.extra` for non-contiguous input · Issue #720 · msgpack/msgpack-python
Description: I found an issue in unpackb() while fuzzing Python C extension modules with Atheris and ASan/UBSan enabled. The sanitizer initially reported memcpy-param-overlap, but the problem is not limited to sanitizer builds. The same input also pr...
Open Graph Description: I found an issue in unpackb() while fuzzing Python C extension modules with Atheris and ASan/UBSan enabled. The sanitizer initially reported memcpy-param-overlap, but the problem is not limited to ...
X Description: I found an issue in unpackb() while fuzzing Python C extension modules with Atheris and ASan/UBSan enabled. The sanitizer initially reported memcpy-param-overlap, but the problem is not limited to ...
Opengraph URL: https://github.com/msgpack/msgpack-python/issues/720
X: @github
Domain: redirect.github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`unpackb()` may return corrupted `ExtraData.extra` for non-contiguous input","articleBody":"I found an issue in `unpackb()` while fuzzing Python C extension modules with Atheris and ASan/UBSan enabled.\n\nThe sanitizer initially reported `memcpy-param-overlap`, but the problem is not limited to sanitizer builds. The same input also produces incorrect output with the PyPI wheel, without crashing or emitting a warning.\n\n### Environment\n\n* msgpack 1.2.1\n* CPython 3.12\n* Linux x86_64\n\n### Reproducer\n\n```python\nimport msgpack\n\n# A strided (non-contiguous) view whose logical content is b\"\\x00abc\":\n# \\x00 -> the integer 0\n# abc -> trailing bytes, so unpackb raises ExtraData\nbuf = bytearray(b\"\\x00\\xffa\\xffb\\xffc\\xff\")\nview = memoryview(buf)[::2]\nassert bytes(view) == b\"\\x00abc\"\n\ntry:\n msgpack.unpackb(view)\nexcept msgpack.ExtraData as e:\n print(e.unpacked) # 0 -- correct\n print(e.extra) # b'ab\\x00' -- expected b'abc'\n```\n\n### ASan report\n\n```text\nAddressSanitizer: memcpy-param-overlap: memory ranges\n [0x7a2549f75340,0x7a2549f75343) and [0x7a2549f75341,0x7a2549f75344) overlap\n #1 PyBytes_FromStringAndSize\n #2 __pyx_pf_7msgpack_9_cmsgpack_2unpackb msgpack/_unpacker.pyx:199\n```\n\nThis looks like a bug to me, but I don't know the codebase well enough to rule out that it's expected for non-contiguous input.","author":{"url":"https://github.com/marinelay","@type":"Person","name":"marinelay"},"datePublished":"2026-08-03T14:49:55Z","url":"https://github.com/msgpack/msgpack-python/issues/720"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:eaa50de0-d153-7ebf-3457-0b3cc0e09c03 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94CA:1E18DF:45CBF9:602420:6B074D69 |
| html-safe-nonce | c07e78ebeb9e6452564a7df1b7bef0fa2e761d1150a2c17d700d88c94bf99976 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NENBOjFFMThERjo0NUNCRjk6NjAyNDIwOjZCMDc0RDY5IiwidmlzaXRvcl9pZCI6Ijc4OTAzODQxMTE3NjMxNDgxMzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6748894d6fcbd2fd9b6af3c537f9c0dfe0384c7a1545100927b2c13f681905d6 |
| hovercard-subject-tag | issue:5051097488 |
| 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/msgpack/msgpack-python/720/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f1f65e5a4c69077cf436b2157af519ffac9ae2895f84589c1c63a5c81e301d6d/msgpack/msgpack-python/issues/720 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f1f65e5a4c69077cf436b2157af519ffac9ae2895f84589c1c63a5c81e301d6d/msgpack/msgpack-python/issues/720 |
| og:image:alt | I found an issue in unpackb() while fuzzing Python C extension modules with Atheris and ASan/UBSan enabled. The sanitizer initially reported memcpy-param-overlap, but the problem is not limited to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | marinelay |
| hostname | github.com |
| expected-hostname | github.com |
| None | 26f151990bcb5b67b87df8b3f96ed340f849939d44e36f348402de5e39cca989 |
| turbo-cache-control | no-preview |
| go-import | github.com/msgpack/msgpack-python git https://github.com/msgpack/msgpack-python.git |
| octolytics-dimension-user_id | 198264 |
| octolytics-dimension-user_login | msgpack |
| octolytics-dimension-repository_id | 2242705 |
| octolytics-dimension-repository_nwo | msgpack/msgpack-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2242705 |
| octolytics-dimension-repository_network_root_nwo | msgpack/msgpack-python |
| 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 | cd00d8452bcb4e56a60ba7c0e61a697b46513fe9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width