Skip to content

Improve filtermail checks for encrypted messages#320

Merged
link2xt merged 2 commits intomainfrom
link2xt/filtermail-hardening
Jun 11, 2024
Merged

Improve filtermail checks for encrypted messages#320
link2xt merged 2 commits intomainfrom
link2xt/filtermail-hardening

Conversation

@link2xt
Copy link
Copy Markdown
Contributor

@link2xt link2xt commented Jun 11, 2024

Ensure that first part only contains "Version: 1"
and second part only contains base64 payload
enclosed in "-----BEGIN PGP MESSAGE-----"
and "-----END PGP MESSAGE-----".

Second commit removes support for unencrypted MDNs.

@link2xt link2xt force-pushed the link2xt/filtermail-hardening branch 4 times, most recently from 0dc991d to f9cf2c8 Compare June 11, 2024 02:43
@link2xt link2xt requested review from hagenest and missytake June 11, 2024 02:47
Comment thread chatmaild/src/chatmaild/filtermail.py Outdated

for line in payload.split("\r\n"):
if NONBASE64_REGEX.match(line):
return False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this could be a multi-line regex match to avoid splitting and iterating the lines.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replaced with a single regex and fullmatch

Comment thread CHANGELOG.md

## untagged

- improve filtermail checks for encrypted messages and drop support for unencrypted MDNs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correct me, if I'm wrong, but this does affect read receipts on chatmail, right? Maybe we should make this clearer, before we're getting bug reports?
Can't really tell, if most of our users know what MDN means - I certanily didn't a few months ago.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See second commit message, read receipts are already encrypted in 1.44 and in the new 1.46 release.

link2xt added 2 commits June 11, 2024 14:12
Ensure that first part only contains "Version: 1"
and second part only contains base64 payload
enclosed in "-----BEGIN PGP MESSAGE-----"
and "-----END PGP MESSAGE-----".
Delta Chat does not send them since 1.43.
1.44 has been released for a while already
and 1.46 is in the process of being released.
@link2xt link2xt force-pushed the link2xt/filtermail-hardening branch from f9cf2c8 to f71c899 Compare June 11, 2024 14:12
Copy link
Copy Markdown
Contributor

@hpk42 hpk42 left a comment

Choose a reason for hiding this comment

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

lgtm -- i assume the staging CI deploy tests fail for unrelated reasons.

@link2xt link2xt merged commit 72f4e9e into main Jun 11, 2024
@link2xt link2xt deleted the link2xt/filtermail-hardening branch June 11, 2024 16:18
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.

3 participants