Skip to content

fix(strix/runtime/docker_client.py): Set HOME=/root when STRIX_HOST_UID is set to avoid Caido sidecar panic for system service accounts - #1548

Open
cf3901646 wants to merge 1 commit into
usestrix:mainfrom
cf3901646:fix/issue-1514-auto
Open

cf3901646 wants to merge 1 commit into
usestrix:mainfrom
cf3901646:fix/issue-1514-auto

Conversation

@cf3901646

Copy link
Copy Markdown

Summary of Changes

When strix runs as a system service account (uid < 1000), the Caido sidecar fails to start because the demoted uid lacks a writable HOME directory. The issue is caused by STRIX_HOST_UID/STRIX_HOST_GID being injected into the container environment without setting HOME. This leads to caido-cli panicking when trying to write to an inaccessible directory.

Motivation & Context

Closes #1514

Verification

To verify the fix:

  1. Run strix as a system service account (e.g., uid=997, nologin).
  2. Execute a scan with --scan-mode quick -n.
  3. Observe that the Caido sidecar starts successfully and the scan completes with the full toolchain available.
  4. Check that loginAsGuest succeeds on the first attempt without bootstrap failures.
  • Gate Report: Python syntax compiled: strix/runtime/docker_client.py; Notice: Python tests had failures in tests/

…ID is set to avoid Caido sidecar panic for system service accounts

Signed-off-by: cf3901646 <cf3901646@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects containers created through Strix's Docker sandbox path.

The PR should not merge until HOME points to a directory writable by the container user.

Findings

  1. P1 Linux scans fail at startup ▶
Fix with agent prompt
### Issue 1
strix/runtime/docker_client.py:203-204
`_host_identity_env()` supplies `STRIX_HOST_UID` for every Linux user, including `"1000"` and `"0"`. This condition therefore sets `HOME=/root` for ordinary users too. The image runs as `pentester`, and the entrypoint skips changing users for those values, leaving a non-root process using root's home.

Caido cannot write there. Even if it starts, the entrypoint's append to `~/.bashrc` fails under `set -e`, stopping the container. Use `/home/pentester`, which the entrypoint already prepares for the scan user, rather than `/root`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR sets HOME=/root whenever the container receives a nonempty STRIX_HOST_UID.

  • Docker sandbox containers with a host UID get HOME=/root.

Reviews (1) · Last reviewed commit: "fix(strix/runtime/docker_client.py): Set..." · Reviewed by Greptile

Comment on lines +203 to +204
if "STRIX_HOST_UID" in environment and environment["STRIX_HOST_UID"]:
environment["HOME"] = "/root"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Linux scans fail at startup

_host_identity_env() supplies STRIX_HOST_UID for every Linux user, including "1000" and "0". This condition therefore sets HOME=/root for ordinary users too. The image runs as pentester, and the entrypoint skips changing users for those values, leaving a non-root process using root's home.

Caido cannot write there. Even if it starts, the entrypoint's append to ~/.bashrc fails under set -e, stopping the container. Use /home/pentester, which the entrypoint already prepares for the scan user, rather than /root.

Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/runtime/docker_client.py
Line: 203-204

Comment:
**Linux scans fail at startup**

`_host_identity_env()` supplies `STRIX_HOST_UID` for every Linux user, including `"1000"` and `"0"`. This condition therefore sets `HOME=/root` for ordinary users too. The image runs as `pentester`, and the entrypoint skips changing users for those values, leaving a non-root process using root's home.

Caido cannot write there. Even if it starts, the entrypoint's append to `~/.bashrc` fails under `set -e`, stopping the container. Use `/home/pentester`, which the entrypoint already prepares for the scan user, rather than `/root`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant