Skip to content

🥅 Fix premature tagged response guard for IDLE - #688

Merged
nevans merged 1 commit into
masterfrom
fix-idle-premature-tagged-response-guard
Jun 4, 2026
Merged

🥅 Fix premature tagged response guard for IDLE#688
nevans merged 1 commit into
masterfrom
fix-idle-premature-tagged-response-guard

Conversation

@nevans

@nevans nevans commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

The premature tagged OK response guard that was added for STARTTLS, in #664, didn't correctly drop the connection when it was triggered for IDLE.

Note that finish_command was moved until after sending the command, so the raised error would be consistent with all other commands.

Note that, although this code was added for hardening against a class of security vulnerability, failing to protect against this for IDLE is not considered a security vulnerability. If the server wants to cancel IDLE prematurely, it can still do that. Arguably, it should not be allowed to do that, because sending a tagged response for a command with an outstanding continuation request puts the connection into a weird state. Nevertheless, several very popular email servers do just that.

The premature tagged `OK` response guard that was added for `STARTTLS`,
in #664, didn't correctly drop the connection when it was triggered for
`IDLE`.

Note that `finish_command` was moved until _after_ sending the
command, so the raised error would be consistent with all other
commands.
@nevans nevans added the bug Something isn't working label Jun 4, 2026
@nevans
nevans merged commit 816b2c0 into master Jun 4, 2026
39 checks passed
@nevans
nevans deleted the fix-idle-premature-tagged-response-guard branch June 4, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

1 participant