๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #3210

Bug#1152999: rspamd: unbounded recursion on nested message/rfc822 parts (remote DoS)

#3210
From: Paul Menzel
Date: Wed, 04 Nov 2026 09:50
50 lines
3668 bytes
Package: rspamd
Version: 3.12.1-1
Severity: important
Tags: security upstream fixed-upstream
Control: fixed -1 4.1.5-1
X-Debbugs-Cc: team@security.debian.org

Dear Debian folks,


AI disclaimer: Drafted with claude-opus-5.5 from the upstream commits 
and the Debian source of rspamd 3.12.1-1, and reviewed by me.

The MIME parser of rspamd 3.12.1 limits nesting to max_nested = 64 
(src/libmime/mime_parser.c:38), but the limit is never reached for 
message/rfc822 parts. When it descends into an embedded message, the 
parser copies the nesting level into a new runtime (line 1552) and 
increments only the parentโ€™s counter, which the recursion does not use. 
The depth check at lines 1171 and 1453 therefore never fires.

A mail consisting of a chain of bare "Content-Type: message/rfc822" 
wrappers (about 34 bytes per level) makes the recursion depth limited 
only by the message size. This exhausts the worker stack and crashes it. 
Depths that do not crash still cost quadratic CPU time because of the 
boundary pre-scan at each level. Any sender can trigger this by mail 
(SMTP/milter) or over the HTTP scan interface. If the MTA lets mail 
through when the scan fails, the mail is then delivered unscanned.

Upstream fixed it in 4.1.2, with a regression test that feeds a 
500-level chain:

   commit 562c7bee0f3d57cdb8d9081911a4c8e85ae36938
   [CritFix] mime_parser: bound message/rfc822 recursion depth
  
https://github.com/rspamd/rspamd/commit/562c7bee0f3d57cdb8d9081911a4c8e85ae36938

The patch applies cleanly to 3.12.1. unstable and testing (4.1.5-1) 
contain the fix; trixie does not. I found no CVE ID for this issue.

Could you please apply the fix to trixie through a stable update, or 
coordinate a DSA with the security team?

I did not try to reproduce the crash on a running system. The analysis 
is based on the upstream commit and the Debian source of 3.12.1-1 (whose 
three patches do not touch the MIME parser).


Kind regards,

Paul
Technical Details
Message-ID: <NVFMZ-9M8v-1@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Paul Menzel <pmenzel@molgen.mpg.de>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1152999: rspamd: unbounded recursion on nested message/rfc822 parts (remote DoS)
Date: Wed, 04 Nov 2026 10:50:01 +0100
Message-ID: <NVFMZ-9M8v-1@gated-at.bofh.it>
X-Original-To: submit@bugs.debian.org
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Nov  4 09:47:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.45
Reply-To: Paul Menzel <pmenzel@molgen.mpg.de>, 1152999@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: team@security.debian.org, sbadia@debian.org
X-Debian-Pr-Message: report 1152999
X-Debian-Pr-Package: rspamd
X-Debian-Pr-Keywords: fixed-upstream security upstream
X-Debian-Pr-Source: rspamd
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2000575
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 50
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 4 Nov 2026 10:44:09 +0100
X-Original-Message-ID: <c52800be-2d5f-4ad1-a4eb-a23bbfa6f93f@molgen.mpg.de>