René's URL Explorer Experiment


Title: Heap-buffer-overflow in the `hz` incremental decoder on a trailing `~` · Issue #157325 · python/cpython · GitHub

Open Graph Title: Heap-buffer-overflow in the `hz` incremental decoder on a trailing `~` · Issue #157325 · python/cpython

X Title: Heap-buffer-overflow in the `hz` incremental decoder on a trailing `~` · Issue #157325 · python/cpython

Description: Bug report Bug description: import codecs d = codecs.getincrementaldecoder('hz')() d.decode(b'~', False) d.decode(b'', True) ================================================================= ==1==ERROR: AddressSanitizer: heap-buffer-over...

Open Graph Description: Bug report Bug description: import codecs d = codecs.getincrementaldecoder('hz')() d.decode(b'~', False) d.decode(b'', True) ================================================================= ==1==E...

X Description: Bug report Bug description: import codecs d = codecs.getincrementaldecoder('hz')() d.decode(b'~', False) d.decode(b'', True) ================================================...

Opengraph URL: https://github.com/python/cpython/issues/157325

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Heap-buffer-overflow in the `hz` incremental decoder on a trailing `~`","articleBody":"# Bug report\n\n### Bug description:\n\n```python\nimport codecs\nd = codecs.getincrementaldecoder('hz')()\nd.decode(b'~', False)   \nd.decode(b'', True)\n```\n\n```\n=================================================================\n==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x5020000040d1 at pc 0xffff7feff068 bp 0xffffd608df50 sp 0xffffd608df40\nREAD of size 1 at 0x5020000040d1 thread T0\n    #0 0xffff7feff064 in hz_decode Modules/cjkcodecs/_codecs_cn.c:417\n    #1 0xffff7fe7426c in decoder_feed_buffer Modules/cjkcodecs/multibytecodec.c:921\n    #2 0xffff7fe76238 in _multibytecodec_MultibyteIncrementalDecoder_decode_impl Modules/cjkcodecs/multibytecodec.c:1214\n    #3 0xffff7fe76238 in _multibytecodec_MultibyteIncrementalDecoder_decode Modules/cjkcodecs/clinic/multibytecodec.c.h:395\n    #4 0xaaaad3656320 in _PyObject_VectorcallTstate Include/internal/pycore_call.h:144\n    #5 0xaaaad3656320 in PyObject_Vectorcall Objects/call.c:327\n    #6 0xaaaad3ca1bc8 in _Py_VectorCallInstrumentation_StackRefSteal Python/ceval.c:768\n    #7 0xaaaad33d1de8 in _PyEval_EvalFrameDefault Python/generated_cases.c.h:1906\n    #8 0xaaaad3cc0b1c in _PyEval_EvalFrame Include/internal/pycore_ceval.h:122\n    #9 0xaaaad3cc0b1c in _PyEval_Vector Python/ceval.c:2174\n    #10 0xaaaad3cc0b1c in PyEval_EvalCode Python/ceval.c:679\n    #11 0xaaaad3ebfeb4 in run_mod Python/pythonrun.c:1509\n    #12 0xaaaad3ec0d38 in _PyRun_File Python/pythonrun.c:1332\n    #13 0xaaaad3ec4ffc in _PyRun_SimpleFile Python/pythonrun.c:544\n    #14 0xaaaad3ec8dd0 in _PyRun_AnyFile Python/pythonrun.c:92\n    #15 0xaaaad3f9390c in pymain_run_file_obj Modules/main.c:478\n    #16 0xaaaad3f9390c in pymain_run_file Modules/main.c:494\n    #17 0xaaaad3f9390c in pymain_run_python Modules/main.c:804\n    #18 0xaaaad3f9390c in Py_RunMain Modules/main.c:891\n    #19 0xaaaad3f95c38 in pymain_main Modules/main.c:921\n    #20 0xaaaad3f95c38 in Py_BytesMain Modules/main.c:945\n    #21 0xffff82c484c0  (/lib/aarch64-linux-gnu/libc.so.6+0x284c0) (BuildId: 27027b96e5b8c475fc327aa445bea1c71d37b4e2)\n    #22 0xffff82c48594 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x28594) (BuildId: 27027b96e5b8c475fc327aa445bea1c71d37b4e2)\n    #23 0xaaaad343beec in _start (/src/cpython/python+0x183beec) (BuildId: eba909a3db0adabacf151d7dc3081dda7999191a)\n\n0x5020000040d1 is located 0 bytes after 1-byte region [0x5020000040d0,0x5020000040d1)\nallocated by thread T0 here:\n    #0 0xffff835e76d0 in malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69\n    #1 0xffff7fe76090 in _multibytecodec_MultibyteIncrementalDecoder_decode_impl Modules/cjkcodecs/multibytecodec.c:1201\n    #2 0xffff7fe76090 in _multibytecodec_MultibyteIncrementalDecoder_decode Modules/cjkcodecs/clinic/multibytecodec.c.h:395\n    #3 0xaaaad3656320 in _PyObject_VectorcallTstate Include/internal/pycore_call.h:144\n    #4 0xaaaad3656320 in PyObject_Vectorcall Objects/call.c:327\n    #5 0xaaaad3ca1bc8 in _Py_VectorCallInstrumentation_StackRefSteal Python/ceval.c:768\n    #6 0xaaaad33d1de8 in _PyEval_EvalFrameDefault Python/generated_cases.c.h:1906\n    #7 0xaaaad3cc0b1c in _PyEval_EvalFrame Include/internal/pycore_ceval.h:122\n    #8 0xaaaad3cc0b1c in _PyEval_Vector Python/ceval.c:2174\n    #9 0xaaaad3cc0b1c in PyEval_EvalCode Python/ceval.c:679\n    #10 0xaaaad3ebfeb4 in run_mod Python/pythonrun.c:1509\n    #11 0xaaaad3ec0d38 in _PyRun_File Python/pythonrun.c:1332\n    #12 0xaaaad3ec4ffc in _PyRun_SimpleFile Python/pythonrun.c:544\n    #13 0xaaaad3ec8dd0 in _PyRun_AnyFile Python/pythonrun.c:92\n    #14 0xaaaad3f9390c in pymain_run_file_obj Modules/main.c:478\n    #15 0xaaaad3f9390c in pymain_run_file Modules/main.c:494\n    #16 0xaaaad3f9390c in pymain_run_python Modules/main.c:804\n    #17 0xaaaad3f9390c in Py_RunMain Modules/main.c:891\n    #18 0xaaaad3f95c38 in pymain_main Modules/main.c:921\n    #19 0xaaaad3f95c38 in Py_BytesMain Modules/main.c:945\n    #20 0xffff82c484c0  (/lib/aarch64-linux-gnu/libc.so.6+0x284c0) (BuildId: 27027b96e5b8c475fc327aa445bea1c71d37b4e2)\n    #21 0xffff82c48594 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x28594) (BuildId: 27027b96e5b8c475fc327aa445bea1c71d37b4e2)\n    #22 0xaaaad343beec in _start (/src/cpython/python+0x183beec) (BuildId: eba909a3db0adabacf151d7dc3081dda7999191a)\n\nSUMMARY: AddressSanitizer: heap-buffer-overflow Modules/cjkcodecs/_codecs_cn.c:417 in hz_decode\nShadow bytes around the buggy address:\n  0x502000003e00: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\n  0x502000003e80: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fa\n  0x502000003f00: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa\n  0x502000003f80: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa\n  0x502000004000: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fa\n=>0x502000004080: fa fa fd fa fa fa fd fa fa fa[01]fa fa fa fa fa\n  0x502000004100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x502000004180: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x502000004200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x502000004280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\n  0x502000004300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\nShadow byte legend (one shadow byte represents 8 application bytes):\n  Addressable:           00\n  Partially addressable: 01 02 03 04 05 06 07\n  Heap left redzone:       fa\n  Freed heap region:       fd\n  Stack left redzone:      f1\n  Stack mid redzone:       f2\n  Stack right redzone:     f3\n  Stack after return:      f5\n  Stack use after scope:   f8\n  Global redzone:          f9\n  Global init order:       f6\n  Poisoned by user:        f7\n  Container overflow:      fc\n  Array cookie:            ac\n  Intra object redzone:    bb\n  ASan internal:           fe\n  Left alloca redzone:     ca\n  Right alloca redzone:    cb\n==1==ABORTING\n```\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-157333\n* gh-158161\n* gh-158162\n* gh-158163\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/djarfluka","@type":"Person","name":"djarfluka"},"datePublished":"2026-09-11T15:03:15Z","url":"https://github.com/python/cpython/issues/157325"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4aca4622-fbc4-dd2a-13ff-d11994949539
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id96BE:249C8E:3DA2E2:548532:6AECCD9F
html-safe-nonce83c528848265a869de996f36c5a69c2c8e442d5a1d002574fe58510c18b4077b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkJFOjI0OUM4RTozREEyRTI6NTQ4NTMyOjZBRUNDRDlGIiwidmlzaXRvcl9pZCI6IjU1NDAwOTc3NDMwNDEzODM4MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc4b283fa571a4af0deda5eb244834d0e8f29c9461c659d4f5978da4201e2d465
hovercard-subject-tagissue:5425825178
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/157325/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5a217cd6e7a4ab00ac28aa1c8003a8a501b564fff36582b02110335001346c13/python/cpython/issues/157325
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5a217cd6e7a4ab00ac28aa1c8003a8a501b564fff36582b02110335001346c13/python/cpython/issues/157325
og:image:altBug report Bug description: import codecs d = codecs.getincrementaldecoder('hz')() d.decode(b'~', False) d.decode(b'', True) ================================================================= ==1==E...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedjarfluka
hostnamegithub.com
expected-hostnamegithub.com
Nonedc0b519c5798dc1150b88dc4c06a8b9634d0069218dc04e469970e76aad74016
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedb139f0bf57b59bf9a8c4abb0849924d6c6ca559
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/157325#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F157325
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F157325
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/157325
Reloadhttps://github.com/python/cpython/issues/157325
Reloadhttps://github.com/python/cpython/issues/157325
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.3k (2.3k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/pulse
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/157325
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/157325
Heap-buffer-overflow in the hz incremental decoder on a trailing ~https://github.com/python/cpython/issues/157325#top
https://github.com/StanFromIreland
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/djarfluka
djarflukahttps://github.com/djarfluka
on Sep 11, 2026https://github.com/python/cpython/issues/157325#issue-5425825178
gh-157325: Fix an OOB read in the hz incremental decoder on a trailing ~ #157333https://github.com/python/cpython/pull/157333
[3.13] gh-157325: Fix an OOB read in the hz incremental decoder on a trailing ~ (gh-157333) #158161https://github.com/python/cpython/pull/158161
[3.14] gh-157325: Fix an OOB read in the hz incremental decoder on a trailing ~ (gh-157333) #158162https://github.com/python/cpython/pull/158162
[3.15] gh-157325: Fix an OOB read in the hz incremental decoder on a trailing ~ (gh-157333) #158163https://github.com/python/cpython/pull/158163
djarflukahttps://github.com/djarfluka
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Sep 11, 2026https://github.com/python/cpython/issues/157325#event-30980377023
StanFromIrelandhttps://github.com/StanFromIreland
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
on Sep 11, 2026https://github.com/python/cpython/issues/157325#event-30982664948
StanFromIrelandhttps://github.com/StanFromIreland
on Sep 11, 2026https://github.com/python/cpython/issues/157325#event-30982669136
StanFromIrelandhttps://github.com/StanFromIreland
Codecs and encodings issueshttps://github.com/orgs/python/projects/24
on Sep 11, 2026https://github.com/python/cpython/issues/157325#event-30982679223
https://github.com/picnixz
picnixzhttps://github.com/picnixz
on Sep 11, 2026https://github.com/python/cpython/issues/157325#issuecomment-5640070582
@djarflukahttps://github.com/djarfluka
picnixzhttps://github.com/picnixz
on Sep 11, 2026https://github.com/python/cpython/issues/157325#event-30997034651
corona10https://github.com/corona10
on Sep 25, 2026https://github.com/python/cpython/issues/157325#event-31835499006
gh-157325: Fix an OOB read in the `hz` incremental decoder on a trail…https://github.com/python/cpython/commit/c04387348eb8223977e46f4972c08833c11c6617
gh-157325https://github.com/python/cpython/issues/157325
c043873https://github.com/python/cpython/commit/c04387348eb8223977e46f4972c08833c11c6617
StanFromIrelandhttps://github.com/StanFromIreland
on Sep 25, 2026https://github.com/python/cpython/issues/157325#event-31844411832
[3.13] gh-157325: Fix an OOB read in the `hz` incremental decoder on …https://github.com/python/cpython/commit/af1be50e4cfd09a6037c31f0415ab6888d8e04fb
gh-157325https://github.com/python/cpython/issues/157325
af1be50https://github.com/python/cpython/commit/af1be50e4cfd09a6037c31f0415ab6888d8e04fb
StanFromIrelandhttps://github.com/StanFromIreland
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 26, 2026https://github.com/python/cpython/issues/157325#event-31903364888
github-project-automationhttps://github.com/apps/github-project-automation
Codecs and encodings issueshttps://github.com/orgs/python/projects/24
on Sep 26, 2026https://github.com/python/cpython/issues/157325
StanFromIrelandhttps://github.com/StanFromIreland
on Sep 28, 2026https://github.com/python/cpython/issues/157325#event-31991005108
[3.14] gh-157325: Fix an OOB read in the `hz` incremental decoder on …https://github.com/python/cpython/commit/6907605aae5425494a3484d9221ca8c24000b9de
gh-157325https://github.com/python/cpython/issues/157325
6907605https://github.com/python/cpython/commit/6907605aae5425494a3484d9221ca8c24000b9de
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 10, 2026https://github.com/python/cpython/issues/157325#event-32937076715
[3.15] gh-157325: Fix an OOB read in the `hz` incremental decoder on …https://github.com/python/cpython/commit/5f437c5ff8e004620a5e116bdbee0d294feff9f9
gh-157325https://github.com/python/cpython/issues/157325
5f437c5https://github.com/python/cpython/commit/5f437c5ff8e004620a5e116bdbee0d294feff9f9
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/157325
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/157325
StanFromIrelandhttps://github.com/StanFromIreland
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Codecs and encodings issueshttps://github.com/orgs/python/projects/24
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.