]> git.eshelyaron.com Git - emacs.git/commit
Fix potential security issue fontifying lsp doc
authorJoão Távora <joaotavora@gmail.com>
Mon, 19 Nov 2018 23:16:33 +0000 (23:16 +0000)
committerJoão Távora <joaotavora@gmail.com>
Thu, 22 Nov 2018 22:20:32 +0000 (22:20 +0000)
commitf62f37d1ed8965eee954ad70794484bcc432de24
tree0bfea50e793e3e7d592555a21521105aa725aee8
parenta6536ec8b0c20cab5c04edf7c552077a9d3f6b7d
Fix potential security issue fontifying lsp doc

Previously, a server could mistankely or maliciously call *-mode
functions by in the response to a completion or hover request,
specifically in the :documentation field of the response.

Although there are plenty of similar avenues of attack in Emacs, it's
probably a good idea not to let LSP servers decide which functions to
call in an Emacs session running Eglot.

* eglot.el (eglot--format-markup): Call major-mode to fontify
buffer, not some dynamically constructed function name.
(eglot-completion-at-point): Ensure eglot--format-markup runs in
source buffer.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/154
lisp/progmodes/eglot.el