T09 · Insecure Skill Coding Practices
- Location
patches/ollama-stream.ts:337- Finding
Untrusted Markdown Content Is Promoted to an Executable Tool Call
- Content
View full analysis
; const name = typeof parsed.name === "string" ? parsed.name : undefined; if (!name) { continue; } const args = parsed.arguments != null && typeof parsed.arguments === "object" ? (parsed.arguments as Record) : parsed.parameters != null && typeof parsed.parameters === "object" ? (parsed.parameters as Record) : {}; results.push({ function: { name, arguments: args } }); } catch { log.warn(`[manusilized] Failed to parse Markdown tool call: ${raw.slice(0, 120)}`); } } return results; } ``` The resulting calls are subsequently attached to the assistant response as structured tool calls: ```ts if (accumulatedToolCalls.length === 0 && accumulatedContent) { const markdownCalls = extractMarkdownToolCalls(accumulatedContent); if (markdownCalls.length > 0) { log.debug( `[manusilized] Extracted ${markdownCalls.length} tool call(s) from Markdown fallback`, ); accumulatedToolCalls.push(...markdownCalls); // Strip the tool-call JSON blocks from the visible content so the ...[truncated 3252 chars]- Remediation
View remediation
