How to use Copilot to quote USB device config
Copilot proposed IPv4 and USB-ID validation plus quoted generated commands for a Home Assistant add-on; the open patch retained privilege and address limits.
Original prompt
Shared by the source author. See source notes for context.
Scan this repo for backdoors and malware and general security risks
Reach people exploring AI agents
See placements →What happened
An open patch validates IPv4 and USB identifiers and quotes generated commands; required privileges, disabled AppArmor and unsupported address forms remain documented.
Reported by MateuszMieczkowski with Copilot — GitHubHow the agent did it
- Copilot traced configured addresses and bus identifiers into dynamically generated privileged shell commands.
- It added format validation and rejection behavior, then used Bash printf quoting for attach and detach arguments.
- It documented privilege and compatibility limits and presented the open proposal for owner review.
Where a person stepped in
The owner initiated the scan, but acceptance and merge were not visible. The generated audit’s severity scores and absence-of-malware statement are not treated as independent proof.
The owner of a Home Assistant USB/IP add-on asked Copilot to scan for backdoors, malware and general security risks. The concrete proposal concerned generated shell commands, not a discovered malicious package. Server addresses and USB bus identifiers were interpolated into scripts that later ran with powerful device-management privileges.
Copilot added IPv4 format and octet checks, a USB bus-ID format check, and rejection paths for invalid values. It changed generated attach and detach commands to use Bash printf quoting so accepted values were still escaped. Invalid individual devices were skipped; invalid discovery configuration stopped initialization.
The draft also documents the remaining privilege boundary. USB management still requires capabilities and kernel-module access, while AppArmor remained disabled. IPv6 and hostname-based addresses were not supported by the new IPv4 validator.
The agent produced code and audit documents, but the pull request remained open and unmerged when checked. Its stated risk scores were generated assessments, not independent certification. The owner’s review was the next checkpoint. The useful artifact is a proposed validation-and-quoting repair with explicit operational limits, without a proven absence of all other vulnerabilities.
Prompt
Original prompt
Source: GitHub · MateuszMieczkowski with Copilot
Frequently asked questions
Why quote values after validation?
The proposal uses quoting as an additional boundary when constructing shell commands.
Were the add-on’s privileges removed?
No. Device-management privileges and disabled AppArmor remained documented.
Does the validator support IPv6?
No. Its address checks are IPv4-only.
More details
About this account
Copilot traced configured addresses and bus identifiers into dynamically generated privileged shell commands. It added format validation and rejection behavior, then used Bash printf quoting for attach and detach arguments.
Original PR, API dates and shell diff opened. This is an unmerged proposed patch. Agent-generated severity and clean-audit claims are qualified; no exploit strings are included. Original prompt excerpt.
Credit: MateuszMieczkowski with Copilot — GitHub
Source published 14 Mar 2026
Source checked 14 Oct 2026
Tools and topics
GitHub Copilot · Bash · Home Assistant · USB/IP
command injection · device configuration · privileged scripts
Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.