Skip to content

poplib.py: Missing integer parsing validation causes client crash on invalid server response #130637

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

Closed
NErinola opened this issue Feb 27, 2025 · 1 comment · Fixed by #130646
Closed
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@NErinola
Copy link

NErinola commented Feb 27, 2025

Crash report

What happened?

In poplib.py at line 229 the code attempts to convert a server response to an integer without first verifying that the response is numeric. If the server returns a non-numeric response, the int() conversion fails causing the client to crash.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

Linked PRs

@NErinola NErinola added the type-crash A hard crash of the interpreter, possibly with a core dump label Feb 27, 2025
Mr-Sunglasses added a commit to Mr-Sunglasses/cpython that referenced this issue Feb 27, 2025
@encukou encukou added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 28, 2025
@encukou
Copy link
Member

encukou commented Feb 28, 2025

This is a wrong exception (ValueError), not a hard crash, right?

ericvsmith added a commit that referenced this issue Mar 2, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 2, 2025
… method (pythonGH-130646)

(cherry picked from commit a42168d)

Co-authored-by: Kanishk Pachauri <[email protected]>
Co-authored-by: Eric V. Smith <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 2, 2025
… method (pythonGH-130646)

(cherry picked from commit a42168d)

Co-authored-by: Kanishk Pachauri <[email protected]>
Co-authored-by: Eric V. Smith <[email protected]>
terryjreedy pushed a commit that referenced this issue Mar 2, 2025
…` method (GH-130646) (#130764)

gh-130637: Add validation for numeric response data in `stat()` method (GH-130646)
(cherry picked from commit a42168d)

Co-authored-by: Kanishk Pachauri <[email protected]>
Co-authored-by: Eric V. Smith <[email protected]>
terryjreedy pushed a commit that referenced this issue Mar 2, 2025
…` method (GH-130646) (#130763)

gh-130637: Add validation for numeric response data in `stat()` method (GH-130646)
(cherry picked from commit a42168d)

Co-authored-by: Kanishk Pachauri <[email protected]>
Co-authored-by: Eric V. Smith <[email protected]>
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants