Skip to content

[Ubuntu 24.04][Security] shields status does not cross-check sandbox filesystem — drift after host-root tamper goes undetected #4243

Description

@cr7258

Description

Description

nemoclaw  shields status reads only the host-side declarative state file
(~/.nemoclaw/state/shields-.json) and does not cross-check the actual
sandbox filesystem. After a host-root actor (docker exec / kubectl exec as root)
reverts /sandbox/.openclaw perms from 444 root:root back to 660 sandbox:sandbox,
shields status continues to report "UP (lockdown active)" with no drift signal,
and the sandbox uid can then write openclaw.json undetected. Guards against the
declared-vs-actual state divergence described in DevTest T5997825.
Environment
Device:        Ubuntu 24.04 x86_64 dev host
OS:            Ubuntu 24.04.4 LTS
Architecture:  x86_64
Node.js:       v22.22.2
npm:           10.9.7
Docker:        29.4.1
OpenShell CLI: openshell 0.0.44
NemoClaw:      v0.0.50-50-g206737f83
OpenClaw:      2026.5.18
Steps to Reproduce
1. Onboard a sandbox.

2. nemoclaw my-assistant shields up
3. nemoclaw my-assistant shields status
     → "Shields: UP (lockdown active)"  /  "Policy: restrictive"

4. Confirm baseline perms inside sandbox:
     CTR=$(docker ps --filter name=openshell-my-assistant -q)
     docker exec "$CTR" stat -c "%a %U:%G %n" \
       /sandbox/.openclaw /sandbox/.openclaw/openclaw.json /sandbox/.openclaw/.config-hash
     → 755 root:root /sandbox/.openclaw
       444 root:root /sandbox/.openclaw/openclaw.json
       444 root:root /sandbox/.openclaw/.config-hash

5. Host-root tamper via docker exec:
     docker exec "$CTR" bash -c '
       chmod 2770 /sandbox/.openclaw
       chown sandbox:sandbox /sandbox/.openclaw
       chmod 660 /sandbox/.openclaw/openclaw.json /sandbox/.openclaw/.config-hash
       chown sandbox:sandbox /sandbox/.openclaw/openclaw.json /sandbox/.openclaw/.config-hash
     '

6. nemoclaw my-assistant shields status
     → still "Shields: UP (lockdown active)"  (DRIFT NOT DETECTED)

7. Confirm config is now mutable from sandbox uid:
     docker exec --user sandbox "$CTR" bash -c \
       'echo TAMPERED > /sandbox/.openclaw/openclaw.json; echo exit=$?'
     → exit=0  (write succeeded)

8. nemoclaw my-assistant shields status
     → still "Shields: UP (lockdown active)"  (post-tamper-write drift still undetected)
Expected Result
At steps 6 and 8, shields status MUST surface drift between declared state
(host JSON: shieldsDown=false) and actual sandbox filesystem state (660
sandbox:sandbox, mutable). Any of the following is acceptable:
- "Shields: UP (DRIFTED)" / "INCONSISTENT"
- "Shields: UP (verification failed: openclaw.json mode 660, expected 444)"
- Non-zero exit code with a clear error
The status MUST NOT continue reporting a clean "UP (lockdown active)".
Actual Result
Step 6 (after host-root tamper, before write):
  Shields: UP (lockdown active)
  Policy:  restrictive
  exit=0

Step 7 (sandbox uid write succeeds):
  exit=0
  cat /sandbox/.openclaw/openclaw.json → TAMPERED

Step 8 (after actual tampering write):
  Shields: UP (lockdown active)
  Policy:  restrictive
  exit=0

The status command never reads the sandbox filesystem — it only reflects the
host-side ~/.nemoclaw/state/shields-.json declarative state.
 

Bug Details

Field Value
Priority Unprioritized
Action Dev - Open - To fix
Disposition Open issue
Module Machine Learning - NemoClaw
Keyword NemoClaw, NEMOCLAW_GH_SYNC_APPROVAL, NemoClaw_Security

