Skip to content

Do not trust user doc-comment markdown in hover - #283

Open
qiuradsk wants to merge 1 commit into
mainfrom
fix/untrusted-user-doc-hover
Open

qiuradsk wants to merge 1 commit into
mainfrom
fix/untrusted-user-doc-hover

Conversation

@qiuradsk

@qiuradsk qiuradsk commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Problem

UserMarkdown rendered @description/@remarks/@param/@example text from the opened .lsp file into a MarkdownString with isTrusted = true. A markdown link such as docs in a doc comment therefore became a clickable link that runs a VS Code command when the user clicks it in the hover.

Fix

Stop marking the user-documentation hover as trusted. That hover contains no command: links of its own, so nothing depends on trust. The other isTrusted sites only render bundled help data and are unchanged.

Testing

  • Added regression test \UserDefined LSP Markdown - Not Trusted.
  • Manually verified with a comment containing [AutoLISP docs](command:workbench.action.openSettings): the link no longer executes.

Made with Cursor

UserMarkdown rendered text from workspace .lsp comments in a trusted
MarkdownString, so a command: link in a doc comment could run VS Code
commands when clicked. Render it untrusted and add a regression test.

Co-authored-by: Cursor <cursoragent@cursor.com>
@qiuradsk
qiuradsk requested a review from LanDong-adsk November 9, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant