T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/searxng_cli.py:98
- Finding
- Unverified Remote Installer Is Downloaded and Executed by a Shell<![CDATA[ ## Vulnerability Details **File Location**: `scripts/searxng_cli.py:98-105`; additional installation instructions at `references/ONBOARDING.md:38-47` **Vulnerability Type**: Remote payload retrieval and execution **Risk Level**: Critical ### Vulnerable Code ```python # 1. 安装 uv if not subprocess.run("which uv", shell=True, capture_output=True).returncode == 0: log("安装 uv...") run('curl -LsSf https://astral.sh/uv/install.sh | sh') uv_path = Path.home() / ".local" / "bin" / "uv" if uv_path.exists(): os.environ["PATH"] = f"{uv_path.parent}:{os.environ['PATH']}" ``` The onboarding documentation recommends the same unsafe pattern through both `curl` and `wget`: ```bash # 尝试 1: curl curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH" # 尝试 2: wget wget -qO- https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH" ``` ### Technical Analysis The installation procedure downloads a mutable script from `https://astral.sh/uv/install.sh` and immediately supplies its response body to `sh`. The payload is not pinned to a version, saved for inspection, authenticated with a release signature, or checked against an expected cryptographic digest. HTTPS protects the connection under normal conditions, but it does not establish that the returned script is the same artifact reviewed during this audit. Compromise of the hosting account, domain, CDN, DNS infrastructure, or trusted TLS path could change the effective code executed by the Skill without any modification to this repository. Installing `uv` is relevant to the declared installation functionality, but executing an unverified network response is not the minimum privilege or minimum-trust mechanism necessary to install it. ### Attack Path 1. An attacker compromises or gains influence over the installer endpoint or its delivery infrastructure. 2. The attacker changes the response from `https://astral.sh/uv/install.sh` to include malicio ...[truncated 906 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all `curl | sh` and `wget | sh` installation paths from both code and documentation. 2. Install `uv` through a trusted platform package manager where practical. 3. Otherwise, select a specific `uv` release and download a versioned artifact rather than a mutable installer URL. 4. Verify the artifact using a pinned SHA-256 digest or the publisher's authenticated signature before execution. 5. Save the artifact to a user-owned temporary file with restrictive permissions and fail closed if verification fails. 6. Display the selected version and source to the user and obtain explicit approval before installing executable software. 7. Ensure installation never runs with elevated privileges unless a narrowly scoped operation explicitly requires them. ]]>
