Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Fix binary string audit: exclude bare token vocabulary matches

Martin Vogel3f7f7eeab7fc
diff --git a/scripts/security-strings.sh b/scripts/security-strings.sh
index 0bfd4e7c2..fd2ba7ff5 100755
--- a/scripts/security-strings.sh
+++ b/scripts/security-strings.sh
@@ -97,7 +97,10 @@ echo ""
echo "--- Dangerous command detection ---"
DANGEROUS_CMDS='wget|netcat|ncat|/dev/tcp|telnet'
-if grep -wE "$DANGEROUS_CMDS" "$STRINGS_FILE" > "$SEC_CMDS" 2>/dev/null; then
+# Filter out bare single-word matches from the embedded token vocabulary
+# (vendored/nomic/code_tokens.h contains 40K code tokens including "wget").
+# Real dangerous strings would appear in a command context, not as standalone words.
+if grep -wE "$DANGEROUS_CMDS" "$STRINGS_FILE" | grep -vxE '[a-z]{2,10}' > "$SEC_CMDS" 2>/dev/null && [ -s "$SEC_CMDS" ]; then
echo "BLOCKED: Dangerous commands found in binary:"
cat "$SEC_CMDS"
FAIL=1