Commit 6663956
zig-api: wire first proven_ffi_safe_* call (actualises proven→zig-api layering)
Wires `proven_path_has_traversal` from `libproven_ffi` into
`process.zig:safePathDefault` as a second gate on every gnosis path
argument. The first gate (allowlist prefix match) was already present;
the new proven gate adds formally-verified traversal detection, catching
attacks such as `/tmp/../../../etc/passwd` that pass the prefix check
but navigate outside the allowed subtree.
The call is load-bearing: `runGnosis` calls `safePathDefault` for every
`template_path` and `scm_path` before invoking the subprocess, so
`proven_path_has_traversal` sits on the critical security path.
Also adds a new test (`safe_path rejects traversal inside allowed
prefix`) that exercises the proven gate specifically, and three tests
for the proven symbol in `verification-ecosystem/proven/ffi/zig/src/main.zig`.
`build.zig` links `libproven_ffi.a` built from
`verification-ecosystem/proven/ffi/zig/build_standalone.zig`.
Paths are absolute defaults; override with `-Dproven-lib-path`.
`zig build` and `zig build test` both exit 0.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 0d6a814 commit 6663956
3 files changed
Lines changed: 118 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
14 | 33 | | |
15 | 34 | | |
16 | 35 | | |
17 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
18 | 52 | | |
19 | 53 | | |
20 | 54 | | |
| |||
25 | 59 | | |
26 | 60 | | |
27 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
28 | 68 | | |
29 | 69 | | |
30 | 70 | | |
| |||
45 | 85 | | |
46 | 86 | | |
47 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
48 | 91 | | |
49 | 92 | | |
50 | 93 | | |
| |||
70 | 113 | | |
71 | 114 | | |
72 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
73 | 119 | | |
74 | 120 | | |
75 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
8 | 17 | | |
9 | 18 | | |
10 | 19 | | |
11 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
12 | 48 | | |
13 | 49 | | |
14 | 50 | | |
| |||
43 | 79 | | |
44 | 80 | | |
45 | 81 | | |
46 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
47 | 91 | | |
48 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
49 | 109 | | |
50 | 110 | | |
51 | 111 | | |
| |||
210 | 270 | | |
211 | 271 | | |
212 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
0 commit comments