T05 · Unauthorized Access and Privilege Escalation
- Location
- run-searxng.sh:48
- Finding
- Persistent Overprivileged Container Uses a Mutable Image## Vulnerability Details **File Location**: `run-searxng.sh:48` **Vulnerability Type**: Persistent container deployment, excessive network privileges, and mutable dependency reference **Risk Level**: High **Vulnerable Code**: ```sh docker run --restart always --network host --name searxng -d -e GRANIAN_HOST=127.0.0.1 -v "./config/:/etc/searxng:Z" searxng/searxng:latest ``` ### Technical Analysis The launcher deploys the container with three security-sensitive properties: - `--restart always` causes the service to restart across Docker daemon and host restarts, establishing cross-session persistence. - `--network host` removes Docker network isolation and gives the container direct access to the host network namespace. This is broader access than required for a local search service. - `searxng/searxng:latest` is a mutable image reference. The image that users receive may change after the skill has been reviewed, preventing reproducible deployment and increasing supply-chain exposure. The `GRANIAN_HOST=127.0.0.1` setting does not restore container network isolation. Under host networking, the container still shares the host network namespace and may access network services reachable by the host. ### Attack Path 1. A user executes `run-searxng.sh`. 2. Docker runs whichever image is currently resolved or cached for `searxng/searxng:latest`. 3. If that image or its upstream distribution channel has been compromised, attacker-controlled code starts inside the container. 4. The code receives direct host-network access and can probe services bound to loopback or other host interfaces. 5. The `always` restart policy restarts the container after failures, Docker restarts, or host reboots, preserving execution until the deployment is explicitly removed. ### Impact Assessment A compromised container image could obtain persistent execution in a container with broad network reach. It could enumerate or attack host-local netwo ...[truncated 309 chars]
- Remediation
- ## Remediation Suggestions - Pin the container to a reviewed immutable digest, for example: ```sh searxng/searxng@sha256:<reviewed-digest> ``` - Replace host networking with an isolated Docker network and publish only the required port on loopback: ```sh docker run --name searxng -d \ -p 127.0.0.1:8080:8080 \ -v "./config/:/etc/searxng:Z,ro" \ searxng/searxng@sha256:<reviewed-digest> ``` - Make persistence an explicit user option rather than enabling `--restart always` by default. Prefer `--restart no` or `--restart on-failure` for development deployments. - Run with a non-root user where supported and add hardening flags such as `--read-only`, `--cap-drop=ALL`, `--security-opt=no-new-privileges`, and resource limits. - Verify the image signature and document a controlled image-update process.
