vlans: set_vlan and set_interface send values with line breaks into the CLI unchecked #17

Closed
opened 2026-11-12 21:25:38 +00:00 by christianmanivong · 0 comments
Owner

Prio: P3

Found in netOrk's security sweep of 2026-11-12; the netOrk side is NetOrk/netork#2455.

set_vlan() builds name "<name>" from config["name"], set_interface() builds description <text> from config["description"]; each block is joined with \n and sent line by line in config mode, then saved. A line break in either value ends that line, and the switch runs the rest as commands of its own; a double quote ends the quoted VLAN name. netOrk stores VLAN names that devices report and replays them here when a VLAN is added to a switch, so a name reported by a compromised device runs on the switch.

Fix: set_vlan() refuses a name containing \r, \n or ", set_interface() a description containing \r or \n (ValueError, as the SNMP write refuses such values), before anything is sent.

Prio: P3 Found in netOrk's security sweep of 2026-11-12; the netOrk side is NetOrk/netork#2455. `set_vlan()` builds `name "<name>"` from `config["name"]`, `set_interface()` builds `description <text>` from `config["description"]`; each block is joined with `\n` and sent line by line in config mode, then saved. A line break in either value ends that line, and the switch runs the rest as commands of its own; a double quote ends the quoted VLAN name. netOrk stores VLAN names that devices report and replays them here when a VLAN is added to a switch, so a name reported by a compromised device runs on the switch. **Fix:** `set_vlan()` refuses a name containing `\r`, `\n` or `"`, `set_interface()` a description containing `\r` or `\n` (`ValueError`, as the SNMP write refuses such values), before anything is sent.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-tplink-jetstream#17