Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-119342: Fix OOM vulnerability in plistlib#119343

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
serhiy-storchaka wants to merge3 commits intopython:main
base:main
Choose a base branch
Loading
fromserhiy-storchaka:plistlib-oom

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedMay 21, 2024
edited by bedevere-appbot
Loading

Reading a specially prepared small Plist file could cause OOM because file's read(n) preallocates a bytes object for reading the specified amount of data. Now plistlib reads large data by chunks, therefore the upper limit of consumed memory is proportional to the size of the input file.

Reading a specially prepared small Plist file could cause OOM because file'sread(n) preallocates a bytes object for reading the specified amount ofdata. Now plistlib reads large data by chunks, therefore the upper limit ofconsumed memory is proportional to the size of the input file.
if len(data) != size:
raise InvalidFileException
return data
cursize = min(size, 1 << 20)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do you want to perhaps make (1 << 20) as a constant the same way you did for the pickle vulnerability?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Maybe. In thepickle module the constant is used in several places, so there are more reasons to use a named constant there.

serhiy-storchakaand others added2 commitsMay 22, 2024 16:00
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@gpsheadgpshead marked this pull request as draftMay 24, 2024 19:58
@gpshead
Copy link
Member

I've marked this Draft for now as discussion on this on the security response team list is not complete. (we'll summarize that in a public issue once it has settled)

@encukou
Copy link
Member

See#119514 (comment) for results of the PSRT discussion.

@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@picnixzpicnixzpicnixz left review comments

@ronaldoussorenronaldoussorenAwaiting requested review from ronaldoussoren

Assignees
No one assigned
Labels
needs backport to 3.9only security fixesneeds backport to 3.10only security fixesneeds backport to 3.11only security fixesneeds backport to 3.12only security fixesneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixestype-securityA security issue
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@serhiy-storchaka@gpshead@encukou@picnixz@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp