Skip to content
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

Mimeparser uses unprotected Date header #6641

Open
link2xt opened this issue Mar 11, 2025 · 0 comments · May be fixed by #6642
Open

Mimeparser uses unprotected Date header #6641

link2xt opened this issue Mar 11, 2025 · 0 comments · May be fixed by #6642
Assignees
Labels
bug Something is not working

Comments

@link2xt
Copy link
Collaborator

link2xt commented Mar 11, 2025

We already protect the Date header against modification here:

core/src/mimefactory.rs

Lines 914 to 936 in e5a3eae

} else if is_encrypted {
protected_headers.push(header.clone());
match header_name.as_str() {
"subject" => {
unprotected_headers.push((
"Subject",
mail_builder::headers::raw::Raw::new("[...]").into(),
));
}
"date"
| "in-reply-to"
| "references"
| "auto-submitted"
| "chat-version"
| "autocrypt-setup-message" => {
unprotected_headers.push(header.clone());
}
_ => {
// Other headers are removed from unprotected part.
}
}
} else {

There is an open PR #6640 to protect the Date by replacing it with unix epoch in the outer header.

However, it cannot be merged because mimeparser uses unprotected timestamp before trying to decrypt the message:

core/src/mimeparser.rs

Lines 234 to 235 in e5a3eae

let mut timestamp_sent =
Self::get_timestamp_sent(&mail.headers, timestamp_rcvd, timestamp_rcvd);

@link2xt link2xt added the bug Something is not working label Mar 11, 2025
@link2xt link2xt self-assigned this Mar 11, 2025
@link2xt link2xt linked a pull request Mar 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant