JLSEC-2026-1873: Code Injection

Published Dec 2, 2026
·
Updated

Vim is an open source, command line text editor. Prior to version 9.2.0495, a Vimscript code injection vulnerability exists in s:NetrwBookHistSave() in the netrw plugin (runtime/pack/dist/opt/netrw/autoload/netrw.vim) when serializing browsed directory paths to the history file ~/.vim/.netrwhist. A directory name derived from the filesystem is interpolated into a single-quoted Vimscript string literal without escaping embedded single quotes, allowing a crafted directory name to break out of the string context and execute arbitrary Vimscript, including shell commands via system() and :!, the next time the history file is sourced. This issue has been patched in version 9.2.0495.

Affected Software

1 affected component
julia/vim_jll*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 9.2.0495

Event History

Dec 2, 2026
Advisory Published
via OSV·02:32 PM
Data Sourced
via OSV·02:32 PM
DescriptionSeverityAffected Software

Child vulnerabilities

Contains the following vulnerabilities.

Frequently Asked Questions

1

What must an attacker do to trigger this issue?

An attacker needs to cause a user to browse a filesystem directory whose name contains a crafted single quote. The malicious Vimscript is executed later when Vim sources the netrw history file, so user interaction is required.

2

Who is exposed?

Users of Vim versions before 9.2.0495 who use the netrw plugin and browse attacker-controlled or otherwise untrusted directory names are exposed. The vulnerable history file is ~/.vim/.netrwhist.

3

What can happen if exploitation succeeds?

The crafted directory name can inject arbitrary Vimscript into the history file. This can include execution of shell commands through system() or :! when the history file is sourced.

4

What should be done if updating is not immediately possible?

Avoid browsing untrusted directory trees with netrw, particularly locations where another party can create directory names. Removing the affected ~/.vim/.netrwhist file prevents previously serialized malicious entries from being sourced, but it does not prevent new entries from being written.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203