T06 · System Persistence
- Location
scripts/install.py:56- Finding
Persistent Docker Service Enabled by Default
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install.py:56-63
Vulnerability Type: Persistent container service with an automatic restart policy
Risk Level: MediumVulnerable Code
python run("docker rm -f searxng-local > /dev/null 2>&1 || true") run( "docker run -d --name searxng-local " "-p 127.0.0.1:8080:8080 " f"-v {SETTINGS_FILE}:/etc/searxng/settings.yml " "--restart unless-stopped " "searxng/searxng" )Technical Analysis
The installer launches a detached Docker container with the
--restart unless-stoppedpolicy. Docker records this policy and automatically relaunches the container when the Docker daemon or host restarts unless an operator explicitly stops or removes it.The persistent behavior is disclosed in
SKILL.md, and removal instructions are provided. Nevertheless, executing the installer modifies long-lived system state beyond the immediate Skill invocation. The container continues running after the script exits and may return after a reboot.The service port is mapped only to
127.0.0.1, which limits direct remote exposure. However, the persistent container still consumes system resources, retains access to the mounted configuration, and continues executing the selected image until removed.Attack Path
- A user or agent executes
python scripts/install.py. - The script removes any existing container named
searxng-local. - Docker launches the new container in detached mode.
- Docker stores the
unless-stoppedrestart policy. - The container continues running after the installer terminates.
- Following a Docker daemon or host restart, Docker automatically launches the container again.
- The service remains persistent until an operator stops or removes it.
Impact Assessment
This behavior obtains no additional operating-system privileges by itself; the container runs with the privileges granted by the invokin ...[truncated 419 chars]
- A user or agent executes
- Remediation
View remediation
Remediation Suggestions
- Do not enable an automatic restart policy by default. Use
--restart noor omit the option. - Require explicit, informed user consent before enabling persistence, such as a clearly documented
--persistentoption. - Display the exact persistent system changes before applying them.
- Provide commands to stop the service, remove the container, and reset its restart policy:
bash docker update --restart=no searxng-local docker stop searxng-local docker rm searxng-local - Pin the container image to a reviewed immutable digest so each automatic restart executes the same audited artifact.
- Consider foreground or ephemeral operation with
--rmwhen persistence is not required.
- Do not enable an automatic restart policy by default. Use
