Skip to content

sanitize datasource_description in tool descriptions; validate document_id#21

Open
lwsinclair wants to merge 1 commit intomainfrom
fix/tool-description-sanitization-and-path-validation
Open

sanitize datasource_description in tool descriptions; validate document_id#21
lwsinclair wants to merge 1 commit intomainfrom
fix/tool-description-sanitization-and-path-validation

Conversation

@lwsinclair
Copy link
Copy Markdown
Contributor

The datasource_description returned from the API was appended directly to every tool description the MCP client sees. If any field writable by a non-owner ends up there, it becomes LLM instructions. Now stripped of control chars, truncated, and wrapped in an untrusted-data marker.

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

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 — datasource_description sanitization + document_id validation

Copy link
Copy Markdown

@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.

LGTM

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