Command execution via R Markdown syntax script in Vim
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Code execution
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-78.
Summary
Vim before v9.2.1178 is affected. The R Markdown syntax script passes code chunk language names to globpath() after an incomplete cleanup, so text from the file can reach the shell on Unix systems (CWE-78). If a user opens a crafted .rmd, .smd, .qmd or similar file with syntax enabled, an attacker can execute arbitrary commands as that user.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
Command Execution via Rmd Syntax Highlighting in Vim < 9.2.1178 ============================================ Date: 12.10.2026 Severity: Medium CVE: *requested, not yet assigned* CWE: Improper Neutralization of Special Elements used in an OS Command (CWE-78), Improper Input Validation (CWE-20) ## Summary The R Markdown syntax script in `runtime/syntax/rmd.vim` collects the language names of code chunks from the buffer and passes them to `globpath()`. The script strips non-word characters from each name with a regular expression, which a crafted byte sequence can make stop early, so text from the file reaches `globpath()` unfiltered. On Unix, `globpath()` hands such a pattern to the shell, which allows arbitrary command execution when the file is opened. ## Description With the default `g:rmd_dynamic_fenced_languages`, `s:CheckRmdFencedLanguages()` reads the language name of every code chunk in the buffer and calls `s:IncludeLanguage()` for names it has not seen yet, which checks for a matching syntax file using `globpath()`. The name was trimmed with `substitute(v:val, '\W.*', '', '')`. The NFA regexp engine treats an overlong UTF-8 encoding of NUL as the end of the text, so the pattern does not match and the rest of the name is kept. If the name contains backticks, `globpath()` passes it to the shell for expansion. ## Impact Arbitrary command execution in the context of the user running Vim, when the user opens a crafted R Markdown or Quarto file (`.rmd`, `.smd`, `.qmd` and similar). Exploitation requires: - a Unix-like system (on Windows `globpath()` does not invoke the shell), - syntax highlighting enabled - the victim opening a crafted file. The severity is rated Medium because the user must open a crafted file of a specific rmd file type. ## Acknowledgements The Vim project would like to thank github user tylerni7-ant for reporting and analyzing the issue. ## References The issue has been fixed as of Vim patch [v9.2.1178](https://github.com/vim/vim/releases/tag/v9.2.1178). - [Commit](https://github.com/vim/vim/commit/7670338d8b695c476de868dabd34d68d6de2443b) - [Github Security Advisory](https://github.com/vim/vim/security/advisories/GHSA-x2w5-pj55-7hpc)
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | vim (vim) | < v9.2.1178 | v9.2.1178 | Patch available | GHSA-x2w5-pj55-7hpc |
- vim (vim) Vendor— Affected < v9.2.1178 Fixed in v9.2.1178 Patch available GHSA-x2w5-pj55-7hpc
Remediation
Update Vim to v9.2.1178 or later, which contains the fix.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-x2w5-pj55-7hpc vim (vim) Fixed in v9.2.1178 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-x2w5-pj55-7hpc
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences