Skip to content

openclaw config-gen.py: openclaw.json with secrets is not written with mode 600 #119

Open

Description

@royosherove

packs/openclaw/resources/config-gen.py lines 70-71 write openclaw.json with the default umask. The file holds the gateway token and possibly API keys, but the script does not set mode 600.

Also, the script fails if ~/.openclaw/ does not exist yet.

Fix: create the directory (os.makedirs(..., exist_ok=True)) and write the file with mode 600 (for example os.open(path, os.O_WRONLY|os.O_CREAT|os.O_TRUNC, 0o600)).

Found by a static read of the code at commit 1f66a8f. The code was not run.

Activity

  1. royosherove commented on Oct 11, 2026

    @royosherove
    MemberAuthor

    👻 Andromeda is on this · Kiro Crew Issue Radar
    awaiting-ci · PR #127 · updated 11:32 UTC

    progress
    • 11:31 claimed -- config-gen.py writes openclaw.json with the default umask and needs ~/.openclaw/ to exist; install.sh does chmod 600 only after the write. Fix is os.makedirs plus an os.open with mode 600. No open PR touches this file.
    • 11:32 opened PR fix(openclaw): write openclaw.json with mode 600 #127 -- new test fails on main (0 pass, 4 fail) and passes with the fix (4 of 4); openclaw pack test 60 passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcrew: in progressIssue Radar work claimed by a Kiro Crew worker

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions