subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def play_url(url: str): # 直接交给本地播放器。mpv 对网络资源支持最好。 subprocess.Popen([PLAYER_CMD, url]) @mcp.tool()- Confidence
- 93% confidence
- Finding
- subprocess.Popen([PLAYER_CMD, url])
Security audit
Security checks across malware telemetry and agentic risk
This is a coherent XiaoZhi music bridge, but its playback controls can affect unrelated local processes and its remote bridge gives a configured endpoint direct control over local music tools.
Install only if you trust the XiaoZhi MCP endpoint and the music API provider. Set PLAYER_CMD to a specific trusted player such as mpv, run the skill with low privileges, and be aware that stop, pause, and resume may affect other matching local processes until the implementation tracks and controls only its own spawned player.
def play_url(url: str):
# 直接交给本地播放器。mpv 对网络资源支持最好。
subprocess.Popen([PLAYER_CMD, url])
@mcp.tool()@mcp.tool()
def stop_music() -> str:
try:
subprocess.run(['pkill', '-f', PLAYER_CMD], check=False)
return '已经停止播放。'
except Exception as e:
return f'停止失败:{str(e)}'@mcp.tool()
def pause_music() -> str:
try:
subprocess.run(['pkill', '-STOP', '-f', PLAYER_CMD], check=False)
return '音乐已暂停。'
except Exception as e:
return f'暂停失败:{str(e)}'@mcp.tool()
def resume_music() -> str:
try:
subprocess.run(['pkill', '-CONT', '-f', PLAYER_CMD], check=False)
return '继续播放。'
except Exception as e:
return f'继续播放失败:{str(e)}'def play_url(url: str):
# 直接交给本地播放器。mpv 对网络资源支持最好。
subprocess.Popen([PLAYER_CMD, url])
@mcp.tool()@mcp.tool()
def stop_music() -> str:
try:
subprocess.run(['pkill', '-f', PLAYER_CMD], check=False)
return '已经停止播放。'
except Exception as e:
return f'停止失败:{str(e)}'@mcp.tool()
def pause_music() -> str:
try:
subprocess.run(['pkill', '-STOP', '-f', PLAYER_CMD], check=False)
return '音乐已暂停。'
except Exception as e:
return f'暂停失败:{str(e)}'@mcp.tool()
def resume_music() -> str:
try:
subprocess.run(['pkill', '-CONT', '-f', PLAYER_CMD], check=False)
return '继续播放。'
except Exception as e:
return f'继续播放失败:{str(e)}'65/65 vendors flagged this skill as clean.
No suspicious patterns detected.