From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id CA72E1BB06; Sat, 01 Nov 2025 14:09:55 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 44DFD1BA6F; Sat, 01 Nov 2025 14:09:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.158]) by atuin.qyliss.net (Postfix) with ESMTPS id 8D47D1BA6E for ; Sat, 01 Nov 2025 14:09:51 +0000 (UTC) Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id BE7437A01B3; Sat, 1 Nov 2025 10:09:49 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Sat, 01 Nov 2025 10:09:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1762006189; x=1762092589; bh=hIjE3uFaAT WtobHJoyitfv80FVQPrBtW2fI7vKDRB9U=; b=SWVMJ1+n8MLMW8W1BaffbWEh00 yrTK2bHDPqbrdw69izLBZzp4ZcTKL7ZcClQAThskx+EAc0lT085UKlBQnzwCko1Q qGY8IxCUmSVRLTgwEHfc/rAXCw5sxkfqCH/q4sXurjFtPwwtEaqKXPcaZUyxzTCO NnZjrbSafjZZlQHlsZdS5XVElATcO4b+A7bhZsCA9F7vLlzDFeNpKOEhX6J/84od i6BKjgF16GVvEmwOklVoMNz0myTsLWu4x9KwCwLAATQ8xXAMWAkfxmy33gTYGBhu XiwgDzTvXucIrermz7M2Dnh8MDJHcPNBhJsoAC6xi01NzFXI7lirKB2GgEVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1762006189; x=1762092589; bh=hIjE3uFaATWtobHJoyitfv80FVQPrBtW2fI 7vKDRB9U=; b=by0Wn85KBpLXsHtls3WYXwGXF8EOrICaPpSNOplds6P51TRxEXc c7tsA+2IIRpHDO1AJ4VgcS3ik9c5625LuKPbUa6yWZTmPXy9kDYix8t640vI7kcM 1YIX64RHutwZN5LZ2yWJ2YwTBF7kC8n9aP1EUf9rIcihBlXyXj77tGEefY4dw6kN 7AfRGriGwDGOYMd7dPk11Hk6hPPrMCU63iw85WTHYK9bXjk3k4WSMvjAOC0IfdjL O+CUN23KkChoiN07qWrowHEH1Ldh56DjapWsw5ZrLtjHz5duHci4XHBncr2YObzh gbCcMtdxHCEOiGESy7Uj1vPv1gjm9C05isw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddujedvheejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefujghffffkgggtsehgtderredttdejnecuhfhrohhmpeetlhihshhsrgcu tfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeetheevud fgjefghefhieejudelkeeljeegvdekueeuhffhgedvveefteevgeetieenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehhihesrghlhihsshgrrd hishdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep uggvmhhiohgsvghnohhurhesghhmrghilhdrtghomhdprhgtphhtthhopeguvghvvghlse hsphgvtghtrhhumhdqohhsrdhorhhg X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 1 Nov 2025 10:09:48 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 9070262CB8EF; Sat, 01 Nov 2025 15:09:47 +0100 (CET) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 3/7] tools: Add directory checker for updates In-Reply-To: <87bjlmq756.fsf@alyssa.is> References: <20251029-updates-v1-0-401c1be2a11b@gmail.com> <20251029-updates-v1-3-401c1be2a11b@gmail.com> <87sef1kjbk.fsf@alyssa.is> <72921587-e951-4bfb-b68e-5cb05fc32609@gmail.com> <87bjlmq756.fsf@alyssa.is> Date: Sat, 01 Nov 2025 15:09:46 +0100 Message-ID: <87zf95q1xx.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: 5GDPUDIGKXMX4TGIC5L75GTM7LUN7GEP X-Message-ID-Hash: 5GDPUDIGKXMX4TGIC5L75GTM7LUN7GEP X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alyssa Ross writes: > Demi Marie Obenour writes: > >> On 10/29/25 08:01, Alyssa Ross wrote: >>> Demi Marie Obenour writes: >>>=20 >>>> Spectrum OS's host has no network access. Updates must be downloaded = by >>>> VMs. The downloads are placed into a bind-mounted directory. The VM >>>> can write whatever it wants into that directory. This includes symlin= ks >>>> that subsequent code might open, which would create a path traversal >>>> vulnerability. It also includes paths with names containing containing >>>> terminal escape sequences, newlines, or other nastiness. Furthermore, >>>> the directory should not have any subdirectories either. >>>> >>>> Add a simple C program that checks for such ugliness and indicates >>>> (via its exit code) if the VM misbehaved. It also ensures that both >>>> SHA256SUMS and SHA256SUMS.gpg are present. >>>> >>>> Signed-off-by: Demi Marie Obenour >>>> --- >>>> host/rootfs/Makefile | 6 +- >>>> lib/kcmdline-utils.mk | 6 ++ >>>> tools/default.nix | 1 + >>>> tools/meson.build | 1 + >>>> tools/updates-dir-check/meson.build | 4 ++ >>>> tools/updates-dir-check/updates-dir-check.c | 94 ++++++++++++++++++++= +++++++++ >>>> 6 files changed, 110 insertions(+), 2 deletions(-) >>>=20 >>> I still don't really understand why this needs to be a C program instead >>> of find -H /path/to/dir -not -type f. None of the other checks seem >>> very necessary? >> >> I trust this code more than I trust (especially) the Busybox >> implementation of find. > > This doesn't really make sense to me. All of this is quite trivial find > behaviour =E2=80=94 not the sort of thing that's unlikely to have been wi= dely > tested. No objection to GNU find though if it helps. (Or even uutils find?) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaQYUqwAKCRBbRZGEIw/w ogTxAP9RVdOay+Ssld3sFq5Hf1B3+lM02FA5os3ag7DsFE7zpgEA+MG7nvRcX+9D EImgZMJ2+ucwb5zP2pzObpl/QIfZnQ4= =vma6 -----END PGP SIGNATURE----- --=-=-=--