T05 · Unauthorized Access and Privilege Escalation
- Location
run-searxng.sh:48- Finding
Persistent Overprivileged Container Uses a Mutable Image
- Content
View full analysis
Vulnerability Details
File Location:
run-searxng.sh:48
Vulnerability Type: Persistent container deployment, excessive network privileges, and mutable dependency reference
Risk Level: HighVulnerable 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:latestTechnical Analysis
The launcher deploys the container with three security-sensitive properties:
--restart alwayscauses the service to restart across Docker daemon and host restarts, establishing cross-session persistence.--network hostremoves 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:latestis 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.1setting 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
- A user executes
run-searxng.sh. - Docker runs whichever image is currently resolved or cached for
searxng/searxng:latest. - If that image or its upstream distribution channel has been compromised, attacker-controlled code starts inside the container.
- The code receives direct host-network access and can probe services bound to loopback or other host interfaces.
- The
alwaysrestart 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
View 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 alwaysby default. Prefer--restart noor--restart on-failurefor 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.
- Pin the container to a reviewed immutable digest, for example:
