{{ message }}
gh-42400: Fix buffer overflow in _Py_wrealpath for long paths - #141529
Merged
Merged
Conversation
ashm-dev
force-pushed
the
fix/cve-realpath
branch
from
November 13, 2025 19:41
1424245 to
3255a3d
Compare
ashm-dev
force-pushed
the
fix/cve-realpath
branch
from
November 13, 2025 20:36
52f60a5 to
bb4af8a
Compare
Allow platforms where realpath returns different canonical paths (e.g. Android). Verify resolution with os.samefile and fall back to a length check if samefile is unavailable.
Contributor
Author
Contributor
Author
|
@vstinner Could you please review this PR? |
vstinner
reviewed
Nov 14, 2025
…qB5Kq.rst Co-authored-by: Victor Stinner <vstinner@python.org>
Member
|
I updated the PR to retrieve the fix for the UBSan CI. |
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit f882e26 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F141529%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Member
|
|
Member
StanFromIreland
pushed a commit
to StanFromIreland/cpython
that referenced
this pull request
Dec 6, 2025
…paths (python#141529) Co-authored-by: Victor Stinner <vstinner@python.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes buffer overflow (CVE-2006-1542) in
_Py_wrealpath()when handling paths longer than MAXPATHLEN (4096 bytes).Changed
realpath(path, buffer)torealpath(path, NULL)for dynamic allocation.Closes #42400
realpath#42400