You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
is_doc_file() incorrectly treats extensionless files as documentation #489
is_doc_file() in security_scanner.rs uses rsplit(.).next() to extract the file extension. For a filename with no dot (e.g., org, tex, md), rsplit(.).next() returns the whole string — so is_doc_file("org") returns true.
Impact
Input
Expected
Actual
is_doc_file("README.md")
true
true ✅
is_doc_file("src/org")
false
true ❌ (Go package dir)
is_doc_file("tex")
false
true ❌ (binary named tex)
is_doc_file("CHANGELOG")
false
false ✅
Low real-world probability but logically incorrect.
Fix
Check that the path contains a . before extracting extension:
fnis_doc_file(path:&str) -> bool{let ext = match path.rsplit('.').next(){Some(e)if e.len() < path.len() => e,// Has a dot
_ => returnfalse,// No dot, no extension};matches!(ext,"md" | "markdown" | "txt" | ...)}
Activity
fix: CORS scanner misses framework-specific wildcard patterns and neg…
fix(rules): widen CORS regex for framework patterns and fix negation …