Skip to content

Fix #80216: imap_mail_compose() does not validate types/encodings #6323

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
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Oct 12, 2020

We need to check whether the given types and encodings are within
bounds to avoid segfaults and out-of-bound reads.


This is ugly. In order to detect whether the custom types and encodings are actually supported, we have to access the global body_types and body_encodings which are declared in mail.h, but not be exported. There is no issue on Windows, because libc-client is linked statically (at least with the official dependencies), but otherwise this patch may not even build.

We need to check whether the given `type`s and `encoding`s are within
bounds to avoid segfaults and out-of-bound reads.
@cmb69 cmb69 added the Bug label Oct 12, 2020
@nikic
Copy link
Member

nikic commented Oct 12, 2020

This is ugly. In order to detect whether the custom types and encodings are actually supported, we have to access the global body_types and body_encodings which are declared in mail.h, but not be exported. There is no issue on Windows, because libc-client is linked statically (at least with the official dependencies), but otherwise this patch may not even build.

Presumably libc-client compiles using default visibility rather than -fvisibility=hidden, so I believe those symbols should also be visible in shared libraries.

@cmb69
Copy link
Member Author

cmb69 commented Oct 12, 2020

Thanks! Then we should go with this.

@php-pulls php-pulls closed this in 73e43b6 Oct 12, 2020
@cmb69 cmb69 deleted the cmb/80216 branch October 12, 2020 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants