T09 · Insecure Skill Coding Practices
- Location
scripts/vector_control.py:56- Finding
Unrestricted Network Destination Enables Constrained SSRF and Audio Disclosure
- Content
View full analysis
# --boundary-- body = [] body.append(f"--{boundary}".encode()) body.append(b'Content-Disposition: form-data; name="sound"; filename="processed.wav"') body.append(b"Content-Type: audio/wav") body.append(b"") body.append(file_data) body.append(f"--{boundary}--".encode()) body.append(b"") payload = b"\r\n".join(body) req = urllib.request.Request(url, data=payload, headers=headers, method="POST") with urllib.request.urlopen(req) as r: return r.read() ``` ```python p.add_argument("--base", default="http://localhost:8080", help="Wirepod base URL") ``` ```python base = args.base.rstrip("/") serial = args.serial ``` ```python upload_audio(base, serial, temp_wav) ``` ### Technical Analysis The `--base` argument is accepted without validating its scheme, hostname, resolved IP address, or port. It is then directly incorporated into URLs passed to `urllib.request ...[truncated 2009 chars]- Remediation
View remediation
