-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Found (accidentally) by our OSS Fuzz fuzzer in #493449985.
The encodings.search_function() caches every codec lookup miss in an unbounded _cache dict, causing memory growth (the fuzzer gathered a 2561Mb cache causing the abort).
I would suggest we bound its size like we do elsewhere (e.g. the struct cache).
Technically, there is the possibility of a DoS vulnerability, however the PSRT decided that it is unrealistic for this to be exploited.
CPython versions tested on:
CPython main branch, 3.15, 3.14, 3.13
Operating systems tested on:
No response
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
No status