ClawWork icon indicating copy to clipboard operation
ClawWork copied to clipboard

[Bug] Conductor prompt injection surface in room-store initConductor

Open samzong opened this issue 8 months ago • 1 comments

Summary

packages/core/src/stores/room-store.ts — initConductor() concatenates agentCatalog (from gateway) and userMessage (from user input) directly into the conductor system prompt without any escaping, validation, or length limits.

let prompt = buildConductorPrompt(agentCatalog);
if (userMessage) {
  prompt += `\n\n---\nUser task:\n${userMessage}`;
}

Expected behavior

  • userMessage should be truncated to a reasonable max length
  • agentCatalog should be validated for expected structure before embedding
  • Consider wrapping user content in a fenced block to reduce injection surface

Files

  • packages/core/src/stores/room-store.ts — initConductor() (line ~97)
  • packages/shared/src/constants.ts — buildConductorPrompt()

Context

Introduced in PR #210.

samzong avatar Mar 31 '26 17:03 samzong

Hi @samzong, Thanks for opening an issue! We will look into it as soon as possible.

Details

Instructions for interacting with me using comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the gh-ci-bot repository.

github-actions[bot] avatar Mar 31 '26 17:03 github-actions[bot]