Context
brow intentionally handles sensitive browser profiles, cookies, localStorage, network responses, and arbitrary eval code. The current local-only architecture reduces remote exposure, but several boundaries should be explicit and tested:
- Profile and state names are joined directly to filesystem paths.
- Profile deletion uses recursive removal on the derived path.
- State JSON containing authentication tokens is written with default filesystem permissions.
- The daemon PID file stores only an integer; a stale/reused PID could refer to an unrelated process.
eval, authenticated fetches, and captured response previews can expose secrets by design, but there is no consolidated threat-model documentation.
Goal
Make the local security model defensible without removing the power-user capabilities that distinguish brow.
Files
brow/src/brow/profiles.py
brow/src/brow/config.py
brow/src/brow/daemon.py
brow/src/brow/routes/profiles.py
brow/src/brow/routes/eval.py
brow/src/brow/routes/browser.py
- Corresponding tests under
brow/tests/
- Create:
SECURITY.md
- Add or update a docs page covering security and credential handling
Implementation checklist
Required tests
- Reject
../escape, absolute paths, encoded separators, empty names, and path aliases.
- Confirm valid existing names continue to work.
- Confirm state files are private on POSIX.
- Confirm a stale/unrelated PID is not terminated.
- Confirm normal daemon start/status/stop still works.
Acceptance criteria
- User-controlled names cannot read, write, or delete outside
BROW_HOME.
- Stored authentication state is private by default on supported POSIX systems.
brow daemon stop only terminates a verified brow daemon.
- The repository clearly documents trusted-client assumptions and high-risk commands.
- Security behavior is covered by automated tests.
Context
browintentionally handles sensitive browser profiles, cookies, localStorage, network responses, and arbitrary eval code. The current local-only architecture reduces remote exposure, but several boundaries should be explicit and tested:eval, authenticated fetches, and captured response previews can expose secrets by design, but there is no consolidated threat-model documentation.Goal
Make the local security model defensible without removing the power-user capabilities that distinguish brow.
Files
brow/src/brow/profiles.pybrow/src/brow/config.pybrow/src/brow/daemon.pybrow/src/brow/routes/profiles.pybrow/src/brow/routes/eval.pybrow/src/brow/routes/browser.pybrow/tests/SECURITY.mdImplementation checklist
[A-Za-z0-9._-]+allowlist.BROW_HOME, profiles, and states directories with private permissions on POSIX.SECURITY.mdand enable GitHub private vulnerability reporting if desired.Required tests
../escape, absolute paths, encoded separators, empty names, and path aliases.Acceptance criteria
BROW_HOME.brow daemon stoponly terminates a verified brow daemon.