From nobody Sun Jun 28 18:40:58 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gpJBz17kfz6jkdc for ; Sun, 28 Jun 2026 18:40:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gpJBy5mKVz3Yb9 for ; Sun, 28 Jun 2026 18:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782672058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/O6aF/95us8D7hXUijaMu6njy6u8u200zYcwqQHWlCM=; b=LvYyHiUGCACJ8iqHpKG+STs20QHeAwUnD17RRA6XaolWJxjb1Rf4WwE8Jk+Skxpjd9PoKv TNggl/PD0Th/iB0pRvHBNyL7tmrAXq82OkPPbVLYzy5FbrE4VWOSYKUrr9mA5bTKDMLbqz s9CPbu9F9Dw5FVWtztB8lNDmewSE594VZYHJpZ7iypQhwV1xdX+EX9Z6EFdv9xHjoCcDgq Co6c23uwttO8//vBAu8Xq3NFacqLNC/2NoJFLFbIEzjyZyj217IKwKtEpiUo0MQYJ2Hk1E qw8FcxhKgOmRJmEpoKxYpIkDeggdG3uqXT2B8KBzgN6nZuzlcpyL+hAlMc5a6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782672058; a=rsa-sha256; cv=none; b=jiszlWb9hJbUvVrHIR+479yCZfxKOYXfmrr3ao1ftAcpeVxwu6LOxFqxdq54HLDsHPwSEH ZnfMDq02Urfm09jJWAUqFdrb4Qv/gy0NOSHnj4yJ1y9CpeqRgGLd9evy+rY6Hr620gZ+E8 QLGC7gZAprx8uMerB1Jf7aibbwstfZTXjUKLupaYwtHK0OVsG3Esq0aHcpA7fkQId4tb+4 yjijYTJIv4/EThXqZmnXFjiz6u+CHVN6bNHkpIphqyX4o1246SImobws1wM0CtYWNLz9Yw Y2wzl5kkKscYig4aYT8bnXDXJ9o6x+ukzMIwKoY7leenvmpyYC+mVB8KFfiD7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782672058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/O6aF/95us8D7hXUijaMu6njy6u8u200zYcwqQHWlCM=; b=hmkjEYWT/Lw5pXa4AiBm3V8p4Y5HtEiCFtCdUkip8PSvfbf/ytQ48ZY+7n7GBYnnlQE+xW GoAeGImETzrkX2ze5F3Xkb9pOQuoKEghyfsQbs9IWq3OZN5DUmWHLtRx+IbeXCnaTsMyHu LaNtu9sVJSvYZyJs4j+vVatO0dvdEP7cgTxLXgdWdIPkSbZikGbsI/6yDT6ddOfYIzS6ze ewhgFdHfZUJtGFP+fvHKLar1dT3QpTkbgECn5HiFmkxrtD1UvRZWWZJ7pRPFzZRej0RHix fOsYpKSSLXflTF85YLhP/41/PNXEg+qxHxzz+mkfytS43uxyWAi0kDe74PjMoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gpJBy4fBcz73S for ; Sun, 28 Jun 2026 18:40:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1a5f0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 28 Jun 2026 18:40:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 2bb8d7c7ecb2 - stable/15 - nuageinit: validate set-name to prevent shell injection in variable names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 2bb8d7c7ecb200257f4eb71f4c35f00a0cf89df7 Auto-Submitted: auto-generated Date: Sun, 28 Jun 2026 18:40:58 +0000 Message-Id: <6a416aba.1a5f0.4b3a8b3f@gitrepo.freebsd.org> The branch stable/15 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2bb8d7c7ecb200257f4eb71f4c35f00a0cf89df7 commit 2bb8d7c7ecb200257f4eb71f4c35f00a0cf89df7 Author: Baptiste Daroussin AuthorDate: 2026-06-09 14:24:56 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-28 18:39:56 +0000 nuageinit: validate set-name to prevent shell injection in variable names Shell variable names cannot be safely quoted with shell_escape() — only alphanumeric characters are valid. Add validation that set-name only matches [a-zA-Z0-9]+; invalid values are rejected with a warning and the rename is skipped entirely. (cherry picked from commit 13fb6dbc738f4ba30e78a8fb21efa1382c520d33) --- libexec/nuageinit/nuageinit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 8ca1a2c558c8..ba26f504effb 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -429,8 +429,12 @@ local function network_config(obj) local ifaces = get_ifaces_by_mac() local matched = ifaces[v.match.macaddress] if matched and matched == interface then - network:write("ifconfig_" .. interface .. "_name=" .. nuage.shell_escape(v["set-name"]) .. "\n") - interface = v["set-name"] + if not v["set-name"]:match("^[a-zA-Z0-9]+$") then + nuage.warn("set-name contains invalid characters, ignoring: " .. v["set-name"]) + else + network:write("ifconfig_" .. interface .. "_name=" .. nuage.shell_escape(v["set-name"]) .. "\n") + interface = v["set-name"] + end end end if v.dhcp4 then