Skip to content

sanitize CK_DESCRIPTION in tool descriptions; validate document_id; stop echoing backend error bodies#6

Closed
lwsinclair wants to merge 1 commit into
mainfrom
fix/sanitize-ck-description-and-validate-document-id
Closed

sanitize CK_DESCRIPTION in tool descriptions; validate document_id; stop echoing backend error bodies#6
lwsinclair wants to merge 1 commit into
mainfrom
fix/sanitize-ck-description-and-validate-document-id

Conversation

@lwsinclair
Copy link
Copy Markdown

CK_DESCRIPTION was being substituted into tool-description strings directly, so a CK owner could inject arbitrary prompt-injection content into the LLM instructions seen by every consumer of the generated server. Now wrapped in a clearly-marked untrusted-context block and stripped of control chars.

document_id from resource URIs was passed into URL paths unchecked — validated with a hex/dash regex.

APIClient.get / .post no longer echo the full backend error body back to the client on non-2xx; they raise a plain McpError with just the status code.

Fixes here cascade to future template-generated CK servers. Existing generated repos still need the same fix applied directly.

Copy link
Copy Markdown

@thuong-nguyen-ea thuong-nguyen-ea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — CK_DESCRIPTION + document_id + error-body

Copy link
Copy Markdown
Collaborator

@mseep-ai mseep-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made and merged in this PR #7

@mseep-ai mseep-ai closed this Apr 20, 2026
@mseep-ai mseep-ai deleted the fix/sanitize-ck-description-and-validate-document-id branch April 20, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants