Skip to content

gh-136053: Memory Safety Issue in marshal.c TYPE_SLICE Case #136054

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

akshat62
Copy link
Contributor

@akshat62 akshat62 commented Jun 27, 2025

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

cc @serhiy-storchaka

Would it be possible to add a test with a maliciously crafted data so that we ensure that the vulnerability can be exploited?

@picnixz
Copy link
Member

picnixz commented Jun 28, 2025

Thanks for the fix but please add a regression test. Even if it's not easily reproducible, I'd like to see a PoC.

@serhiy-storchaka serhiy-storchaka self-requested a review June 28, 2025 09:26
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

The test does not work.

For testing, you need to create at least 2147483646 (0x7ffffffe) references. This is impossible on 32-bit platform, and on 64-bit platforms it will consume at least 16 GiB (and maybe 32 GiB or 64 GiB due to overallocation) only for the list, not counting the referred objects. This is a bigmem test. This will also take a significant amount of time to run. I do not think it is worth to add an expensive test for trivial fix.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

@akshat62 akshat62 requested a review from picnixz June 28, 2025 14:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants