Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp118076lqo; Thu, 9 May 2024 14:38:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVuVLDAmiXAJmVkaTurLW4zGpdJE7lvyfHwomPt2fXG3EgOA+hGKUGBm/xRn/Rgx1VsKPEGcmCuDFkTgE4RzMdNVyAnqPwewx4y8mAx0w== X-Google-Smtp-Source: AGHT+IFu46mNXzOiGdHHlyppTSpy3eAzjLwiCNrpOU+T9PrObcJGJaStWwcWw1kUuK3HY3mslZJr X-Received: by 2002:a25:2b06:0:b0:de4:8b7:7bbd with SMTP id 3f1490d57ef6-dee4f32c95fmr743338276.15.1715290718076; Thu, 09 May 2024 14:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715290718; cv=none; d=google.com; s=arc-20160816; b=dykyjVBMZ7y5xehanc+5Wdgac2d1PJAnIzdcPQDnazgGLZ/hb0goJF5CDLNzDlwdaq 87huKjF4TiZXxn/gj25xW3MI2tjn+g43eVNSX1jy2EBzaBM4vEcqKQkhJj5t9Glp5muR hJliOxrLY9j0gwbu5pYSVlM/79jVd7mc+h/cKmZC8Fw2fOgHnk5E6iQibf3j+1FMycbo TrWKWGe4ypzpXCDK6ye+Ytx6RWuEO/7MDIcmV1ec3TIaJ0NiNMERibjJ17SuheqFDh6S 3ZxnGxzVkhYyOMk//N6kXXP8UMYSK34zCoQmZlZIRupusnYtjeUMwqD2kNUFXLb7t558 y6eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:author:in-reply-to:content-disposition:mime-version :references:message-id:to:from:date:delivered-to:delivered-to :reply-to:list-id:list-subscribe:list-unsubscribe:list-help :list-post:precedence:mailing-list; bh=NamguBez3KV4LYUMfP9/fII+oNHhgRvkiTAQI9bv82g=; fh=9jsPTyo6edd9xvAeG+KFFrRrXMmgB/RdwUKOrvy9dcA=; b=sOwh2jKYg2YUOY1eYCTBBVxo4b0kO32iTuq5ZonWEfc7W5Z7eRpzqOVl4eIFWfzboc RijpL5p3VraIPRWw3oz7pAynhllpzOgaZ+a+KU7bJ9spqWf+BDe903L3ASqs72ebM9ra LKoS4PNoK1S95lIUJbmh0wwr5A1CAojRkecFKf2D2XRM+lCQ1ooN81YwXSpuElukFC6q 5SNBzIbLXYyh7IeMupKZw0tojZdMOOXIet1xoqpEF1X0+MJnhbLAk9ZSar0EA2tpueNu LW1xwxLAF38LpelUWf3o4nhgCnpVa/ika2IbWOo8WxxNSOHNyPfutJ378GcgjYUlavax iaEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of oss-security-return-30141-linux.lists.archive=gmail.com@lists.openwall.com designates 193.110.157.125 as permitted sender) smtp.mailfrom="oss-security-return-30141-linux.lists.archive=gmail.com@lists.openwall.com" Return-Path: Received: from second.openwall.net (second.openwall.net. [193.110.157.125]) by mx.google.com with SMTP id d75a77b69052e-43df566f65fsi23046611cf.324.2024.05.09.14.38.37 for ; Thu, 09 May 2024 14:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of oss-security-return-30141-linux.lists.archive=gmail.com@lists.openwall.com designates 193.110.157.125 as permitted sender) client-ip=193.110.157.125; Authentication-Results: mx.google.com; spf=pass (google.com: domain of oss-security-return-30141-linux.lists.archive=gmail.com@lists.openwall.com designates 193.110.157.125 as permitted sender) smtp.mailfrom="oss-security-return-30141-linux.lists.archive=gmail.com@lists.openwall.com" Received: (qmail 3537 invoked by uid 550); 9 May 2024 21:38:14 -0000 Mailing-List: contact oss-security-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: oss-security@lists.openwall.com Delivered-To: mailing list oss-security@lists.openwall.com Delivered-To: moderator for oss-security@lists.openwall.com Received: (qmail 1642 invoked from network); 9 May 2024 17:45:38 -0000 Date: Thu, 9 May 2024 19:45:29 +0200 From: Erik Auerswald To: oss-security@lists.openwall.com Message-ID: <20240509174529.GA31480@unix-ag.uni-kl.de> References: <20231221143630.GD14101@suse.de> <20240430224823.uA8Nr1Cp@steffen%sdaoden.eu> <20240502182146.ygWZjB-Z@steffen%sdaoden.eu> <20240502195319.GA19209@openwall.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Author: Erik Auerswald X-Spam-Status: No, hits=-1, tests=ALL_TRUSTED=-1 X-Spam-Score: (-1) X-Spam-Flag: NO Subject: Re: [oss-security] New SMTP smuggling attack Hi, On Wed, May 08, 2024 at 10:01:16AM -0500, Mark Esler wrote: > [...] > On 4/30/24 14:42, Erik Auerswald wrote: > > > > Well, my reading of the RFC does not forbid this sequence. RFC 5321 > > clearly does not require transforming this sequence into another > > sequence. > > I should have initially clarified that _"forbidden" pattern_ refers > to RFC 5321 section 4.5.2: > > Without some provision for data transparency, the character sequence > "." ends the mail text and cannot be sent by the user. > In general, users are not aware of such "forbidden" sequences. To > allow all user composed text to be transmitted transparently, the > following procedures are used: > > o Before sending a line of mail text, the SMTP client checks the > first character of the line. If it is a period, one additional > period is inserted at the beginning of the line. > > o When a line of mail text is received by the SMTP server, it checks > the line. If the line is composed of a single period, it is > treated as the end of mail indicator. If the first character is a > period and there are other characters on the line, the first > character is deleted. > > I believe "." is a forbidden sequence. Resnick's > response to this sequence is: > "Yes, the sending MTA should strip the NUL (as per RFC 5321 section > 4.1.1.4) and then dot-stuff the dot on the line by itself (as per > RFC 5321 section 4.5.2)." This section of the RFC explicitly states that any ASCII character is allowed (see the first sentence you omitted from your quote). Any ASCII character includes NUL. Stripping the NUL violates the standard. This is obvious. The RFC text is clear. > > You to seem to advocate for "repair". The "repair" strategy makes > > Cisco's ESA vulnerable. I would argue that rejecting messages is > > less insecure. > > By default, Cisco ESA is not RFC compliant. The Cisco ESA has been called out in the original SMTP smuggling report as facilitating SMTP smuggling attacks, thus it is useful as an example. It provides an example where a side-effect of rewriting email content is vulnerability to "SMTP smuggling". The important part is that rewriting email content might have unintended side-effects, independent of RFC compliance. > Their "clean" option only replaces bare and characters with > . So that . becomes .. Both of these are > "forbidden" patterns and should be dot stuffed. The one and only "forbidden" sequence is ".". The one and only sequence to be "dot stuffed" is ".". I think that "forbidden" is a bad choice of words. It does not mean that some authority has "forbidden" sending this sequence inside an email, but that SMTP needs a way to transparently transport the "forbidden" sequence for the user who is explicitly *allowed* to send it: "To allow all user composed text to be transmitted transparently" "The mail data may contain any of the 128 ASCII characters." Best regards, Erik