From: Vijay Anusuri <vanusuri@mvista.com>
To: openembedded-core@lists.openembedded.org
Cc: Vijay Anusuri <vanusuri@mvista.com>
Subject: [OE-core][wrynose][patch 02/10] vim: Fix CVE-2026-55895
Date: Wed, 22 Jul 2026 18:03:28 +0530 [thread overview]
Message-ID: <20260722123336.587556-2-vanusuri@mvista.com> (raw)
In-Reply-To: <20260722123336.587556-1-vanusuri@mvista.com>
Pick patch per [1].
[1] https://nvd.nist.gov/vuln/detail/CVE-2026-55895
[2] https://github.com/vim/vim/security/advisories/GHSA-vhh8-v6wx-hjjh
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
---
.../vim/files/CVE-2026-55895.patch | 83 +++++++++++++++++++
meta/recipes-support/vim/vim.inc | 1 +
2 files changed, 84 insertions(+)
create mode 100644 meta/recipes-support/vim/files/CVE-2026-55895.patch
diff --git a/meta/recipes-support/vim/files/CVE-2026-55895.patch b/meta/recipes-support/vim/files/CVE-2026-55895.patch
new file mode 100644
index 0000000000..cc335ea2a6
--- /dev/null
+++ b/meta/recipes-support/vim/files/CVE-2026-55895.patch
@@ -0,0 +1,83 @@
+From 55bc757a5d436e59d50fe43f7cda94b118f86cb2 Mon Sep 17 00:00:00 2001
+From: Yasuhiro Matsumoto <mattn.jp@gmail.com>
+Date: Tue, 16 Jun 2026 21:00:28 +0000
+Subject: [PATCH] patch 9.2.0663: [security]: runtime(netrw): code injection in
+ local file deletion
+
+Problem: [security]: s:NetrwLocalRmFile() escapes only the backslash in
+ the file name before passing it to :execute, so a name
+ containing "|" injects arbitrary Ex commands when the file is
+ deleted (cipher-creator)
+Solution: Use fnameescape() to correctly escape the file name
+ (Yasuhiro Matsumoto).
+
+Github Security Advisory:
+https://github.com/vim/vim/security/advisories/GHSA-vhh8-v6wx-hjjh
+
+Supported by AI
+
+Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
+Signed-off-by: Christian Brabandt <cb@256bit.org>
+
+Upstream-Status: Backport [https://github.com/vim/vim/commit/55bc757a5d436e59d50fe43f7cda94b118f86cb2]
+CVE: CVE-2026-55895
+Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
+---
+ .../pack/dist/opt/netrw/autoload/netrw.vim | 4 ++--
+ src/testdir/test_plugin_netrw.vim | 20 +++++++++++++++++++
+ 2 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim
+index 8e5fdb5397..ebb856800c 100644
+--- a/runtime/pack/dist/opt/netrw/autoload/netrw.vim
++++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim
+@@ -3062,7 +3062,7 @@ function s:NetrwBrowse(islocal,dirname)
+ elseif !a:islocal && dirname !~ '[\/]$' && dirname !~ '^"'
+ " s:NetrwBrowse : remote regular file handler {{{3
+ if bufname(dirname) != ""
+- exe "NetrwKeepj b ".bufname(dirname)
++ exe "NetrwKeepj b ".fnameescape(bufname(dirname))
+ else
+ " attempt transfer of remote regular file
+
+@@ -8772,7 +8772,7 @@ function s:NetrwLocalRmFile(path, fname, all)
+ call netrw#msg#Notify('ERROR', printf("unable to delete <%s>!", rmfile))
+ else
+ " Remove file only if there are no pending changes
+- execute printf('silent! bwipeout %s', rmfile)
++ execute printf('silent! bwipeout %s', fnameescape(rmfile))
+ endif
+
+ elseif dir && (all || empty(ok))
+diff --git a/src/testdir/test_plugin_netrw.vim b/src/testdir/test_plugin_netrw.vim
+index b234670928..4d5fc9a065 100644
+--- a/src/testdir/test_plugin_netrw.vim
++++ b/src/testdir/test_plugin_netrw.vim
+@@ -609,4 +609,24 @@ func Test_netrw_RFC2396()
+ call assert_equal('a b', netrw#RFC2396(fname))
+ endfunc
+
++" Deleting a file whose name contains an Ex command separator must not let the
++" name inject commands into the :execute in s:NetrwLocalRmFile().
++func Test_netrw_local_rm_injection()
++ CheckUnix
++ let dir = getcwd() . '/Xnetrwrm'
++ let fname = "x|let g:injected = 1"
++ call mkdir(dir, 'pR')
++ call writefile([], dir . '/' . fname)
++ try
++ call netrw#Call('NetrwLocalRmFile', dir, fname, 1)
++ call assert_false(exists('g:injected'), 'filename must not inject Ex commands')
++ " The file is removed before the sink, so its absence also confirms the
++ " vulnerable code path was actually exercised (not skipped on an error).
++ call assert_false(filereadable(dir . '/' . fname), 'crafted file must be deleted')
++ finally
++ call delete(dir . '/' . fname)
++ unlet! g:injected
++ endtry
++endfunc
++
+ " vim:ts=8 sts=2 sw=2 et
+--
+2.43.0
+
diff --git a/meta/recipes-support/vim/vim.inc b/meta/recipes-support/vim/vim.inc
index c0315dfed6..b9f6ef987c 100644
--- a/meta/recipes-support/vim/vim.inc
+++ b/meta/recipes-support/vim/vim.inc
@@ -24,6 +24,7 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https;tag=v${PV}
file://CVE-2026-52859.patch \
file://CVE-2026-52860.patch \
file://CVE-2026-55693.patch \
+ file://CVE-2026-55895.patch \
"
PV .= ".0340"
--
2.43.0
next prev parent reply other threads:[~2026-07-22 12:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 12:33 [OE-core][wrynose][patch 01/10] vim: Fix CVE-2026-55693 Vijay Anusuri
2026-07-22 12:33 ` Vijay Anusuri [this message]
2026-07-22 12:33 ` [OE-core][wrynose][patch 03/10] vim: Fix CVE-2026-57453 Vijay Anusuri
2026-07-26 21:45 ` Yoann Congal
2026-07-22 12:33 ` [OE-core][wrynose][patch 04/10] vim: Fix CVE-2026-57451 Vijay Anusuri
2026-07-26 21:53 ` Yoann Congal
2026-07-22 12:33 ` [OE-core][wrynose][patch 05/10] vim: Fix CVE-2026-57454 Vijay Anusuri
2026-07-26 22:05 ` Yoann Congal
2026-07-22 12:33 ` [OE-core][wrynose][patch 06/10] vim: Fix CVE-2026-57455 Vijay Anusuri
2026-07-22 12:33 ` [OE-core][wrynose][patch 07/10] vim: Fix CVE-2026-57456 Vijay Anusuri
2026-07-22 12:33 ` [OE-core][wrynose][patch 08/10] vim: Fix CVE-2026-59856 Vijay Anusuri
2026-07-22 12:33 ` [OE-core][wrynose][patch 09/10] vim: Fix CVE-2026-59857 Vijay Anusuri
2026-07-22 12:33 ` [OE-core][wrynose][patch 10/10] vim: Fix CVE-2026-59858 Vijay Anusuri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260722123336.587556-2-vanusuri@mvista.com \
--to=vanusuri@mvista.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox