|
|
|
|
|
by ThailandJohn
277 days ago
|
|
After reviewing my own code.
Thanks for digging into the code! You're reviewing the regex fallback patterns that only trigger when AST
parsing fails. The primary detection uses Tree-sitter for structural analysis and taint flow tracking. That TOCTOU pattern IS terrible - it's meant as a last-resort 'something might be wrong here' flag when we
can't parse the AST. The real detection happens in theauditor/taint_analyzer/ which tracks actual data flow
from filesystem checks to file operations. But you're right - even fallback patterns shouldn't be this noisy. I'll tighten it to only flag actual
filesystem operations:
- os.path.exists → open()
- fs.exists → fs.writeFile()
- File.exists() → new FileWriter() If you actually run the tool with aud full, it uses the proper AST analysis first. These regex patterns are
the third fallback when Tree-sitter isn't available.
Thanks for the specific feedback - this is exactly why I open-sourced it!
|
|