[NVB#6222239]

Activity

  1. added
    NV QA
    on May 26, 2026
  2. laitingsheng commented on May 26, 2026

    @laitingsheng
    Contributor

    Duplicate of #4242

  3. added
    platform: ubuntu
    and removed on May 26, 2026
  4. reopened this on May 27, 2026
  5. cr7258 commented on May 27, 2026

    @cr7258
    ContributorAuthor

    Close #4242 as we map this GitHub issue to the nvbug to track it internally.

  6. self-assigned this
    on May 27, 2026
  7. added a commit that references this issue on May 27, 2026
    5eeae46
  8. wangericnv commented on May 28, 2026

    @wangericnv
    Collaborator

    Reopening — verify FAILED. PR #4294 did not add the cross-check that the original report describes. Re-verified on NemoClaw v0.0.52 / OpenClaw 2026.5.22 (DGX Spark, Ubuntu 24.04 aarch64, 2026-05-28).

    Direct tamper-and-check test:

    $ nemoclaw my-assistant shields status
      Shields: UP (lockdown active)
      Policy:  restrictive
    
    $ docker exec openshell-my-assistant-<uuid> bash -c \
        'ls -la /sandbox/.openclaw/openclaw.json; md5sum /sandbox/.openclaw/openclaw.json'
    -r--r--r-- 1 root root 4904 May 27 07:29 /sandbox/.openclaw/openclaw.json
    cfd1e396a66d6d01dae5a25b9747e6d3  /sandbox/.openclaw/openclaw.json
    
    # Tamper as host-root inside the sandbox container (the exact threat-model scenario):
    $ docker exec -u 0 openshell-my-assistant-<uuid> bash -c \
        'chmod 644 /sandbox/.openclaw/openclaw.json && \
         echo " " >> /sandbox/.openclaw/openclaw.json && \
         chmod 444 /sandbox/.openclaw/openclaw.json && \
         md5sum /sandbox/.openclaw/openclaw.json'
    32851b5b6eeac66f70f9b4d48e6030a7  /sandbox/.openclaw/openclaw.json
                                          ← md5 changed; file was tampered
    
    # Re-run shields status — should detect drift if the cross-check landed:
    $ nemoclaw my-assistant shields status
      Shields: UP (lockdown active)
      Policy:  restrictive                  ← byte-for-byte identical, zero drift signal
    

    shields status still reports the cached policy state without cross-checking the actual sandbox filesystem. No new drift / tamper / integrity / mismatch / modified wording appears for either the happy path or the tampered state.

    cc @laitingsheng — could you check whether PR #4294 actually added the file-hash cross-check, or if the change ended up only on a related path? Suggested fix direction:

    1. On shields up, snapshot a SHA-256 of every shields-protected file (at minimum /sandbox/.openclaw/openclaw.json) into a hidden /sandbox/.openclaw/.shields-seal.json outside the sandbox writable surface.
    2. On shields status, recompute hashes, compare against the seal, and surface a WARN: drift detected — openclaw.json was modified outside the shields seal line (and exit non-zero) if any mismatch.

    NVBug #6222239 has been reverted to BugAction=Dev - Open - To fix, Disposition=Open issue with the same evidence.

    (Test footprint: my tamper left /sandbox/.openclaw/openclaw.json with a trailing space byte. JSON tolerates trailing whitespace so functional impact is nil; a nemoclaw my-assistant rebuild restores the original.)

  9. laitingsheng commented on May 28, 2026

    @laitingsheng
    Contributor

    The target release of the PR is v0.0.53, I think you need to retest it with the new release.

  10. wangericnv commented on May 28, 2026

    @wangericnv
    Collaborator

    @laitingsheng thanks — I already re-ran on v0.0.53 today after upgrading the Spark, and the drift-undetected behavior still reproduces unchanged:

    $ nemoclaw --version
    nemoclaw v0.0.53
    
    $ docker exec openshell-my-assistant-<uuid> md5sum /sandbox/.openclaw/openclaw.json
    32851b5b6eeac66f70f9b4d48e6030a7  /sandbox/.openclaw/openclaw.json
    
    # Tamper as host root inside the sandbox container (same one-byte append as before):
    $ docker exec -u 0 openshell-my-assistant-<uuid> bash -c \
        'chmod 644 /sandbox/.openclaw/openclaw.json && \
         echo " " >> /sandbox/.openclaw/openclaw.json && \
         chmod 444 /sandbox/.openclaw/openclaw.json'
    
    $ docker exec openshell-my-assistant-<uuid> md5sum /sandbox/.openclaw/openclaw.json
    6dcc9025e7b97f66c1c78225d92d09d1  /sandbox/.openclaw/openclaw.json
                                          ← md5 changed; file was tampered
    
    $ nemoclaw my-assistant shields status
      Shields: UP (lockdown active)
      Policy:  restrictive                  ← byte-for-byte identical, zero drift signal
    

    So PR #4294 didn't actually add the file-hash cross-check on v0.0.53 either, or it landed on a different code path. The bug's exact symptom — "shields status does not cross-check sandbox filesystem; drift after host-root tamper goes undetected" — is still present on the v0.0.53 build.

    Could you confirm whether the PR's intent was to add the seal-and-recompute on shields status, or only to harden some other aspect? Happy to add detection in another way if I'm probing the wrong angle — but per the original bug's repro recipe, the post-tamper shields status should surface a drift / mismatch / integrity-violation indicator and currently doesn't.

    Leaving NVBug #6222239 at Dev - Open - To fix for now. Let me know if you'd like additional diagnostic output (e.g. nemoclaw <name> doctor, full shields-status --verbose if one exists, or strace of the shields-status call to see whether any hash file is read).

  11. added a commit that references this issue on May 30, 2026
    5fc700b
  12. added
    area: sandbox
    and removed on Jun 3, 2026
  13. added theissue type on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NV QAarea: sandboxplatform: ubuntu

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions