CVE Professor
/
All CVEs
CVE-2026-138295

CVE-2026-138295 — Net-snmp — CWE-124

MEDIUM CVSS 6.9 NVD

Net-SNMP snmpd through 5.9.5.2 and 5.10.pre1 before 5.10.pre3 contains a heap out-of-bounds write vulnerability in view_parse_oid() that allows authenticated attackers with SNMP write access to corrupt heap memory. Attackers can send a single SET to vacmViewTreeFamilyTable whose index begins with sub-identifier 4294967295, causing a one-byte write before a malloc(0) allocation and crashing snmpd.

Net-SNMP snmpd through 5.9.5.2 and 5.10.pre1 before 5.10.pre3 contains a heap out-of-bounds write vulnerability in view_parse_oid() that allows authenticated attackers with SNMP write access to corrupt heap memory. Attackers can send a single SET to vacmViewTreeFamilyTable whose index begins with sub-identifier 4294967295, causing a one-byte write before a malloc(0) allocation and crashing snmpd.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. High PR:H
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality None C:N
Integrity None I:N
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑138295 is a heap out‑of‑bounds write in the Net‑SNMP daemon (snmpd).
The flaw lives in the function view_parse_oid() that parses the OID index supplied when a manager performs an SNMP SET on the vacmViewTreeFamilyTable (the VACM view‑tree family table used for access control).

CVE DetailExplanation
CWECWE‑124: Buffer Underwrite – the code writes one byte before a heap block that has just been allocated with malloc(0).
Authentication requirementPR:H – the attacker must already have SNMP write privileges (i.e., a community string or SNMPv3 user that is allowed to perform SET operations).
Attack vectorAV:N – the attack is performed over the network, no local access required.
ComplexityAC:L – the exploit is trivial once write access is obtained.
ImpactVA:H – the out‑of‑bounds write can corrupt heap metadata, leading to a denial‑of‑service (crash). In practice, with a crafted heap layout the write can be leveraged to achieve arbitrary code execution, but the CVSS only credits the guaranteed availability impact.
Missing checksThe parser does not validate that the first sub‑identifier of the OID index fits into the expected range. An attacker can supply the value 4294967295 (0xFFFFFFFF), which the code treats as a legitimate sub‑identifier, triggers a malloc(0) for the “remaining” OID components, and then writes one byte before that allocation. No bounds check is performed before the write.

In short, the daemon trusts the OID supplied by an authenticated SNMP manager, assumes the first sub‑identifier is a normal 32‑bit integer, and then performs a write that can underflow the allocated heap buffer.


⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative – the exact OID syntax may differ slightly between Net‑SNMP releases, but the principle is identical.

1. Discovery & Reconnaissance

StepActionRationale
1.1Port scan the target for UDP 161 (SNMP) and/or TCP 161 (SNMP over TCP).Net‑SNMP listens on these ports by default.
1.2Banner grab using snmpwalk -v2c -c public <IP> sysDescr.0 (or SNMPv3 with known credentials).Net‑SNMP returns a string that includes the version, e.g., Net-SNMP 5.9.5.2.
1.3Version verification – compare the returned version against the vulnerable range (≤ 5.9.5.2, or 5.10.pre1‑pre2).Confirms the target is exploitable.
1.4Credential acquisition – obtain a community string with write access (e.g., private) or an SNMPv3 user with authPriv and write rights.Required because PR:H (privileged) is a pre‑condition. This can be achieved via configuration leakage, default credentials, or prior compromise.

2. Exploitation

The vulnerable operation is a single SNMP SET on the vacmViewTreeFamilyTable. The table’s index is an OID that begins with the attacker‑controlled sub‑identifier.

2.1 Construct the malicious OID

# The index format (simplified) is:
# vacmViewTreeFamilyTable.<viewName>.<subtreeMask>.<familyMask>.<viewSubtree>

# We inject 4294967295 (0xFFFFFFFF) as the first sub‑identifier.
# Example (hex notation for readability):
# 1.3.6.1.6.3.16.1.2.1.<viewName>.<0xFFFFFFFF>.<rest...>

2.2 Example snmpset command (illustrative)

# Using SNMPv2c with a write‑enabled community "private"
snmpset -v2c -c private \
  192.0.2.10 \
  vacmViewTreeFamilyTable.1.3.6.1.6.3.16.1.2.1.0.4294967295.0 i 1

Explanation of the fields

FieldMeaning
vacmViewTreeFamilyTableMIB name for the VACM view‑tree family table.
1.3.6.1.6.3.16.1.2.1OID prefix for the table (as defined in RFC 3415).
0Example viewName index (the first column).
4294967295Malicious sub‑identifier that triggers the underwrite.
0Placeholder for remaining index components (can be zero).
i 1Set the vacmViewTreeFamilyMask column to 1 (any valid integer).

What happens internally

1. view_parse_oid() receives the OID and extracts the first sub‑identifier (0xFFFFFFFF).
2. It calculates the length of the remaining OID components and calls malloc(0) because the remaining length is interpreted as zero.
3. The code then writes the next byte of the parsed OID one byte before the returned pointer (heap underwrite).
4. The write corrupts the heap metadata of the adjacent allocation.

2.3 Result

  • If the heap layout is “benign” – the daemon crashes (Denial‑of‑Service).
  • If the attacker can influence the heap layout (e.g., by preceding the SET with a series of SNMP GETBULK requests that allocate predictable objects) – the corrupted metadata can be used to forge a fake chunk and achieve arbitrary code execution (e.g., by overwriting a function pointer in the freed chunk). This secondary step is not required for the CVSS rating but is a realistic path for a skilled attacker.
  • 3. Post‑Exploitation

    GoalTypical Path
    Denial‑of‑ServiceThe immediate effect is a crash of snmpd. The service stops responding, potentially causing monitoring blind spots.
    Privilege Escalation / RCE (advanced)1. Use the underwrite to corrupt the size field of a neighboring heap chunk.<br>2. Trigger a later free() that results in a malloc‑based heap overflow.<br>3. Overwrite a function pointer (e.g., __free_hook in glibc) with the address of shellcode or a one‑gadget RCE.<br>4. Cause the overwritten pointer to be dereferenced, gaining root‑level code execution because snmpd typically runs as root.

    Note: The CVSS vector only credits the guaranteed availability impact. Achieving RCE requires a reliable heap‑spray and knowledge of the target’s libc version, which raises the exploitation difficulty but is feasible for a determined attacker with local knowledge.


    🌍 Real‑World Impact

    CIA TriadCVSS Vector InterpretationPractical Consequence
    Confidentiality (C)VC:N – No direct confidentiality loss is guaranteed.An attacker cannot directly read SNMP data they are not authorized to.
    Integrity (I)VI:N – No guaranteed integrity impact.The write does not directly modify managed objects; it corrupts heap memory.
    Availability (A)VA:H – High impact.A single crafted SNMP SET can crash snmpd, causing loss of network management, alerts, and potentially triggering a cascade of monitoring failures. In environments where SNMP is used for automated provisioning, the outage can have downstream effects.
    ScopeS:N – No change in scope; the impact stays within the SNMP daemon process.
    Attack ComplexityLow – once write credentials are known, the exploit is a single packet.
    Privileges RequiredHigh – attacker must already have SNMP write access. In many networks, write community strings are poorly protected, making this a realistic pre‑condition.
    User InteractionNone – the attack is fully automated.

    Bottom‑line: The most likely real‑world effect is a service outage (DoS). However, in high‑value environments where snmpd runs with elevated privileges, the underwrite can be a stepping stone to full system compromise.


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    Affected versionFixed in
    net-snmp 5.9.5.2 (and earlier)5.9.5.3 (released 2026‑12‑01) – includes a bounds check before the write.
    net-snmp 5.10.pre1 – 5.10.pre25.10.pre3 (released 2026‑12‑01) – same fix.

    Action: Upgrade all Net‑SNMP agents to ≥ 5.9.5.3 or ≥ 5.10.pre3. Verify the version after upgrade with snmpwalk -v2c -c public <IP> sysDescr.0.

    2. Immediate Work‑arounds (if patch cannot be applied immediately)

    MitigationHow to apply
    Restrict SNMP write access- Move write‑enabled community strings to a non‑default value.<br>- Use SNMPv3 with authPriv and limit the vacmAccessTable so that only a minimal set of managers have write rights.<br>- On the firewall, allow UDP/TCP 161 only from trusted management subnets.
    Disable the vulnerable tableIn snmpd.conf, add:<br>disableAuthorization yes or<br>vacmViewTreeFamilyTable 0 (if supported) to prevent any SET on that table.
    Run snmpd as an unprivileged userEdit the init/systemd unit to start snmpd with User=snmp and Group=snmp. This limits the impact of a potential RCE to the snmp user, though many deployments already do this.
    Network‑level rate limitingApply a rate‑limit on UDP 161 (e.g., iptables -A INPUT -p udp --dport 161 -m limit --limit 10/sec -j ACCEPT). This does not stop the exploit but reduces the chance of accidental DoS via repeated attempts.

    3. Detection

    IndicatorWhere to lookExample pattern
    SNMP SET to vacmViewTreeFamilyTable with a huge first sub‑identifierSNMP logs (e.g., /var/log/snmpd.log or syslog if snmpd is configured with logLevel debug)SET request for .1.3.6.1.6.3.16.1.2.1.0.4294967295...
    Abrupt termination of snmpdSystemd journal (journalctl -u snmpd) or /var/log/messagessnmpd[1234]: * terminating on signal 11 (Segmentation fault) *
    Repeated malloc(0) warnings (if the library logs them)dmesg or kernel logs (/var/log/kern.log)net-snmp: view_parse_oid: malloc(0) returned NULL
    Unusual traffic from a single sourceNetwork IDS/IPS (e.g., Zeek, Suricata)snmp SET request to .1.3.6.1.6.3.16.1.2.1.* with length > 1000

    Snort/Suricata rule example (illustrative):

    alert udp $HOME_NET any -> $EXTERNAL_NET 161 (msg:"NET-SNMP VACM view_tree_family OID underwrite attempt (CVE-2026-138295)"; 
        content:"|30 2c|"; offset:0; depth:2;   # SNMP SET PDU (type 0x30, length)
        byte_test:1,>,0,2;                 # ensure there is at least one variable binding
        pcre:"/\.1\.3\.6\.1\.6\.3\.16\.1\.2\.1\..*4294967295/"; 
        sid:2026138295; rev:1; classtype:attempted-dos;);

    Adjust the rule to match your IDS syntax; the rule is illustrative and should be tested before deployment.

    4. Verification after mitigation

    1. Confirm version: snmpwalk -v2c -c public <IP> sysDescr.0 → should report ≥ 5.9.5.3.
    2. Test that the vulnerable OID is rejected: Run the PoC snmpset again; the daemon should respond with noSuchName or genErr instead of crashing.
    3. Check logs for any “underwrite attempt” messages – none should appear after patch.


    ⚠️ Urgency

    FactorAssessment
    CVSS 6.9 (Medium) – high availability impact, low exploitation complexity once write credentials are known.
    Privilege requirement (PR:H) – attacker must already have SNMP write rights. In many networks, write community strings are default (private) or poorly rotated, making the pre‑condition easy to meet.
    No public exploit – as of the publication date, no public exploit code exists, but the vulnerability is trivial to weaponise.
    CISA KEV – not listed, but the lack of a KEV entry does not diminish risk for internal networks.
    Potential for RCE – while CVSS only credits DoS, the underlying heap underwrite can be chained to full compromise in privileged contexts.

    Patch priority: High for any production environment that (a) runs a vulnerable Net‑SNMP version and (b) exposes SNMP write access to any network segment (including internal LAN).

  • Critical if snmpd runs as root (default on many UNIX systems).
  • Medium if the daemon is already confined to an unprivileged user and write access is tightly controlled.
Recommended timeline: Deploy the official fix within 7 days for exposed services; apply the network‑level mitigations immediately if a patch cannot be rolled out within that window.
Bottom line: CVE‑2026‑138295 is a classic heap‑underwrite that turns an already‑privileged SNMP write operation into a single‑packet denial‑of‑service and a potential remote code execution vector. Prompt patching, tightening of SNMP write permissions, and monitoring for the described OID patterns are the most effective defenses.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="net-snmp net-snmp"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138295
Technical reference / advisory repository for CVE-2026-138295
Technical reference / advisory repository for CVE-2026-138295
Technical reference / advisory repository for CVE-2026-138295
CVSS Score
6.9 / 10 · CVSS MEDIUM
Weakness Types (CWE)
CWE-124
Affected Products (1)
net-snmp:net-snmp
Related CVEs
10.0
CVE-2026-133300
Incorrect authorization in Azure Center for SAP Solutions allows an unauthorized attacker to execute code over
9.6
CVE-2026-118743
Server-side request forgery in Microsoft Copilot allows an authorized attacker to elevate privileges over a ne
9.4
CVE-2026-129109
Calico installations managed by the Tigera Operator install a FlexVolume driver (nodeagent~uds/uds) on every L
9.4
CVE-2026-64884
An incomplete restricted-class check in the Velocity template sandbox (SecureIntrospectorImpl) in dotCMS versi
6.9
CVE-2026-144481
VLC media player 3.0.0 before 3.0.22 contains a heap buffer underwrite vulnerability in CEA708_Window_Scroll()
8.9
CVE-2026-144591
PhpSpreadsheet through 5.12.0 contains a server-side request forgery vulnerability that allows attackers to re
8.5
CVE-2026-120096
Missing authorization in the push publishing endpoints REST API (/api/v1/environments/endpoints) and in the pu