From nobody Tue Nov 17 17:05:22 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 4jTWM70mRMz71Rbp for ; Tue, 17 Nov 2026 17:05:23 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTWM65NjCz4HQP for ; Tue, 17 Nov 2026 17:05:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FuAgtWlRqJQnxWJS4m6I2KVUh6Ow+oW47vJVh5BETLU=; b=GA5V/Xv80pOltWH9z2HNb9oCrLJzOQ9NwgHU7wXpzp7VkiIDiwpeGzCHvEAhs7SBA64j+A /g/uamxqYj+JNS6O254erjyWcUtSodyC1Anjd1tpnxlYWPAcZmPDDGJUH0wQiE+puMC0F3 IofzxRc9EJ3skz8+/rH4SGyGWRUMKv745ERQ2l7YzvtX75kzIt/H56jAeoIC5tCoiRG3+l YRyUMx3lOnyEuRXRh2kJUPKSBxPmOnD8yfDBmuw08DEAaYsuVA4cJ7/1c+3X7cX3DB7Rqo gH4Aw/NdaVfS5nf7ZFGaDMCACcl9urenaT/BlLW/lCHMlJ3p11lFVhgz6nqJfA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794935122; b=McEeWQCol58OtOm4Mbpl0FCA0BbufG5KS7efZsM3F1UYEBTG/8TS6RsInZhQwQGYK+uqCw 8LrfwegP+nCzjd9Wo77SAYFHE96sAsMoRl6gER3x3lG424yqQVoidrr/gtQ0Dgu1/49KnX CWlLOIJ79ofmQnizbah7oUGCBnjj7y335KzP0s1LI7pAbPq/ihdVJfDG6Tv8t5C9MM/lj7 mMT+s12LFn7fHuc0p2u15hEEcjkVYacvHA02Aqb0xsvVCvZ/PvqsQY2wBoQCiz6dRkRNYd 6wwNZFs4Hx5e+QJhUtrcapphbnnkx7k7gni9OQZ6loaHv6sa/guyjqGIRQ86JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794935122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FuAgtWlRqJQnxWJS4m6I2KVUh6Ow+oW47vJVh5BETLU=; b=qa9bQT9dSbXzJOoROneuX9pCxw5iwWWqlk50mK9qxz+ayb9jJhzUXNnMtktDLdVrc4H89/ 8x8AiVRmYlzPlZjUL8/zkhuRxmqBLFj4hN6xFPe6YW/3ze7PA+mPgswdA4hoAfku+dOVza 67Jn/EAgRzYyycm//8aiXmfO9lS/LQ+Mcj864oI+zx/Dp2Af2T8EaQurKsp1ILvmOKumYp kFiz1CnmWhwUtXDC/Utj3pGsJTIenLhSLaT1HFcb5Uzv1pTjkf6EyryZFETzn+hmTyed7Y Xam+8nL/cLhUlQpANUj2zOtRvk2s/+HoQCf3ylqbGtqhyQ1rxZdFQJ5/hQiM1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTWM647xxzr76 for ; Tue, 17 Nov 2026 17:05:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f7c3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 17:05:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Maxim Konovalov From: Mark Johnston Subject: git: fffdd6dcb09a - releng/14.5 - bsnmp: let an SNMPv3 discovery message elicit only a Report List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.5 X-Git-Reftype: branch X-Git-Commit: fffdd6dcb09a91a8b83107f490e4e13d760e874f Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 17:05:22 +0000 Message-Id: <6afc8952.1f7c3.5da48a99@gitrepo.freebsd.org> The branch releng/14.5 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fffdd6dcb09a91a8b83107f490e4e13d760e874f commit fffdd6dcb09a91a8b83107f490e4e13d760e874f Author: Maxim Konovalov AuthorDate: 2026-11-12 00:43:06 +0000 Commit: Mark Johnston CommitDate: 2026-11-16 21:17:13 +0000 bsnmp: let an SNMPv3 discovery message elicit only a Report An SNMPv3 message with no variable bindings is treated as RFC 3414 engineID (or time-window) discovery: snmp_input_start() appends a single usmStats counter to the request, and snmp_pdu_auth_access() skips the VACM check because the AUTODISCOVER flag is set. The request's verb was then still dispatched by type. A genuine discovery is a GET and simply reads that counter back -- the intended Report -- but a zero-binding GETNEXT or GETBULK instead walks forward from the appended OID, and with VACM skipped it returns the next registered object(s): an unauthenticated read of the agent's USM and VACM configuration (objects at or after 1.3.6.1.6.3.15). Force the verb of a discovery message to GET, so the appended counter is read as-is and no walk (or SET) can run under the skipped-VACM state. Genuine discovery, which already uses GET, is unaffected. This complements the earlier change that rejects an AUTODISCOVER message carrying its own bindings; that guard is never reached on this path, because the offending binding is appended by the agent after the zero-binding test. Approved by: so Security: FreeBSD-SA-26:89.bsnmp Reviewed by: harti Fixes: 135f7de5ddb6 --- contrib/bsnmp/snmpd/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/bsnmp/snmpd/main.c b/contrib/bsnmp/snmpd/main.c index d1377756b64e..18e27695cf52 100644 --- a/contrib/bsnmp/snmpd/main.c +++ b/contrib/bsnmp/snmpd/main.c @@ -644,6 +644,15 @@ decoded: pdu->engine.engine_boots = snmpd_engine.engine_boots; pdu->engine.engine_time = snmpd_engine.engine_time; } + /* + * A discovery message may only elicit a Report. Force GET + * so the appended usmStats counter is read back as-is: a + * GETNEXT or GETBULK would otherwise walk forward from it, + * and a SET act on it, all with VACM skipped for the + * AUTODISCOVER flag. + */ + if ((pdu->flags & SNMP_MSG_AUTODISCOVER) != 0) + pdu->type = SNMP_PDU_GET; } else if (pdu->user.auth_proto != SNMP_AUTH_NOAUTH && (pdu->engine.engine_boots == 0 || pdu->engine.engine_time == 0)) { snmpd_usmstats.not_in_time_windows++;