-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
gh-42400: Fix buffer overflow in _Py_wrealpath for long paths #141529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1424245 to
3255a3d
Compare
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.
|
I don't think the errors in the UBSAN test are related to this fix, as they occur for a completely different reason and generally in import tests. |
|
@vstinner Could you please review this PR? |
Misc/NEWS.d/next/Security/2025-11-13-22-31-56.gh-issue-42400.pqB5Kq.rst
Outdated
Show resolved
Hide resolved
…qB5Kq.rst Co-authored-by: Victor Stinner <vstinner@python.org>
|
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. |
|
|
|
Change merged, thanks. The change passed on our fleet of stable buildbots. Even if the change was documented in the Security category, I don't think that it's worth it to backport it to stable branches (yet). I'm afraid of breaking the Python build on some weird platforms where |
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