T07 · Tool Hijacking and Spoofing
- Location
scripts/reachy.sh:376- Finding
Unverified Predictable Remote Temporary Script Can Be Hijacked
- Content
View full analysis
/dev/null || { echo "Deploying snapshot script..." >&2 scp_to "${SCRIPT_DIR}/reachy-gst-snap.py" "${REMOTE_SCRIPT}" 2>/dev/null \ || die "Failed to deploy snapshot script via SCP" } # Run capture on the robot ssh_cmd " export GST_PLUGIN_PATH=/opt/gst-plugins-rs/lib/aarch64-linux-gnu/gstreamer-1.0 # Get producer ID from WebRTC signalling server PRODUCER=\$(/venvs/apps_venv/bin/python3 -c \" import asyncio, json, websockets async def p(): async with websockets.connect('ws://127.0.0.1:8443') as ws: await ws.recv() await ws.send(json.dumps({'type': 'setPeerStatus', 'roles': ['listener'], 'meta': {}})) await ws.recv() await ws.send(json.dumps({'type': 'list'})) listing = json.loads(await ws.recv()) if listing.get('producers'): print(listing['producers'][0]['id']) asyncio.run(p()) \" 2>/dev/null) if [ -z \"\$PRODUCER\" ]; then echo 'ERROR: No WebRTC producer found. Is the daemon running?' >&2 exit 1 fi rm -f ${REMOTE_SNAP} timeout 20 /venvs/apps_venv/bin/python3 ${REMOTE_SCRIPT} ${REMOTE_SNAP} \"\$PRODUCER\" 2>&1 \ | grep -v 'BUS ERROR\|Signalling error\|receiver is gone' " || die "Capture failed on robot" ``` ### Technical Analysis The snapshot workflow uses the fixed remote path `/tmp/reachy_gst_snap.py`. Before execution, it checks only whether a file exists at that path. It does not verify the file's cryptographic hash, owner, permissions, type, or contents. Although the comment states that the ...[truncated 1927 chars]- Remediation
View remediation
