Skip to content

Add Zig language support - #17

Merged
Zeerg merged 2 commits into
mainfrom
feat/zig-language-support
Feb 23, 2026
Merged

Zeerg merged 2 commits into
mainfrom
feat/zig-language-support

Conversation

@Zeerg

@Zeerg Zeerg commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Zig as the 17th supported language with coverage across 3 of 4 analysis layers
  • 8 regex rules (BATOU-ZIG-001 to ZIG-008): unsafe pointer casts (@ptrCast, @intToPtr, @alignCast, @bitCast), command injection, path traversal, error suppression (catch unreachable), weak crypto
  • 56 taint catalog entries: 22 sources (std.http, std.os, std.net, std.json, std.fs), 23 sinks (execve, file write, format string, HTTP response, memory ops), 11 sanitizers (path normalize, mem.trim, realpathAlloc)
  • tsflow language config with Zig tree-sitter node type extractors (function_declaration, call_expression, builtin_call_expression, etc.)
  • 7 test fixtures (4 vulnerable, 3 safe) covering all rule categories
  • Updated CLAUDE.md, README.md, docs/perl.md, and suppress/parse.go with new language counts

Tree-sitter AST analyzer (Layer 2) deferred — the tree-sitter-zig grammar exists with Go bindings but the go-tree-sitter binding integration is a follow-up.

Test plan

  • go build ./... passes
  • go test ./internal/rules/zig/ -v — 30 tests pass
  • Taint catalog registration verified
  • Full make test on CI
  • Manual verification with sample Zig files through the hook

🤖 Generated with Claude Code

Zeerg and others added 2 commits February 23, 2026 09:52
Adds Zig as the 17th supported language with:
- 8 regex rules (ZIG-001 to ZIG-008): unsafe pointer casts, command injection,
  path traversal, error suppression, weak crypto
- Taint catalog: 22 sources, 23 sinks, 11 sanitizers covering std.http,
  std.os, std.fs, std.process, std.net, std.json
- tsflow language config with Zig tree-sitter node type extractors
- 7 test fixtures (4 vulnerable, 3 safe)
- Updated docs (CLAUDE.md, README.md, docs/perl.md) with new language counts

Tree-sitter AST analyzer deferred pending grammar binding integration
(tree-sitter-zig grammar exists but go-tree-sitter binding not yet added).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds docs/claude-md-snippet.md with a ready-to-copy section that projects
can paste into their CLAUDE.md so Claude understands Batou findings and
knows how to respond to blocks, hints, and suppressions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Zeerg
Zeerg merged commit 098a3ce into main Feb 23, 2026
3 checks passed
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