shell.json can be created 0644 and keeps that mode, exposing plugin secrets to other local users
Reporting this as a courtesy rather than as a complaint: shell.json holds
plugin settings, those settings can contain secrets, and the file can arrive
world-readable and stay that way.
Measured on Omarchy 4.0.4-1, Quickshell shell at /usr/share/omarchy/shell.
1. The packaged default is 0644.
$ stat -c '%a %n' /usr/share/omarchy/config/omarchy/shell.json
644 /usr/share/omarchy/config/omarchy/shell.json
2. omarchy-refresh-config copies it with cp -f, so a file that does not
yet exist is created under the caller's umask. Reproduced against the real
source into a scratch directory:
cp under umask 022 -> 644
cp under umask 077 -> 600
A copy onto an existing file keeps that file's mode, which is why a machine that once had 0600 keeps it.
3. The shell's own writer preserves whatever mode the file already has.
shell.qml:138 uses FileView { atomicWrites: true }. A purpose-built probe,
one FileView writing one scratch file, run twice:
| mode before the write | after |
|---|---|
| 0644 | 0644 |
| 0600 | 0600 |
The content changed both times, so the write happened. The atomic rename neither resets the mode to the writer's umask nor tightens it.
Why it matters. ~/.config and ~/.config/omarchy are 0755 by default, so
only the home directory's mode stands between the file and other local users,
and 0755 homes are common. Plugin settings in that file routinely include URLs,
and for IPTV-style plugins a playlist URL carries the provider username and
password, either as userinfo or as query parameters. On a machine where
shell.json landed at 0644, those are readable by any other local account.
What would fix it upstream, either one:
- ship
config/omarchy/shell.jsonas 0600, and haveomarchy-refresh-configcreate the user copy with that mode rather than inheriting the umask; or - have the shell's writer enforce 0600 on the user config when it saves, since it already owns that file's lifecycle.
The first is a one-line packaging change and covers fresh installs; the second also repairs machines that already have 0644.
Heads-up, so it is not a surprise. The IPTV plugin
(io.github.rmcdavid.iptv) will tighten ~/.config/omarchy/shell.json to 0600
before it writes a provider URL into it, and refuse to save the source if it
cannot. It changes nothing else: not the directories, not the contents, not any
other file. If upstream adopts either fix above, that behaviour becomes a
no-op, which is the outcome we would prefer.
Happy to send a patch for whichever approach you favour.
Thanks for the careful write-up and for flagging it as a courtesy. There's already a PR for the second approach you describe: #14770 enforces 0600 on shell.json when it's written. If you have a minute, it would help to check it against your probe results, in particular whether it also tightens a file that already exists at 0644. Shipping config/omarchy/shell.json as 0600 and creating the user copy with install -m600 in omarchy-refresh-config would still be worth doing as well, for fresh installs.
Checked against quattro at be54892f3 by reading the source; nothing was run. The report holds up: the user copy of shell.json can be created world-readable, and on several paths it stays that way. The paths that create it at 0644 under the default umask 022:
- Fresh install.
config/omarchy/shell.jsonreaches a new account through/etc/skel/.config/omarchy/shell.json, which is 0644 on an installed 4.x machine, anduseradd -mcopies that mode. omarchy-reinstall-configsrunscp -af /etc/skel/. ~/(bin/omarchy-reinstall-configs:19). That preserves skel's 0644, even over a file that was 0600.omarchy-upgrade-to-quattroremoves the file and copies the default back withcp -P(copy_config_default, line 1787, andcopy_missing_config_defaults, line 1803). Its backup is made withcp -af(line 1719), so the backup keeps whatever mode the original had.omarchy-refresh-config omarchy/shell.jsoncreates a missing file withcp -funder the caller's umask. A copy onto an existing file keeps that file's mode, and the.bak.<timestamp>copy it makes beside it gets the umask.
Two corrections to "keeps that mode". omarchy-shell-config's commit() (mktemp then mv, line 59) leaves the file at 0600, and so do most of the migrations that rewrite it. Since omarchy-refresh-shell and the end of the quattro upgrade both run omarchy-bar defaults, they finish at 0600 when that step succeeds. The shell's own writer (FileView with atomicWrites, shell/shell.qml:140) is where plugin settings and omarchy-plugin-enable land. Quickshell isn't in this repository, so I could only check your measurement that it keeps the existing mode against the repository's own notes: docs/notifications.md describes FileView the same way. A file that arrives at 0644 therefore stays 0644 until something like omarchy-bar rewrites it.
#14770 is the open fix and already closes this issue. It is being reviewed as its own pull request. #12250, which answers #9326, goes the other way: commit() keeps the file's existing mode instead of tightening it. The two touch the same code, and which policy shell.json follows is for the maintainer to decide. Leftover .bak copies are worth considering in either case, because they hold the same settings.
Second opinion: Codex Medium and muse-spark-1.3 (via pi, thinking high) reviewed the diagnosis. They agreed with the mechanism and found the skel, reinstall, upgrade and backup paths above, each of which I checked against the source. Their independence is not guaranteed. This waits on the maintainer.
Re-ran each path's copy lines on 4.0.4-1 under umask 022 and 077. Two corrections:
(1) omarchy-shell-config commit() ends at 0600 (tmpfs-to-btrfs included), so our title's "keeps that mode" is true only of the shell's FileView writer (omarchy bar set, plugin settings), not of omarchy bar defaults or omarchy-refresh-shell.
(2) The .bak.<ts> copy gets the source's mode masked by the umask, not the umask alone: 0600 -> 0600 under both; 0644 -> 0644 under 022, 0600 under 077. The quattro cp -af backup keeps the mode exactly. Leftover backups are readable only where the file already was.
Two things a chmod at start and after our own writes cannot cover, now in our README (on our dev branch, in the next release): omarchy-reinstall-configs loosening a 0600 file in place (cp -af /etc/skel/., same inode, skel contents), and those backups, which it never touches. The check now also re-runs on every change the shell publishes, which should close the first to the watcher's latency (harness-pinned, not yet measured live). HOME_MODE 0700 in login.defs bounds the fresh-install path.
Lines here: backup 1654, cp -P 1735 and 1750, omarchy-bar defaults 2373.
Either policy in #14770 / #12250 works for us; under #14770 the plugin's chmod becomes a no-op. Nothing further needed.