Skip to content
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

gh-127208: Reject null character in _imp.create_dynamic() #127400

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Nov 29, 2024

_imp.create_dynamic() now rejects embedded null characters in the path and in the module name.

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.
@vstinner
Copy link
Member Author

cc @ZeroIntensity @sobolevn

@picnixz
Copy link
Contributor

picnixz commented Nov 29, 2024

According to the issue, it fails on 3.12 so does it require a 3.12 bp as well? (I don't have the code in front of me)

@vstinner
Copy link
Member Author

According to the issue, it fails on 3.12 so does it require a 3.12 bp as well? (I don't have the code in front of me)

_PyUnicode_AsUTF8NoNUL() was added to Python 3.13. Since the bug report comes from a fuzzing tool, I don't think that it's worth it to backport the fix up to Python 3.12. The bug is old and nobody complained before.

@vstinner vstinner merged commit b14fdad into python:main Nov 29, 2024
49 checks passed
@vstinner vstinner deleted the imp_create_dynamic branch November 29, 2024 15:20
@miss-islington-app
Copy link

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 29, 2024
…onGH-127400)

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.
(cherry picked from commit b14fdad)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 29, 2024

GH-127418 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 29, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 29, 2024

GH-127419 is a backport of this pull request to the 3.12 branch.

@vstinner
Copy link
Member Author

Hum, I changed my mind and backported the _PyUnicode_AsUTF8NoNUL() function instead :-) I created #127419 backport for 3.12.

vstinner added a commit that referenced this pull request Nov 29, 2024
…127400) (#127418)

gh-127208: Reject null character in _imp.create_dynamic() (GH-127400)

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.
(cherry picked from commit b14fdad)

Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit that referenced this pull request Nov 29, 2024
…7400) (#127419)

gh-127208: Reject null character in _imp.create_dynamic() (#127400)

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.

Backport also the _PyUnicode_AsUTF8NoNUL() function.

(cherry picked from commit b14fdad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants