Fix parsing headers with a name that is a prefix of a well-known header
ClosedPublic

Authored by vkrause on May 11 2020, 3:33 PM.

Details

Summary

That is, we ended up handling e.g. "Repl:" as "Reply-To:" here, and thus
this can have side-effects on application behavior such as determining who
to send a reply to. As this might allow bypasses of mechanisms that sign
certain subsets of relevant headers, this is rather problematic.

This is caused by only checking the length of the input string, but not
the length of the expected string for the name comparison.

Thanks to Marcus Brinkmann for discovering this.

Diff Detail

Repository
R180 PIM: KMime
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
vkrause created this revision.May 11 2020, 3:33 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 11 2020, 3:33 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
vkrause requested review of this revision.May 11 2020, 3:33 PM
mlaurent accepted this revision.May 11 2020, 3:38 PM
mlaurent added a subscriber: mlaurent.

Seems logic for me.

This revision is now accepted and ready to land.May 11 2020, 3:38 PM
This revision was automatically updated to reflect the committed changes.