From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.devel Subject: Re: Unicode confusables and reordering characters considered harmful, a simple solution Date: Fri, 05 Nov 2021 23:31:38 +0000 Message-ID: <5ad1d47cbd257d65e3ce@heytings.org> References: <831r3yjqo9.fsf@gnu.org> <83v91aibe7.fsf@gnu.org> <87o872s0wf.fsf_-_@db48x.net> <83lf25gm1j.fsf@gnu.org> <83ee7xgio2.fsf@gnu.org> <87fssdrp54.fsf@db48x.net> <831r3xgfz3.fsf@gnu.org> <87v918qx37.fsf@db48x.net> <83o870fjqg.fsf@gnu.org> <7699dbfaffc44df293f3@heytings.org> <83ee7wfe4p.fsf@gnu.org> <7699dbfaff0348867b72@heytings.org> <83a6ikf9pw.fsf@gnu.org> <7699dbfaff090e4342a3@heytings.org> <838ry4f3xf.fsf@gnu.org> <7699dbfaffce8f3a1f41@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2ocIzqAGom" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1521"; mail-complaints-to="usenet@ciao.gmane.io" Cc: cpitclaudel@gmail.com, stefan@marxist.se, yuri.v.khan@gmail.com, db48x@db48x.net, Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 06 00:32:48 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mj8hT-0000B7-Ri for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Nov 2021 00:32:48 +0100 Original-Received: from localhost ([::1]:44884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mj8hS-0005YY-C7 for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 19:32:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj8gS-0004rC-H3 for emacs-devel@gnu.org; Fri, 05 Nov 2021 19:31:44 -0400 Original-Received: from heytings.org ([95.142.160.155]:54850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj8gQ-0004WD-M0; Fri, 05 Nov 2021 19:31:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1636155098; bh=LrlJXJKpdesyGAyKk7/p8bXxmnaCwZZ8pRa914CF7gI=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=CImmUR8xGDAx7iXfMyLP4k2vUU7efR5Jc15riX4nY6turIq98qX6NBWJ9e9dVwrhI Z3AMH35r+FkI9u2RuoYzEABHrHZER3JXE0jYirociN2tjsUn1u1cJaNNT5kIDu4k8k D912cNAZqaAyA8ijxwMRA/NBCuTQ8D8axpzGN+01ktQIv072xH8jgAECM/NrtMtxH8 O7IHILlLDY+QIw0sIOAxGA7QRZasX7gsdyQXZ5UHkV4UZ/K93q8i2fcFgxsjPeJAIy yRxhVHk1AMM1zlwq/lASt51/TVGKHpDRS47DWgUDB/oQTJh4kGL7Ik3btsf05CE/PP Dw7Dm5A3gtGrw== In-Reply-To: Content-ID: <5ad1d47cbdd11cd19b2e@heytings.org> Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278822 Archived-At: --2ocIzqAGom Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-ID: <5ad1d47cbd0ca8fc190c@heytings.org> >>> myfun("=D7=A9=D6=B8=D7=81=D7=9C=D7=95=D6=B9=D7=9D" ,"=D8=A7=D9=84=D8=B3= =D9=91=D9=84=D8=A7=D9=85=D8=B9=D9=84=D9=8A=D9=83=D9=85"); >> >> There is no danger in that example, and in particular nothing=20 >> invisible. > > I'm pretty sure an attacker can use the above confusing arg order to=20 > turn an apparently harmless program into a security hole. > That's possible indeed, but this is not what the "Trojan Source" paper is= =20 about. The example you show is only one instance of the many possible=20 reasons why a piece of code can be difficult to interpret, there are many= =20 others, e.g. misleading indentation in code. The point made by the=20 "Trojan Source" paper is only about invisible reordering control=20 characters. --2ocIzqAGom--