Commit Graph
3 Commits
Author SHA1 Message Date
Shakti Prasad Mohapatra 300a0e4da5 fix(security): scope find's global options so -L/-H/-P cannot bypass the read grant
find's global options (-L/-H/-P, -D, -O, and the BSD -E/-X/-d/-s/-x) precede the
starting points, but _stage_targets treated every leading dash token as the start
of find's predicates and returned no read targets. With none, the session grant's
root check in permissions.py passed vacuously: 'find -L /etc -name shadow' and
'find -H ~/.ssh -type f' auto-ran under 'read-only command (session grant)' while
the unprefixed forms correctly asked for approval. That is exactly the escape
OPE-130 was created to close.

Parse find's global options ahead of the path list (-D consumes its debugopts
value; -f names the starting point itself), then collect starting points until
the first predicate. The unprefixed behavior is unchanged.

Tests: read_targets now names the starting point for prefixed forms; the session
grant asks for the out-of-root prefixed reads and still auto-runs them inside
the root.
2026-10-12 00:19:10 +05:30
Harneet Singh 07d948b46f security: reject shell variable expansion in readonly grants 2026-08-26 11:00:38 -04:00
Devika Verma 5cbd3249d2 OPE-130: scope read-only session grants to the session's folders 2026-08-22 09:16:01 +05:30