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.
C aiderastclaude-codecode-analysiscode-intelligencecodexcursorcypherdeveloper-toolsgemini-cligraph-visualizationkilocodeknowledge-graphmcpmcp-servermodel-context-protocolopencodesqlitetree-sitterwindsurf
mcp: skip search-filelist paths containing control characters
Martin Vogel2cd08f1de94d
diff --git a/src/mcp/mcp.c b/src/mcp/mcp.cindex 1068f979c..d91e693c5 100644--- a/src/mcp/mcp.c+++ b/src/mcp/mcp.c@@ -4959,6 +4959,14 @@ static bool write_scoped_filelist(cbm_mcp_server_t *srv, const char *project, coint written = 0;if (fl) {for (int fi = 0; fi < indexed_count; fi++) {+ /* A source path never legitimately contains a newline or carriage+ * return. Those bytes are exactly the record separator on the+ * Windows filelist (and would split naive line readers elsewhere),+ * so a crafted indexed path with an embedded newline could inject+ * an extra entry into the scan set. Skip such paths entirely. */+ if (strpbrk(indexed_files[fi], "\r\n") != NULL) {+ continue;+ }if (has_path_filter && path_regex) {#ifdef _WIN32cbm_normalize_path_sep(indexed_files[fi]);