Commit graph

4 commits

Author SHA1 Message Date
the-djmaze
b6607bf6e1 @ZaphodB fix(security): strip line breaks from decoded and outgoing header values
DecodeHeaderValue removed CR and LF before decoding encoded-words, so an
encoded-word could still decode to a line break. A message whose Message-ID
was =?utf-8?b?...?= with CRLF inside reached the client with the break intact,
the client copies Message-ID into In-Reply-To when replying or forwarding, and
SetInReplyTo only trimmed it. The reply then carried header lines chosen by the
sender of the original, or a body if the payload held a blank line, sent and
DKIM-signed as the user and saved to Sent. Subject on Edit-as-new had the same
shape through the ASCII path.

Strip CR, LF and NUL in two places: after decoding in DecodeHeaderValue, and in
Header itself, which every outgoing header is built through, so a value that
arrives by another route (client parameters, plugins) cannot break the line
either. Folding is unaffected; __toString adds it back.

test/header-injection.php covers B and Q encoded-words, parsing, outgoing
In-Reply-To and Subject, and that long values still fold.
2026-10-24 11:50:10 +02:00
the-djmaze
308be25c24 Resolve #695 2022-11-23 16:26:26 +01:00
the-djmaze
7f084dda53 Use SNAPPYMAIL_INCLUDE_AS_API and added SSO test 2022-01-10 16:10:56 +01:00
djmaze
c430f1b175 Test CardDAV for #79 2021-04-15 12:41:01 +02:00