NetBSD Problem Report #60942

From www@netbsd.org  Fri Oct 30 00:24:30 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4B8F61A923B
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 30 Oct 2026 00:24:30 +0000 (UTC)
Message-Id: <20261030002429.621151A923C@mollari.NetBSD.org>
Date: Fri, 30 Oct 2026 00:24:29 +0000 (UTC)
From: kilian.feess@posteo.de
Reply-To: kilian.feess@posteo.de
To: gnats-bugs@NetBSD.org
Subject: atto: stack buffer overflow on filename completion
X-Send-Pr-Version: www-1.0
X-From4GNATS: "kilian.feess@posteo.de via gnats" <gnats-admin@NetBSD.org>

>Number:         60942
>Category:       bin
>Synopsis:       atto: stack buffer overflow on filename completion
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 30 00:25:00 +0000 2026
>Originator:     Kilian Feess
>Release:        NetBSD-current (11.99.9), src/usr.bin/atto as of 2026-10-30
>Organization:
>Environment:
Linux CelsiusM770 7.0.0-42-generic #42-Ubuntu SMP PREEMPT_DYNAMIC Thu Oct 15 08:06:44 UTC 2026 x86_64 GNU/Linux

>Description:
char sys_command[255] in complete.c:12 is built by

completion.c:52
strcpy(sys_command, "echo ");
strcat(sys_command, buf);
if (!iswild) strcat(sys_command, "*");
strcat(sys_command, " >");
strcat(sys_command, temp_file);
strcat(sys_command, " 2>&1");
>How-To-Repeat:
python3 -c "print('a'*254)" # copy the output to your clipboard

# build atto with address sanitizer
./atto-asan
# C-x C-f
# paste your clipboard
# press tab

something like this should appear:

ERROR: AddressSanitizer: stack-buffer-overflow WRITE of size 1 at ...
    #0 strcat ... complete.c:58 in getfilename
    Frame: 'sys_command' ... <offset 255> is located 0 bytes inside of
    255-byte region [frame]
>Fix:
similar to my last report, use glob.h for in-process completion. This removes this whole code path.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.