Command Execution via CSS Omni-Completion in Vim < 9.2.1342
===========================================================
Date: 12.11.2026
Severity: Low
CVE: *requested, not yet assigned*
CWE: Improper Neutralization of Special Elements used in an OS Command
     (CWE-78)

## Summary
The CSS omni-completion script in `runtime/autoload/csscomplete.vim` passes
the file name after an `@import` rule from the buffer to `glob()` without
escaping it.  On Unix, `glob()` hands a pattern containing backticks to the
shell, which allows arbitrary command execution when the user completes an
`@import` file name in a crafted CSS file.

## Description
When completing after `@import "` or `@import url(`,
`csscomplete#CompleteCSS()` takes the text typed so far and calls
`glob(filestart . '*')` to find matching files.  The text is taken directly
from the current line and not escaped.

If it contains backticks, `glob()` uses the shell for the expansion
and the text between the backticks is executed as a shell command.

## Impact
Arbitrary command execution in the context of the user running Vim, when the
user uses omni completion (`CTRL-X CTRL-O`) on a crafted `@import` line in a
CSS file.

Exploitation requires:
- a Unix-like system (on Windows `glob()` does not invoke the shell),
- filetype plugins enabled, so that 'omnifunc' is set for CSS files,
- the victim opening a crafted CSS file and using omni completion with the
  cursor after the crafted `@import` value.

The severity is rated Low because, unlike opening the file alone, the user
must explicitly invoke omni completion on a crafted suspicious line.

## Acknowledgements
The Vim project would like to thank Github user Magashwarahan for reporting the
issue.

## References
The issue has been fixed as of Vim patch 
[v9.2.1342](https://github.com/vim/vim/releases/tag/v9.2.1342).
- 
[Commit](https://github.com/vim/vim/commit/cd50664ab086a37839e3d12754040dbc324dbfa7)
- [Github Security 
Advisory](https://github.com/vim/vim/security/advisories/GHSA-pp46-p33v-78rf)


Best,
Christian
-- 
Wie man sein Kind nicht nennen sollte: 
  Sam A. Riter 

Reply via email to