Skip to content

lib-mail: mbox-from - Fix out-of-bounds read of year field#296

Open
nishat-06 wants to merge 1 commit into
dovecot:mainfrom
nishat-06:mbox-from-year-overread
Open

lib-mail: mbox-from - Fix out-of-bounds read of year field#296
nishat-06 wants to merge 1 commit into
dovecot:mainfrom
nishat-06:mbox-from-year-overread

Conversation

@nishat-06

Copy link
Copy Markdown
Contributor

mbox_from_parse only checks the minimum date length up front, but the year field is read after a variable number of optional fields (seconds, named or numeric timezone) have been consumed. A From_ line that ends right after those fields leaves msg at msg_end, so mbox_parse_year reads up to four bytes past the buffer. Bound the read against msg_end before parsing the year, matching the msg_end guards used for the other fields. The added test feeds an exact-size heap buffer so the over-read is caught under valgrind/ASAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant