Skip to content

fix: Round 3+4 codebase audit fixes#27

Merged
b-macker merged 3 commits into
masterfrom
audit/round3-fixes
Jun 13, 2026
Merged

fix: Round 3+4 codebase audit fixes#27
b-macker merged 3 commits into
masterfrom
audit/round3-fixes

Conversation

@b-macker

Copy link
Copy Markdown
Owner

Summary

  • Round 3 audit: 25 findings (2 CRITICAL, 5 HIGH, 8 MEDIUM, 10 LOW) — all fixed
    • CSV/IO sandbox bypass (C-1/C-2), VM taint stale pointers (H-1), CSV quote escaping (H-3), UseStatement error swallowing (H-4), filesystem imports fail-open (H-5), compiler brace-counting (H-6)
    • Dangling governance thread-local pointer fix (SIGBUS on ARM64)
    • Windows build fix (cross-platform includes for SSRF protection)
  • Round 4 slop audit: 12 findings (2 HIGH, 4 MEDIUM, 6 LOW), 14 false positives eliminated across 3 verification passes
    • H-1: Filesystem capability sync on mid-run governance reload (was missing, unlike network/shell)
    • H-2: --diff formatter flag now shows unified diff instead of full formatted text
    • M-1: JS executor re-throws on error (was uniquely swallowing exceptions vs all other executors)
    • M-2: Debugger watch evaluation limitation documented

Test plan

  • cmake .. && make naab-lang -j4 — 0 errors
  • bash run-all-tests.sh — 396 tests, 0 unexpected failures (2 runs)
  • bash tests/security/test_error_msg_leaks.sh — 738 checks, 0 failures
  • Both failing tests from first run (feature_showcase, consequence_proof) confirmed transient — pass standalone and on second full run

🤖 Generated with Claude Code

…or propagation

H-1: Add filesystem capability sync to governance mid-run reload
(governance_config.cpp) — FS_READ/FS_WRITE now removed when config
tightens filesystem.mode, matching startup syncGovernanceToSandbox().

H-2: --diff formatter flag now shows unified diff output (main.cpp)
instead of printing the full formatted text.

M-1: JS executor re-throws on error (js_executor_adapter.cpp) instead
of swallowing exceptions and returning null — matches Python executor.

M-2: Document watch evaluation limitation in debugger (debugger.cpp).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

NAAb Governance Report

Metric Count
Files checked 16
Passed 16
Failed 0

All governance checks passed!

Generated by NAAb Governance Engine v4.0

Termux User and others added 2 commits June 13, 2026 13:40
Replaces terse "not yet implemented" with actionable guidance pointing
to executeWithReturn() or the subprocess-based executor as alternatives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e guards, lockfile safety

H-1: Add subscript (U+2090-U+209C) and superscript (U+2070-U+207F,
U+00B2/B3/B9) normalization to governance Unicode scanner. Closes
bypass vector where os.systeₘ() evaded pattern matching.

M-1: Add dangerous Python import patterns (import os/subprocess/shutil/
ctypes/pty/commands) to checkCodeInjection() pre-execution scan.

M-2: Add .is_string()/.is_boolean()/.is_number_integer() type guards
to critical governance_config.cpp fields (version, extends, description,
per-language timeout/max_lines/max_output_size, require_explicit, mode).

M-3: Replace bare catch(...) in lockfile.cpp with logged exception +
parse_failed flag that prevents save() from overwriting valid data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@b-macker b-macker merged commit fb8e6b9 into master Jun 13, 2026
20 checks passed
@b-macker b-macker deleted the audit/round3-fixes branch June 13, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant