Browser managed policy directories are world-writable
System details
Omarchy dev branch at 3fabdf73; Chromium/Brave browser policy setup; hardware independent
What's wrong?
Omarchy creates Chromium and Brave managed policy directories under /etc, then makes them writable by every local user.
Affected files:
install/config/theme.shmigrations/1757147211.sh
Current behavior:
sudo mkdir -p /etc/chromium/policies/managed
sudo chmod a+rw /etc/chromium/policies/managed
sudo mkdir -p /etc/brave/policies/managed
sudo chmod a+rw /etc/brave/policies/managed
These directories are privileged browser managed-policy inputs. Chromium's Linux policy docs say managed policy files/directories should not be writable by non-admin users.
Steps to recreate:
-
Run the Omarchy install path or the existing migration that creates browser policy directories.
-
Check permissions:
ls -ld /etc/chromium/policies/managed /etc/brave/policies/managed -
Notice that non-root users can write files into those directories.
Expected behavior:
The managed policy directories should remain root/admin writable only, for example root-owned mode 755. Omarchy can still update color.json by writing it through sudo.
Actual behavior:
The directories are made writable by everyone so omarchy-theme-set-browser can write color.json without sudo.
Suggested fix:
- Create
/etc/chromium/policies/managedand/etc/brave/policies/managedwith root ownership and mode755. - Write
color.jsonviasudo tee. - Set
color.jsonto root-owned mode644. - Add a migration to repair permissions on existing installs.
I have a patch prepared for this.
Confirmed on a current install — the managed policy dir is world-writable (mode 0777):
$ ls -ld /etc/chromium/policies/managed
drwxrwxrwx 1 root root 20 /etc/chromium/policies/managed
Any local user (or any process running as the user) can drop or edit files in a root-owned browser managed-policy directory, which is a privilege/policy-integrity issue: managed policies can force extensions, proxies, or disable security features. a+rw is far more than needed here — the browser only needs to read these files.
Fix is simply to not widen the perms; mkdir -p already creates them 0755 (root-writable, world-readable), which is all Chromium/Brave require:
sudo mkdir -p /etc/chromium/policies/managed # 0755 is enough, drop the chmod a+rw
sudo mkdir -p /etc/brave/policies/managed
Existing installs can remediate with sudo chmod 755 /etc/chromium/policies/managed /etc/brave/policies/managed.
Still present on stable 4.0.1-1 (confirmed 2026-08-30). This issue was filed against dev at 3fabdf73 in May, so adding a current-release datapoint plus three things that have changed since.
1. The cited path no longer exists. install/config/theme.sh is gone; the chmod now lives at install/config/theme-system.sh:11:
mkdir -p /etc/chromium/policies/managed
chmod a+rw /etc/chromium/policies/managed
A patch against the old path would miss.
2. The scope is wider than the two directories listed. On this install:
drwxrwxrwx root:root /etc/chromium/policies/managed
drwxrwxrwx root:root /etc/opt/chrome/policies/managed
drwxrwxrwx root:root /etc/brave/policies/managed
/etc/opt/chrome/policies/managed is world-writable too and isn't mentioned above. omarchy-theme-set-browser writes color.json into four directories — chromium, chrome, edge and brave — so any fix needs to cover all of them, not just the two.
3. This is the part I think matters most: fixing the install script will not repair existing machines. In the current tree, chmod a+rw appears exactly once and targets only the chromium directory:
$ grep -rn 'chmod a+rw' /usr/share/omarchy/
/usr/share/omarchy/install/config/theme-system.sh:11
Yet chrome and brave are 0777 here as well. Those permissions are residue from the retired migration referenced in the original report (migrations/1757147211.sh, which no longer ships). Nothing in the current code created them and nothing repairs them, so they persist indefinitely on any install that ever ran that migration.
That makes the reporter's fourth bullet — "Add a migration to repair permissions on existing installs" — the load-bearing half of the fix rather than a tidy-up. Correcting theme-system.sh alone would leave machines like this one exactly as they are today.
A safe workaround in the meantime, for anyone who finds this issue. omarchy-theme-set-browser skips a directory that doesn't exist:
set_browser_policy() {
local policy_dir="$1"
[[ -d $policy_dir ]] || return
...
}
So removing the directories is silent and non-breaking — theme switching continues to work, you simply lose the browser accent colour and the "Managed by your organization" badge:
sudo rm -rf /etc/chromium/policies/managed /etc/opt/chrome/policies/managed /etc/brave/policies/managed
Two caveats: omarchy update re-runs theme-system.sh, so the chromium directory comes back world-writable and this needs re-checking after updates. And it is a workaround for users, not a substitute for the fix — most people will never know the directory is there.
This is fixed on quattro by #7972 (merged as 7d58bb9a6), and the same change shipped to stable in v4.0.2 (da0fe6d89, released 2026-08-31). The 4.0.1 report above predates that release.
What changed: the install no longer runs chmod a+rw. Chromium, Chrome, Edge and Brave policy directories and their parents are created 0755 root:root (install/helpers/browser-policy.sh), and color.json is written 0644 by root through omarchy-theme-set-browser-policy. Migration 1787515927.sh repairs existing installs: it re-creates all four managed directories 0755 root:root, removes anything inside them not owned by root, and does the same for the Firefox and Zen distribution directories. That covers the leftover chrome and brave directories from the retired 1757147211.sh migration that the comment above pointed out.
Checked on a disposable worker built from the Omarchy ISO: I made the chromium, chrome and brave managed directories drwxrwxrwx as on an affected install, and a normal user could drop a file into them. After running the migration from quattro, all three were drwxr-xr-x root root, the planted file was gone, color.json was root-owned 0644, and the same user's write was refused with Permission denied. test/shell.d/browser-policy-dir-test.sh passed 23 of 23 on the same worker.
Second opinion: Codex at medium effort agreed that #7972 covers every Chromium-family directory and both upgrade paths, and confirmed the v4.0.2 release; independence is not guaranteed. It also raised two hardening ideas: /etc/opt is not in the parent list, and the root writer assumes the parents were already repaired. Neither is something this issue's code caused. Old Omarchy only ran chmod a+rw on the leaf directories, and mkdir -p left /etc/opt and the other parents at 0755.
Anyone still on 4.0.1 or earlier gets the repair by updating to 4.0.2 or later. This is waiting on the maintainer to close it.