Package: rspamd
Version: 3.4-1
Severity: important
Tags: security upstream fixed-upstream
Found: 3.12.1-1
Found: 4.1.5-1
X-Debbugs-Cc: Debian Security Team <[email protected]>

Hi,

The DNS reply parser bundled in rspamd (contrib/librdns/parse.c) has
wrapping length arithmetic that a crafted DNS answer turns into heap
memory corruption in the rspamd worker. rspamd looks up SPF, DKIM and
DMARC TXT records of the sender's domain for every message it scans,
so whoever controls the DNS of a sender domain reaches the parser with
one email.

Upstream fixed this in rspamd 4.2.0 with this commit:

    
https://github.com/rspamd/rspamd/commit/03edf12ba600dd0cf2e40e1704f1a20858f85c78
    [CritFix] rdns: harden DNS reply parser against malformed packets

As the commit message says, the TXT chunk count was kept in an 8-bit
counter that wrapped after 255 segments, and name decoding and
resource records were parsed with unchecked or wrapping arithmetic.
The commit bounds name decoding, length-checks every record and counts
TXT chunks in size_t. rspamd has published no advisory or CVE for it
so far.

Affected in Debian: bookworm 3.4-1, trixie 3.12.1-1, forky and sid
4.1.5-1. All of them are older than 4.2.0 and do not carry the fix.
Upstream 4.2.0 and later are fixed.

The upstream commit touches dns_private.h, parse.c, parse.h and
resolver.c in contrib/librdns. For 3.x we have a smaller parse.c-only
backport that applies to 3.4 and 3.12.1. The security team already has
it, and we can attach it here if that helps.

Thanks,
ozgun kultekin, wakefield (wakefield.co)

Reply via email to