SNMP4J-Agent v3.9.0 has been released 2026-06-22T22:00:00Z to improve security of sample code (i.e., SampleAgent) and default usage of the AgentConfigManager.
In addition, a security bug in Snmp4jConfigMib.snmp4jCfgStoragePath reported as CVE-2026-39006 which is exploitable with write access to that OID (1.3.6.1.4.1.4976.10.1.1.2.1.2.1.1.2) has been fixed too.
New features implementing additional security levels, like an audit log should further facilitate building secure agents.
CHANGES
- SECURITY CVE-2026-39006: Although the CVE-2026-39006 describes a configuration and setup issue when using the
SampleAgentwith default credentials and remote network access, thesnmp4jCfgStoragePathValidatornow does not allow to modify the configuration file (and thus create new configuration files) if theSnmp4jConfigMib.snmp4jCfgStoragePathis not set. Setting it to “.” (default) will only allow to store configuration files in the current working directory. - SECURITY:
CommandProcessor.setVacm(..)andCommandProcessor.setCoexistenceProvider(..)not reject setting null values and replacing an already set value. This measure is for security reasons to avoid accidentally setting anullvalue or replacing an already set value.
If any of these values (VACMorCoexistenceProvider) is set to null, any request to the agent using thisCommandProcessorwill be rejected. - SECURITY:
DefaultMOInputnow installs a strictjava.io.ObjectInputFilter(AgentStateDeserializationFilter) on theObjectInputStreamthat is used to restore persistent agent state. Only the classes that are actually written byDefaultMOOutput(the agent IO model and the SNMP4J SMI Variable types) plus the required JDK types are allowed to be deserialized; all other classes as well as overly deep or large object graphs are rejected. NewDefaultMOInput(ObjectInputStream, Collection<Class<?>>)andAgentStateDeserializationFilterconstructors allow registering additional classes for custom Variable/Context subclasses. - SECURITY: Hardened the
SampleAgentConfig.propertiesVACMconfiguration: SNMPv1 and SNMPv2c access via the “public” community is now read-only and limited to the “system” subtree (1.3.6.1.2.1.1), i.e. it cannot read other objects and cannot SET any object. The “viewer” role (USM authNoPriv user “SHA”) is limited to read-only access of selected SNMP*-MIB subtrees (1.3.6.1.6.3.18, .10, .13, .14, .12 and 1.3.6.1.2.1.74). - Added:
PropertyMOInputnow supports randomOctetStringvalues: “{r[:length]}name” generates a printable and “{R[:length]}name” a full 8-bit randomOctetString. Generated random values are named and reused for later references with the same name. Named values can be predefined before deserialization throughPropertyMOInput.setRandomValue(name, value)(with getRandomValue/getRandomValues accessors), e.g. to inject externally provided secrets into the configuration. - Added: The
SampleAgentaccepts the optional “-viewer <passkey>” and “-admin <passkey>” command line options and injects them as the named “viewer” and “admin” secrets into thePropertyMOInputconfiguration. If a pass key is not provided, a random one is generated and logged. - Added: New agent audit framework in the
org.snmp4j.agent.auditpackage. TheAgentAuditPolicyinterface (with theDefaultAgentAuditPolicyimplementation driven by anAgentPolicyProfile) audits managed object access (MOServerLookupListener), network transport access (SNMP4JTransportAuditListener) and file system access (newFileAuditListener/FileAuditEvent). The configurableAgentAuditLevel(OFF,LOG,WARN,RESTRICT) controls whether audited operations are only logged, logged as warnings on policy violations, or additionally denied where enforcement is possible (transport and file access; managed object access remains enforced byVACM).
The audit policy is wired into AgentConfigManager (new constructor and get/setAuditPolicy accessors), the persistence providers, and the newAgentEngineBootsCounterFile, and theSampleAgentdemonstrates auditing of its state configuration. - Added:
AgentConfigManager.getMessageDispatcher()accessor. - Fixed:
Snmp4jConfigMibnow rejects duplicatesnmp4jCfgStoragePathusage so that configuration files must be unique. - Fixed:
snmp4jCfgStorageOperationvalidation on row creation could fail due to a race condition based on a shared value reference when the value was provided directly together with an operation. - Improved:
MOServerLookupEvent.toString()output. - Updated: Implemented the new
WorkerTask.shutdown()and WorkerTask.join(long) methods (required by SNMP4J v3.12.0) for the CommandProcessor command tasks and the NotificationTask. - Updated:
snmp4jdependency to v3.12.1 andmaven-jar-pluginto v3.5.0.