From unknown Tue Aug 19 14:24:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#30160 <30160@debbugs.gnu.org> To: bug#30160 <30160@debbugs.gnu.org> Subject: Status: cat buffer overflow? Reply-To: bug#30160 <30160@debbugs.gnu.org> Date: Tue, 19 Aug 2025 21:24:07 +0000 retitle 30160 cat buffer overflow? reassign 30160 coreutils submitter 30160 Rdrpenguin Minecraft and More severity 30160 normal tag 30160 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 18 11:27:01 2018 Received: (at submit) by debbugs.gnu.org; 18 Jan 2018 16:27:01 +0000 Received: from localhost ([127.0.0.1]:33572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecD1p-00018s-BF for submit@debbugs.gnu.org; Thu, 18 Jan 2018 11:27:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ec9M6-0001de-RG for submit@debbugs.gnu.org; Thu, 18 Jan 2018 07:31:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ec9M0-0006P7-Ne for submit@debbugs.gnu.org; Thu, 18 Jan 2018 07:31:37 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56140) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ec9M0-0006Oz-Js for submit@debbugs.gnu.org; Thu, 18 Jan 2018 07:31:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec9Lu-0007X5-QH for bug-coreutils@gnu.org; Thu, 18 Jan 2018 07:31:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ec9Ls-0006Ks-Dv for bug-coreutils@gnu.org; Thu, 18 Jan 2018 07:31:29 -0500 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:36029) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ec9Ls-0006Jk-5o for bug-coreutils@gnu.org; Thu, 18 Jan 2018 07:31:28 -0500 Received: by mail-lf0-x22d.google.com with SMTP id t79so11065069lfe.3 for ; Thu, 18 Jan 2018 04:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=aXK7MOamx/nvCZ/V+cecN3ojRewD+yMFF8fpnxuQzYQ=; b=nGahY8SANI1G7JUltsLQr2YH5YXg3ymHYjHmG7xn18aJMjAnXduyDGGdJp+6AtPzBJ rCNq2ghiF+A8sqy/Um+7XPvn05sAfggofss6IC1oWybgJHwnLciB4qC553LiPl0SrdZo sajITuAK6dhZS6wx/SKi4YUcCDmhpRP5gCusmpdJQ4jLxPoeLr1BGtbWanugAaUt+7TK 818/B/vC1FxBHOyIEAzzIBLZRZeVhTV/u15+D3qfNGeZ/KUeR7xoJu/ueEtW07P06IpM jPvMC6waRQogq0BT+nBf+o2LLFNAs/hWJMJcvxGLczwfXcgLsvNaF4nDL+htJ2L8UXtd 1+jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=aXK7MOamx/nvCZ/V+cecN3ojRewD+yMFF8fpnxuQzYQ=; b=bsqcQA6i7I4Bf8w5KdilSwXLhOoCZLo9v16MpVJU8HXvxo4P0TV3D879afi1JWLHQA m4cZYrP9L2+fnvBG0pXtp3YBfQF7+RHaZVgH7+7hAO2+zo9Bw1z1zICbVz5OrfJJMLn1 XMy+TQk9H7mT5rG3j10tnaQloF8LZR220U3qWHHSA+yLLQg2yl7SLFKpIWCrd/H9jAX7 RkWI0tqwHc5rM/gEZzc1dK2/sRCPaw2F+QhFBgaaTKn8/XMtrKsZrxruS86ePSIDWOYx 6xgk4Dw7/BouibTV5GsP+SM0gLhJ6JxAdfnkXK8pukBeUwPAJKmsJJXJ2Y06IMX3rGz9 0qNA== X-Gm-Message-State: AKGB3mLpDsQeFzeXzUpN597C5gPU4kVQ1lB3hNSnG4qdOg9i6vUJOWSI hy1O/6Q8uQrmkyIxfkrKX9R1/MZMm15mcEo+upE= X-Google-Smtp-Source: ACJfBoubsMrA29Sq1gdrRfUys+c7fm8ieGJJl6IoaUPksEGuWSeTUu/aN8/9ppfQVT0rErujDK6inL5sm9bEoxZoDyY= X-Received: by 10.46.33.163 with SMTP id h35mr29289611lji.0.1516278686027; Thu, 18 Jan 2018 04:31:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.179.12.74 with HTTP; Thu, 18 Jan 2018 04:31:05 -0800 (PST) From: Rdrpenguin Minecraft and More Date: Thu, 18 Jan 2018 06:31:05 -0600 Message-ID: Subject: cat buffer overflow? To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary="001a1142c73e76137005630c244d" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 18 Jan 2018 11:27:00 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) --001a1142c73e76137005630c244d Content-Type: text/plain; charset="UTF-8" If 'cat' is run with a big enough file, say /dev/sda, the terminal gets corrupted. This corruption may also extend beyond the terminal. Steps to reproduce: 1. Run '/bin/cat /dev/sda'. 2. Wait from 2 to 3 minutes. 3. Ctrl-C to exit. 4. Observe corrupted terminal This was tested on gnome-terminal in Ubuntu 16.04. It may or may not happen in other terminals / flavors, and it may produce different errors too. --001a1142c73e76137005630c244d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If 'cat' is run with a big enough file, say /dev/s= da, the terminal gets corrupted. This corruption may also extend beyond the= terminal.

