Dear Exim maintainers,
I am testing SMTP implementation conformance against RFC 5321 and found a
possible issue in Exim 4.99.4.
RFC 5321 Section 4.5.3.1.4 says that the maximum total length of an SMTP
command line, including the command word and , is 512 octets. However, in my
local tests Exim accepts HELO/EHLO command lines of 513 octets and returns 250
success.
Tested version:
- Exim tag: exim-4.99.4
- Commit: aae0c4c3fba1f7e50971ba250ddbbedb583d48a6
- Source: https://code.exim.org/exim/exim.git
- Local build from the tagged source, with no tracked source modifications
The test commands were:
HELO case:
"HELO " + "a" * 506 + "\r\n"
Length calculation:
- "HELO ": 5 octets
- argument: 506 octets
- CRLF: 2 octets
- total: 513 octets
EHLO case:
"EHLO " + "a" * 506 + "\r\n"
Observed behavior:
- HELO 513 octets: 100/100 runs returned 250
- EHLO 513 octets: 100/100 runs returned 250
Example EHLO response:
250-localhost Hello aaaa...aaaa [127.0.0.1]
250-SIZE 52428800
250-LIMITS MAILMAX=1000 RCPTMAX=50000
250-8BITMIME 250-PIPELINING
250-PIPECONNECT
250-CHUNKING
250 HELP
My understanding is that a 513-octet HELO/EHLO command line should be rejected,
for example with a 500-style “line too long” response, unless an SMTP extension
explicitly increases the applicable command line length limit. I did not find
an advertised extension that appears to increase the HELO/EHLO command line
length limit.
I also noticed that Exim’s SMTP command buffer is much larger than 512 octets,
and the overlong- line handling appears to trigger only near that internal
buffer limit rather than at the RFC 5321 command line limit.
Could you please confirm whether this behavior is intentional in Exim, or
whether it should be treated as an SMTP conformance bug?
I am not claiming this is directly exploitable as a memory safety issue. The
impact I see is protocol conformance divergence: Exim accepts an overlong SMTP
command line and moves the session forward successfully, which can affect
strict SMTP clients, intermediaries, or protocol state- machine checks.
Please let me know if you would like a minimal standalone reproducer or any
additional environment details.
Best regards,
Bocheng Cao
曹博程
[email protected]
--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## [email protected]
## Exim details at https://www.exim.org/
## Please use the Wiki with this list - https://code.exim.org/exim/wiki/wiki