From nobody Tue Jun 9 16:04:32 2026 X-Original-To: dev-commits-src-main@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 4gZYdD6h3lz6gCxd for ; Tue, 09 Jun 2026 16:04:32 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gZYdD4McGz4FMT for ; Tue, 09 Jun 2026 16:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1781021072; 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=wbNoFlNaC34I+VUlfg2fWxYdxyZwHkj+sVHlioyp/Qg=; b=dhXm1UUAQ0+Ks0MxqVMvRhniduoDM1FpknOUtlkPlMO/gU85+H6o3nHlZAHI/VPFtn8En+ qQjs0rtph8Surfo91Imknj1rB0Lf2GAuedxcTCEDYPhSpBmwwnVUoecfSWzZ9eSYU/HWr/ Ch8rj6EZ+Cr90FadmOMoeJlFkx6Y8WkAkKFWr1Ab1d+k1DL1yT43gyYQmT9wHUOLvXSdie R03/wnSnyBpzhLRT45rxul/6VcmRSzS0zAIL03chdBKtatWE4XCCyYLBXrkHX17NnFN+4l 4aaDDSfPZ2wfXMYxEaMA4E7YHZZCXUDbwLvWdDhSZP5OYY77unNl9D0UChpI5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1781021072; a=rsa-sha256; cv=none; b=ocmrmR3B8Hvpu9tfWJAQ8l4Vx4Q4IqKB3f0eRC3j4EIPphQYPEFVD+5Gq8v0jwPub18ZCq wVQDeaR1XH9jg5+8puYxxL4ILZh6dMRVDRQv/SyOMcIh7s10hHmZvaXgXTblaPtkmkcCb5 rzDnc9+tqWnz77sFlfz2LQNsmvQe3udsY4jLad0YmBctjM4ZhZZwsUT1ha+Xqh830o5kuZ kT+VFgu2qyDeIXTj2+zurBqvfoLzNXf9iKlR8t65einZM7Dw3hpFyOxQCKQ3iajLlbYHe5 Wy49RhNkH5wIhtpiqRnTIHxKHnZjgufR1UJZh7419HEpNy4UqKnBd9FwpKfxbA== 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=1781021072; 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=wbNoFlNaC34I+VUlfg2fWxYdxyZwHkj+sVHlioyp/Qg=; b=HP0kLt3fow+cdmPdjJwnFrYMT2Nc9FXwBZjmtQh6tT/CnP3CdjfqycuB29O3slR+fIxfUB nuCbe6yFwFYCJlV75nD+xcB68L/Fiyx10VzuaBLqyYqvidZH5/dVcFPCors8S+q+4Zg6yS QzlqqBOKVTEgyZ5Gve/x9HsXnQjtJ1559kHl5ozlPe7QJ5kx12UawMWeEvtVSb+u/T9sx0 lEDgwvklc5gTtwykDJNdJCjKgKn/YHmjhu1wECd0VFCGEgDBqdaJX79McGLsYY7ZqFBQfO hdetmRrJzJJ+l8wQYFt1vlpWAFpE1u83PbRuLKoc2OX7XemtRvP23BpsjZq9zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gZYdD3wTzzhv2 for ; Tue, 09 Jun 2026 16:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22fa1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 09 Jun 2026 16:04:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 13fb6dbc738f - main - nuageinit: validate set-name to prevent shell injection in variable names List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 13fb6dbc738f4ba30e78a8fb21efa1382c520d33 Auto-Submitted: auto-generated Date: Tue, 09 Jun 2026 16:04:32 +0000 Message-Id: <6a283990.22fa1.77541917@gitrepo.freebsd.org> The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=13fb6dbc738f4ba30e78a8fb21efa1382c520d33 commit 13fb6dbc738f4ba30e78a8fb21efa1382c520d33 Author: Baptiste Daroussin AuthorDate: 2026-06-09 14:24:56 +0000 Commit: Baptiste Daroussin CommitDate: 2026-06-09 16:04:25 +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. --- 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