forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-119511: Fix a potential denial of service in imaplib (python…
…#119514) The IMAP4 client could consume an arbitrary amount of memory when trying to connect to a malicious server, because it read a "literal" data with a single read(size) call, and BufferedReader.read() allocates the bytes object of the specified size before reading. Now the IMAP4 client reads data by chunks, therefore the amount of used memory is limited by the amount of the data actually been sent by the server. Co-authored-by: Gregory P. Smith <[email protected]>
- Loading branch information
1 parent
3fb5f6e
commit 735f25c
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
7 changes: 7 additions & 0 deletions
7
Misc/NEWS.d/next/Security/2024-05-24-21-00-52.gh-issue-119511.jKrXQ8.rst
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Fix a potential denial of service in the :mod:`imaplib` module. When connecting | ||
to a malicious server, it could cause an arbitrary amount of memory to be | ||
allocated. On many systems this is harmless as unused virtual memory is only a | ||
mapping, but if this hit a virtual address size limit it could lead to a | ||
:exc:`MemoryError` or other process crash. On unusual systems or builds where | ||
all allocated memory is touched and backed by actual ram or storage it could've | ||
consumed resources doing so until similarly crashing. |