Commit 75089ad
fix(assail): make UncheckedAllocation null-check-aware; tighten eval detectors
Three precision fixes to the C/JS/Python/Shell analyzers that were producing
false positives across the estate (surfaced triaging hyperpolymath/proven#68
and JoshuaJewell/paint-type#86):
1. UncheckedAllocation (C): the detector named "Unchecked" flagged EVERY
`malloc(...)` regardless of a following NULL check, and emitted a line-less,
file-level finding. It now scans per line, skips a malloc whose result is
NULL-checked within a short window (`if (p == NULL)`, `if (!p)`, nullptr),
and attaches a line number. Net effect: genuinely-guarded allocations stop
firing, genuinely-unchecked ones still fire (new test), and the line number
lets an inline `// panic-attack: accepted` marker suppress a reviewed site.
This is why a real null-check fix (proven stubs.c) previously did not clear.
2. DynamicCodeExecution (JS/Python): `contains("eval(")` matched FFI symbol
names like `proven_calculator_eval(`. Now word-boundary `\beval\s*\(`
(and `\b(?:eval|exec)\s*\(` for Python) — genuine `eval(` still flagged.
3. CommandInjection (Shell): `contains("eval ")` matched the `--eval` CLI flag.
Now matches the eval builtin only in statement position
(`(?m)(?:^|[\s;&|(])eval[ \t]`) — `--eval`/`-eval` no longer flagged, the
real shell eval builtin still is.
All conservative (no new false negatives): a site is only treated as
checked/benign on a clear signal. Verified end-to-end — proven: 1 active
Critical/High -> 0 (stubs.c clears); paint-type: 36 -> 35 (the gossamer
`--eval` benchmark FP clears; genuinely-unsafe vendored FFI + the irreducible
believe_me axiom correctly remain). 4 new tests; full analyzer suite green
(17/17); zero warnings.
Refs #32, hyperpolymath/proven#68.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 926c507 commit 75089ad
2 files changed
Lines changed: 201 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
243 | 246 | | |
244 | 247 | | |
245 | 248 | | |
| |||
259 | 262 | | |
260 | 263 | | |
261 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
262 | 318 | | |
263 | 319 | | |
264 | 320 | | |
| |||
1662 | 1718 | | |
1663 | 1719 | | |
1664 | 1720 | | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
1665 | 1727 | | |
1666 | 1728 | | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
1677 | | - | |
1678 | | - | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
1679 | 1744 | | |
1680 | 1745 | | |
1681 | 1746 | | |
| |||
2035 | 2100 | | |
2036 | 2101 | | |
2037 | 2102 | | |
2038 | | - | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
2039 | 2108 | | |
2040 | 2109 | | |
2041 | 2110 | | |
| |||
2234 | 2303 | | |
2235 | 2304 | | |
2236 | 2305 | | |
2237 | | - | |
2238 | | - | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
2239 | 2312 | | |
2240 | 2313 | | |
2241 | 2314 | | |
| |||
4475 | 4548 | | |
4476 | 4549 | | |
4477 | 4550 | | |
4478 | | - | |
4479 | | - | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
4480 | 4558 | | |
4481 | 4559 | | |
4482 | 4560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
0 commit comments