Steps to reproduce:
1. Run '/bi= n/cat /dev/sda'.
2. Wait from 2 to 3 minutes.
3. Ct= rl-C to exit.
4. Observe corrupted terminal

<= div>This was tested on gnome-terminal in Ubuntu 16.04. It may or may not ha= ppen in other terminals / flavors, and it may produce different errors too.=
--001a1142c73e76137005630c244d-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 19 03:20:40 2018 Received: (at 30160) by debbugs.gnu.org; 19 Jan 2018 08:20:40 +0000 Received: from localhost ([127.0.0.1]:34019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecRui-0005c2-Fw for submit@debbugs.gnu.org; Fri, 19 Jan 2018 03:20:40 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:60624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecRuh-0005bn-H8; Fri, 19 Jan 2018 03:20:39 -0500 Received: from [10.0.2.15] ([81.24.19.74]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MXYog-1eI9by1jz4-00WTQR; Fri, 19 Jan 2018 09:20:32 +0100 Subject: Re: bug#30160: cat buffer overflow? To: Rdrpenguin Minecraft and More , 30160@debbugs.gnu.org, GNU bug control References: From: Bernhard Voelker Message-ID: <560cc459-9b11-51f4-5c01-7c111800dfb0@bernhard-voelker.de> Date: Fri, 19 Jan 2018 09:20:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE-1901 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:u0RIr5BhpsAS9PiM1fKMVWB7sRaIOjhB5IkEGYX3unCfag4j1L1 +jf5nskpL982xHFoG2uaRRsRrQ5V9BNnpPOpTxTCI/7DaEMi1POoSXhamlTb7k46n3rcqXb gMFpanoncDuptG4s4Obr0u4J/s6wSjrHMJJmuyZFEgFqoh72GsRPapmZ9CheHTBm1SKMaaV HztQXYrksaXVnYnUaypTA== X-UI-Out-Filterresults: notjunk:1;V01:K0:YoLGJ10cb5M=:JMmHCc7K9sVYh5483Qz5AF Mcnpltu4p40xbaCqbMz2Q24gR4f17tHHfffPKU5KMvkiKWvmTsrmtTyhp4QBA6gEpRYY1DaGU oyKArPJzeawFqy5ztwewF4yL89PxvsuRv+x9NNkb/vGN/IWKGvoGmoCjKBEgbNB5TehRQFFfN v/VirgBvcSxLusHjtOtT5zNWzo2CWuehsqVOD+qRMg+bKlvqdXmCVBo4jMIuY9sC/BeLelt5k zd7z31rCxMXSKxkCRwL3Q5ohFmvDqMzQIOTbStM0pteYupTCHpskoSSrrCsEKTPbD2S3yFXa7 KA2m7KUmTYWoUHw4kPhXP7O2IYqXiRoBubq2Ezv9veYdyBw2an/CY6CKDRLI7USTSlFMNy8u6 I4Y8YxC+CIUVNB+fKO63MsXUF42AaPRRF10fdCX+gSF5LRgnS+Vpog4IAhVzrOr9x3lLptW2P dJ+BpV5LD5MkHWrVZgC7jGQZCcY5fGN3TTksw32XNUagx+1ecbK0lhT/GPheSeSI/CH4MCcGK OlpPYC3xfaJm+rED9xdqAV/5G3uwBUXKmHNhXRvLxURualdiLs559dO6k1QbAppRBi+S7bBMB K0XyO2phPU6uulqm5RrghhVJnnK8ZabHppKGzBF8f4LUCtFcyoQC8X8q4Ik3bRzPZ2qk9UY2E nir/Ls26/I5R3io179vXT9utoZQ75lwZTlSG/MZishzdQl2SKrZe8XVGhT3xmcvhNLStQF8v/ sKRWVyqL5OqtfXpv+k099D8xB2y47ympOmTt3RxUJifOpE7o8gy0BFV+amE= X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30160 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) tag 30160 notabug close 30160 stop On 01/18/2018 01:31 PM, Rdrpenguin Minecraft and More wrote: > If 'cat' is run with a big enough file, say /dev/sda, the terminal gets > corrupted. This corruption may also extend beyond the terminal. > > Steps to reproduce: > 1. Run '/bin/cat /dev/sda'. > 2. Wait from 2 to 3 minutes. > 3. Ctrl-C to exit. > 4. Observe corrupted terminal > > This was tested on gnome-terminal in Ubuntu 16.04. It may or may not happen > in other terminals / flavors, and it may produce different errors too. It is pretty clear that the terminal is messed up when someone writes random binary data to it. You're way better of using less(1) to prevent getting potentially dangerous control sequences to the terminal. If you really want to display the content of /dev/sda in a terminal, you could maybe also use cat's -v or -A options, but I wonder if someone really could read that fast. Finally, you didn't proof that something is wrong with 'cat'. Thus I'm closing this as 'not a bug' in our bug tracker. Have a nice day, Berny From unknown Tue Aug 19 14:24:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 16 Feb 2018 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator