|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75782 SNMP Issue with backslash in OID
Submitted: 2018-01-09 01:02 UTC Modified: -
From: steve dot cleveland at oregonstate dot edu Assigned:
Status: Open Package: SNMP related
PHP Version: 7.2.1 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: steve dot cleveland at oregonstate dot edu
New email:
PHP Version: OS:


 [2018-01-09 01:02 UTC] steve dot cleveland at oregonstate dot edu
When performing a walk on dot1dTpFdbAddress (. with an HP Procurve switch (it's a bridge between the port and the mac address table), I believe the PHP SNMP module is interpreting the response incorrectly when a backslash is in the OID.

I'm not sure how the dot1dTpFdbAddress 'names' are created or what exactly they represent, but in this case, it appears if the 'name' includes a backslash, PHP is assigning the name as the value.  I'm guessing it's an incorrect regex.

This is the first time I've run into this issue, so I think it's rare.  I've tried various output options (quick_print, enum_print, output_format and valueretrieval), but the value doesn't change.

I've tried both PHP versions 7.0.27 and 7.2.1

Test script:
# Command line snmpwalk command
% snmpwalk -v 2c -c public switch1 .
BRIDGE-MIB::dot1dTpFdbAddress.'lbmP\=' = STRING: 6c:62:6d:50:5c:3d
BRIDGE-MIB::dot1dTpFdbAddress.'l.....' = STRING: 6c:f3:7f:c6:88:d6
BRIDGE-MIB::dot1dTpFdbAddress.'pM{&..' = STRING: 70:4d:7b:26:e3:4
BRIDGE-MIB::dot1dTpFdbAddress.'pZ....' = STRING: 70:5a:f:12:a2:11

# PHP either OOP or procedural
$snmp = new \SNMP(SNMP::VERSION_2c, 'switch1', 'public');
# or
snmp2_real_walk('switch1', 'public', '.');

[SNMPv2-SMI::mib-] => STRING: "lbmP\\="
[SNMPv2-SMI::mib-] => Hex-STRING: 6C F3 7F C6 88 D6 
[SNMPv2-SMI::mib-] => Hex-STRING: 70 4D 7B 26 E3 04 
[SNMPv2-SMI::mib-] => Hex-STRING: 70 5A 0F 12 A2 11 

Expected result:
The first output in the example should return a MAC address, not lbmP\\=


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 09:01:28 2024 UTC