subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
real_mac = "UNKNOWN_MAC" try: # 跨平台提取局域网 ARP 缓存表 arp_result = subprocess.check_output(["arp", "-a"], text=True) # 使用正则从 arp 表中精准提取网关设备的 MAC 地址 # 适配格式: xx:xx:xx:xx:xx:xx 或 xx-xx-xx-xx-xx-xx- Confidence
- 89% confidence
- Finding
- The subprocess call executes a host OS network utility to inspect ARP state, which is unnecessary for the declared spatial-logic/user-space purpose and creates an avoidable host-interaction surface. Even though it does not use shell=True and is not directly command-injectable, it enables environment fingerprinting and dependence on external binaries, which is risky in an agent skill.
