Repository navigation
Commit 3199bd6
committed
fix(audit): remediate Carbon v1.3.0 audit findings F1-F6, E2, E3, N1, N3
- F1 (+N1): Deepest-existing-ancestor symlink resolution (40-hop cap),
RFC 8089 file://localhost/ + %XX normalization, interior quote/backslash
unquoting, allowlist hardening, and exact _cowrie_* control key stripping
across Rust trust.rs, Python __init__.py, and mcp-proxy params.arguments.
- F2: Deterministic session taint root (0x53 0x20 || SHA-256('COWRIE_TAINT_SET_V1\0'
|| sorted_unique_cids)) accepted alongside per-CID tokens in check_tool_call_v2,
mcp-proxy, CowrieToolGuard, and StatelessChallengeVerifier; dedup all 5 taint
push sites in main.rs; add cowrie_session_taint_root C-ABI.
- F3: Charge MAX_DECODED_BYTES (64 MiB) + MAX_KEY_LEN (65536) in parse_json_impl;
add O(1)-drain bounded line reader on mcp-proxy stdin and child stdout; fix
O(N^2) number scan in wasm/mcp-mediator.mjs.
- F4: API-preserving canonical Eq/PartialEq on Value::FloatBits(u64); skew-guarded
expiry pruning (expiry + MAX_CLOCK_SKEW_SECS < now) + crash-safe atomic CWNL0002
compaction in Rust NonceLedger and Python DurableNonceLedger.
- F5: Add read-only O(1) cowrie_statepage_probe_header (Page 0 + 94B footer + HMAC)
and scheduler match caching so full Merkle scan runs once on worker load while
keeping cowrie_statepage_open_strict fail-closed; fix TP/PP>1 doc_cid mismatch;
fix _ReusableSlabPool fragmentation eviction, _fast_staging.clear() leak, CUDA
D2H stream sync on abort, and V4 manifest/padding edge cases.
- F6: Remove incompatible fallback_path in _find_lib() (raise clear ABI version
mismatch RuntimeError); enforce _is_safe_shared_lib and fail-closed existence/ABI
checks on COWRIE_LIB and COWRIE_LIB_PATH.
- E2: Add ivf/zonemap features to cowrie-core (default-on for C-ABI/conformance),
build cowrie-cli with default-features=false, gate bench-live-ivf behind bench
feature, and guard optional ivf/zonemap ctypes bindings with hasattr.
- E3 (+N3): Fix lens.rs UTF-8 char-boundary panic, O(N^2) bounded-wildcard grep,
RFC 6901 atlas JSON escaping, and SLICE double |TAINTED|TAINTED; harden
evidence.rs (reject state=revoked with revoked_at=0, tensor_count!=0, non-policy
frame headers, wasm32 usize casts, JSON escaping), Python evidence.py
sentinel escaping on approval args, and initialize *out_json on FFI error.1 parent e06936b commit 3199bd6
19 files changed
Lines changed: 3301 additions & 538 deletions
File tree
- adapters/vllm
- crates
- cowrie-cli
- src
- cowrie-core
- include
- src
- python/cowrie
- integrations
- tests
- wasm
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | | - | |
| 21 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
177 | 189 | | |
178 | 190 | | |
179 | 191 | | |
| |||
214 | 226 | | |
215 | 227 | | |
216 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
217 | 235 | | |
218 | 236 | | |
219 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
164 | 190 | | |
165 | 191 | | |
166 | 192 | | |
167 | 193 | | |
168 | 194 | | |
169 | 195 | | |
170 | 196 | | |
171 | | - | |
| 197 | + | |
172 | 198 | | |
173 | 199 | | |
174 | 200 | | |
| |||
1139 | 1165 | | |
1140 | 1166 | | |
1141 | 1167 | | |
| 1168 | + | |
1142 | 1169 | | |
1143 | 1170 | | |
1144 | 1171 | | |
| |||
1154 | 1181 | | |
1155 | 1182 | | |
1156 | 1183 | | |
| 1184 | + | |
1157 | 1185 | | |
1158 | 1186 | | |
1159 | 1187 | | |
| |||
1167 | 1195 | | |
1168 | 1196 | | |
1169 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
1170 | 1202 | | |
1171 | 1203 | | |
1172 | 1204 | | |
| |||
1311 | 1343 | | |
1312 | 1344 | | |
1313 | 1345 | | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
1322 | 1354 | | |
1323 | 1355 | | |
1324 | 1356 | | |
| |||
1353 | 1385 | | |
1354 | 1386 | | |
1355 | 1387 | | |
1356 | | - | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
1357 | 1391 | | |
1358 | | - | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1359 | 1395 | | |
1360 | 1396 | | |
1361 | 1397 | | |
| |||
1371 | 1407 | | |
1372 | 1408 | | |
1373 | 1409 | | |
| 1410 | + | |
1374 | 1411 | | |
1375 | 1412 | | |
1376 | 1413 | | |
| |||
1386 | 1423 | | |
1387 | 1424 | | |
1388 | 1425 | | |
| 1426 | + | |
1389 | 1427 | | |
1390 | 1428 | | |
1391 | 1429 | | |
| |||
1458 | 1496 | | |
1459 | 1497 | | |
1460 | 1498 | | |
1461 | | - | |
| 1499 | + | |
1462 | 1500 | | |
1463 | 1501 | | |
1464 | 1502 | | |
| |||
0 commit comments