T08 · Insecure Dependencies
Error
- Location
- scripts/install_searxng.sh:14
- Finding
- Unpinned Third-Party Code and Dependency Installation with Root Privileges<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install_searxng.sh:14-35` **Vulnerability Type**: Unpinned and unverified third-party dependencies **Risk Level**: High ### Vulnerable Code ```bash echo "[1/6] Installing system dependencies..." apt-get update -qq apt-get install -y -qq git python3-pip # Install uv via pip if not present if ! command -v uv &>/dev/null; then pip3 install -q uv --break-system-packages fi echo "[2/6] Creating searxng user and directories..." id -u $SEARXNG_USER &>/dev/null || /usr/sbin/useradd -r -d $SEARXNG_HOME -s /bin/false $SEARXNG_USER mkdir -p $SEARXNG_HOME chown $SEARXNG_USER:$SEARXNG_USER $SEARXNG_HOME echo "[3/6] Cloning SearXNG..." if [ -d "$SEARXNG_HOME/searxng-src" ]; then echo " Already cloned — skipping" else git clone https://github.com/searxng/searxng "$SEARXNG_HOME/searxng-src" --depth=1 fi echo "[4/6] Installing dependencies with uv..." cd "$SEARXNG_HOME/searxng-src" uv venv "$SEARXNG_HOME/searx-venv" --python python3 uv pip install --python "$SEARXNG_HOME/searx-venv/bin/python" \ -r "$SEARXNG_HOME/searxng-src/requirements.txt" ``` ### Technical Analysis The installer is documented to run as root, but it downloads and installs mutable third-party components without pinning or integrity verification: - `pip3 install uv` resolves the latest available version rather than a reviewed version. - `--break-system-packages` modifies the operating system’s managed Python environment, increasing the potential scope of dependency conflicts or compromise. - `git clone` retrieves the current default branch of SearXNG without selecting a reviewed commit, immutable release tag, or signed release. - Dependencies are installed from the newly downloaded `requirements.txt` without a locally reviewed lock file or enforced hashes. - No checksum, signature, commit allowlist, or provenance verification is performed. Consequently, the code executed or installed by this script can change after the Skill its ...[truncated 1945 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `uv` to a reviewed, explicit version and require package hashes during installation. 2. Avoid `--break-system-packages`; install bootstrap tooling in a dedicated virtual environment or use a verified OS package. 3. Pin SearXNG to an immutable, reviewed commit or a verified signed release rather than cloning the current default branch. 4. Verify the downloaded source using a trusted signature or an expected SHA-256 digest before installation. 5. Maintain a reviewed dependency lock file with exact versions and cryptographic hashes. Enforce hash verification during dependency installation. 6. Prefer building an immutable package or container in a controlled CI environment, generating an SBOM, scanning dependencies, and deploying the verified artifact. 7. Separate privileged setup from unprivileged dependency installation. Create system directories and the service account with root, but download and build application dependencies under the dedicated `searxng` account where practical. 8. Harden the systemd unit with controls such as `NoNewPrivileges=true`, `PrivateTmp=true`, `ProtectSystem=strict`, `ProtectHome=true`, and a narrowly scoped `ReadWritePaths=` declaration after verifying application requirements. 9. Document the exact installed release and provide an explicit, verified update procedure instead of implicitly accepting changing upstream content on each fresh installation. ]]>
