fix(security): taint treesitter_used/regex_fallback stat miscounted clean files#211
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…lean files Stats loop inferred which engine ran from findings[0]['engine'], but this requires at least one finding to exist. Any clean file (0 findings) has 'if findings' evaluate False regardless of which engine actually analyzed it, so it always fell into the regex_fallback bucket. Found via real-codebase validation (Coretax-Auto-Downloader KDS backend, 0 taint findings total): treesitter_available:true but treesitter_used:0, regex_fallback:50 — misleading, since tree-sitter was in fact available and used for all 50 files, they just had no findings. Fix: check parser availability directly (mirrors _analyze_with_treesitter's own check) instead of inferring from finding content.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Found while continuing audit of
security --check taintagainst KDS backend.treesitter_available: truebuttreesitter_used: 0, regex_fallback: 50— misleading. Root cause: the stats loop inferred which engine ran fromfindings[0]['engine'], which needs at least one finding to exist. Any clean file (0 findings) always fell intoregex_fallbackregardless of which engine actually analyzed it.Fix: check parser availability directly instead of inferring from finding content. Verified:
treesitter_used: 50, regex_fallback: 0after fix, matching the fact that tree-sitter was available and used for all 50 files (they just had no vulnerabilities).