Skip to content

fix out-of-bounds read on empty multipart boundary in message_view - #1262

Merged
gittiver merged 1 commit into
CrowCpp:masterfrom
nishat-06:multipart-view-empty-boundary
Oct 2, 2026
Merged

gittiver merged 1 commit into
CrowCpp:masterfrom
nishat-06:multipart-view-empty-boundary

Conversation

@nishat-06

Copy link
Copy Markdown
Contributor

message_view::get_boundary reads to_return[0] right after slicing the Content-Type header at boundary=, so a request whose Content-Type ends in boundary= leaves an empty string_view and the index runs out of bounds (libc++/libstdc++ hardened builds abort here). multipart::message already rejects an empty boundary with bad_request before parsing, but message_view skipped that check. This guards the index with a non-empty test and throws the same bad_request in the constructor, with a regression test mirroring the existing message case.

@gittiver gittiver left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok for me.

@gittiver
gittiver merged commit dac10c3 into CrowCpp:master Oct 2, 2026
20 checks passed
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.

2 participants