{"record":{"id":"1c58613a4a1ec6ef","repo":"ruvnet/ruflo","slug":"tool-disabled","errorCode":"TOOL_DISABLED","errorMessage":"Tool \"${name}\" is disabled by default. Set MCP_ENABLE_TERMINAL=true to allow.","messagePattern":"Tool \"(.+?)\" is disabled by default\\. Set MCP_ENABLE_TERMINAL=true to allow\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ruflo/src/mcp-bridge/index.js","lineNumber":796,"sourceCode":"// link that made the disclosed unauthenticated-RCE chain reach shell.\nconst DANGEROUS_TOOLS = Object.freeze(new Set([\n  \"terminal_execute\",\n  \"ruflo__terminal_execute\",\n  \"devtools__terminal_execute\",\n]));\nfunction isTerminalTool(name) {\n  return DANGEROUS_TOOLS.has(name) || /terminal_execute/i.test(name);\n}\nconst MCP_ENABLE_TERMINAL = process.env.MCP_ENABLE_TERMINAL === \"true\";\n\nasync function executeTool(name, args) {\n  // Deny dangerous tools unless the operator explicitly opted in.\n  // Enforced on every path (not just autopilot) — root cause of ADR-166 V2/V3.\n  if (isTerminalTool(name) && !MCP_ENABLE_TERMINAL) {\n    return {\n      error:\n        `Tool \"${name}\" is disabled by default. Set MCP_ENABLE_TERMINAL=true to allow.`,\n      code: \"TOOL_DISABLED\",\n    };\n  }\n  // Validate that search-like tools have a non-empty query to prevent 400 errors\n  if (!args || typeof args !== \"object\") args = {};\n  const rawQuery = args.query ?? args.q ?? args.input ?? \"\";\n  const queryStr = typeof rawQuery === \"string\" ? rawQuery.trim() : String(rawQuery || \"\").trim();\n  const isSearchTool = name === \"search\" || name === \"web_research\" || /^(web_)?search/i.test(name);\n  if (isSearchTool && !queryStr) {\n    return { content: [{ type: \"text\", text: `No search query provided. Please specify a search query for '${name}'.` }] };\n  }\n\n  switch (name) {\n    case \"search\":\n      if (!CLOUD_FUNCTIONS.search) return { error: \"search endpoint not configured\" };\n      return callCloudFunction(CLOUD_FUNCTIONS.search, { query: args.query, limit: args.limit || 5 });\n\n    case \"web_research\": {\n      const action = args.action || \"search\";","sourceCodeStart":778,"sourceCodeEnd":814,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/mcp-bridge/index.js#L778-L814","documentation":"executeTool() matched the requested tool name against the terminal_execute deny-set (or /terminal_execute/i pattern) and MCP_ENABLE_TERMINAL is not 'true'. This is the ADR-166 hardening gate that blocks the previously unauthenticated-RCE path: shell-executing tools are denied unless the operator explicitly opts in via environment.","triggerScenarios":"Thrown at ruflo/src/mcp-bridge/index.js:796 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set MCP_ENABLE_TERMINAL=true in the environment to explicitly enable this tool.","Use an alternative enabled tool, or confirm the security implications before enabling terminal access."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}