]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Minor] spf: fix over-read on a bare "spf2." sender-id record
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 20 May 2026 12:08:40 +0000 (13:08 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 20 May 2026 12:08:40 +0000 (13:08 +0100)
commit59f1ff841584ec8aa720da346e1016d1531a40fa
tree488180812e0e5bed6646d053cdedafa24fd7edb4
parentc2fd2e002fce1fa846bc9278da1616459b9a5092
[Minor] spf: fix over-read on a bare "spf2." sender-id record

start_spf_parse validated only the "spf2." prefix (sizeof - 1) but
then advanced begin by the full sizeof, skipping one unvalidated
byte. A TXT record consisting of exactly "spf2." made the following
'/' check read past the logical end of the string, and could chain
into parse_spf_scopes walking past the allocation.

Advance past the validated prefix only, then check the version digit
and '/' with short-circuiting so neither read goes past the
terminator.
src/libserver/spf.c