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(security-strings): allowlist 'telnet' from rst grammar URI schemes

Martin Vogel72c5bdba89c1
diff --git a/scripts/security-strings.sh b/scripts/security-strings.sh
index a66eec003..1bf4b7f99 100755
--- a/scripts/security-strings.sh
+++ b/scripts/security-strings.sh
@@ -117,7 +117,19 @@ echo ""
echo "--- Dangerous command detection ---"
DANGEROUS_CMDS='wget|netcat|ncat|/dev/tcp|telnet'
+# Known-benign matches (vendored grammar URI scheme tables, etc.). Each entry
+# is a regex matched against the full line; matches are stripped before
+# evaluation. Document the source so reviewers can verify the false positive.
+ALLOWED_DANGEROUS=(
+ '^telnet$' # rst tree-sitter grammar: valid_schemas[] in vendored/grammars/rst/tree_sitter_rst/chars.c
+)
if grep -wE "$DANGEROUS_CMDS" "$STRINGS_FILE" > "$SEC_CMDS" 2>/dev/null && [ -s "$SEC_CMDS" ]; then
+ for allow in "${ALLOWED_DANGEROUS[@]}"; do
+ grep -vE "$allow" "$SEC_CMDS" > "${SEC_CMDS}.tmp" || true
+ mv "${SEC_CMDS}.tmp" "$SEC_CMDS"
+ done
+fi
+if [ -s "$SEC_CMDS" ]; then
echo "BLOCKED: Dangerous commands found in binary:"
cat "$SEC_CMDS"
FAIL=1