[Ubuntu 24.04][Security] nemoclaw <name> sessions export writes session files with 0660 permissions instead of documented 0600
Description
nemoclaw <name> sessions export (dir format) writes exported session JSONL files with permissions 0660 (rw-rw----) instead of the documented 0600 (rw-------). The command prints a warning acknowledging the failure, but the resulting file remains group-readable. On a shared host where multiple users share a Unix group, this allows other group members to read session files that may contain pasted API keys, OAuth tokens, or other secrets.
Environment
Device: NVIDIA 2u2g-gen-0642 (RTX PRO 6000 Blackwell Server Edition)
OS: Ubuntu 24.04.4 LTS
Architecture: x86_64
Node.js: v22.22.3
npm: 10.9.8
Docker: 29.4.3, build 055a478
OpenShell CLI: 0.0.44
NemoClaw: v0.0.65
OpenClaw: v2026.5.27
Steps to Reproduce
-
Install NemoClaw v0.0.65:
curl -fsSL https://www.nvidia.com/nemoclaw.sh | NEMOCLAW_INSTALL_TAG=v0.0.65 bash -
Onboard a sandbox with at least one recorded session:
nemoclaw onboard -
Run the default (dir format) export:
mkdir -p /tmp/sessions-test && cd /tmp/sessions-test nemoclaw <name> sessions export -
Check the actual file permissions on the exported file:
ls -la sessions-<name>/ -
Verify whether a group member can read the file:
sudo -u nobody cat sessions-<name>/<filename>.jsonl
Expected Result
Step 3: Export completes exit 0 with no permission warning.
Step 4: File permissions are 0600 (rw-------) — owner-only, as documented in nemoclaw <name> sessions export --help:
"Note: session JSONL can contain pasted secrets (API keys, tokens). The downloaded bundle is written owner-only (0600)"
Step 5: nobody (and any other non-owner account) is refused with Permission denied.
Actual Result
Step 3 output includes warning:
Warning: could not restrict permissions on sessions-file-share-test/<filename>.jsonl; treat it as sensitive — it may contain session secrets.
Step 4: File permissions are 0660 (rw-rw----) — owner and group can read:
-rw-rw---- 1 local-lynnh local-lynnh 1753 Jun 16 07:00 <filename>.jsonl
Step 5: nobody (not in local-lynnh group) is refused. However, any user sharing the local-lynnh group on the host can read the session file and access any secrets it contains.
Security impact: on shared development hosts (lab machines, Brev instances, DGX Spark multi-tenant setups) where multiple users share a Unix group, exported session files are readable by all group members, contrary to the 0600 documentation and the intent of the permission-restriction warning.
Logs
$ cd /tmp/sessions-test && nemoclaw file-share-test sessions export; echo "exit: $?"
Downloading sandbox:/sandbox/.openclaw/agents/main/sessions/nemoclaw-onboard-warmup-836-1781588656.jsonl -> sessions-file-share-test/nemoclaw-onboard-warmup-836-1781588656.jsonl
✓ Download complete
Warning: could not restrict permissions on sessions-file-share-test/nemoclaw-onboard-warmup-836-1781588656.jsonl; treat it as sensitive — it may contain session secrets.
Exported all sessions for agent 'main' (1 session(s)) to ./sessions-file-share-test/
exit: 0
$ ls -la ~/.nemoclaw/source/sessions-file-share-test/
-rw-rw---- 1 local-lynnh local-lynnh 1753 Jun 16 07:00 nemoclaw-onboard-warmup-836-1781588656.jsonl
Additional finding (2026-06-16):
A second export run with 2 sessions revealed that the permission bug is more severe and inconsistent than originally documented:
- File 1 (
25a6ebd2-...):-rw-r--r--(0644 — world-readable). Any user on the host can read this file without group membership. - File 2 (
nemoclaw-onboard-warmup-...):-rw-rw----(0660) — group-readable (as originally documented).
Both files were produced by the same nemoclaw <name> sessions export invocation. The permission logic applies inconsistently across files in the same export run.
The worst observed outcome (0644) is more severe than originally reported: session files containing conversation history and potentially pasted secrets are world-readable to any user on the host — no group membership required.