From: Bhavesh R Maheshwari <[email protected]> Pick the patch from [1], also referenced in the NVD report [2].
[1] https://github.com/vim/vim/commit/55bc757a5d436e59d50fe43f7cda94b118f86cb2 [2] https://nvd.nist.gov/vuln/detail/CVE-2026-55895 Signed-off-by: Bhavesh R Maheshwari <[email protected]> --- .../vim/files/CVE-2026-55895.patch | 106 ++++++++++++++++++ meta/recipes-support/vim/vim.inc | 1 + 2 files changed, 107 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..6bfb8ee124 --- /dev/null +++ b/meta/recipes-support/vim/files/CVE-2026-55895.patch @@ -0,0 +1,106 @@ +From 7c320315fab914a26bccfbbe6caf1a721897aa9c Mon Sep 17 00:00:00 2001 +From: Yasuhiro Matsumoto <[email protected]> +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 <[email protected]> +Signed-off-by: Christian Brabandt <[email protected]> + +Upstream-Status: Backport [https://github.com/vim/vim/commit/55bc757a5d436e59d50fe43f7cda94b118f86cb2] +CVE: CVE-2026-55895 + +Signed-off-by: Bhavesh R Maheshwari <[email protected]> +--- + .../pack/dist/opt/netrw/autoload/netrw.vim | 5 +++-- + src/testdir/test_plugin_netrw.vim | 20 +++++++++++++++++++ + src/version.c | 2 ++ + 3 files changed, 25 insertions(+), 2 deletions(-) + +diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim +index a04120d5f..d7eca30e4 100644 +--- a/runtime/pack/dist/opt/netrw/autoload/netrw.vim ++++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim +@@ -24,6 +24,7 @@ + " 2026 Mar 01 by Vim Project include portnumber in hostname checking #19533 + " 2026 Apr 01 by Vim Project use fnameescape() with netrw#FileUrlEdit() + " 2026 Apr 05 by Vim Project Fix netrw#RFC2396() #19913 ++" 2026 Jun 16 by Vim Project Fix filename escaping in local file deletion + " Copyright: Copyright (C) 2016 Charles E. Campbell {{{1 + " Permission is hereby granted to use and distribute this code, + " with or without modifications, provided that this copyright +@@ -3061,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 + +@@ -8770,7 +8771,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 cfce82f68..a0a3915f5 100644 +--- a/src/testdir/test_plugin_netrw.vim ++++ b/src/testdir/test_plugin_netrw.vim +@@ -674,4 +674,24 @@ func Test_netrw_injection() + endtry + 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 +diff --git a/src/version.c b/src/version.c +index e7f323854..16a8b140d 100644 +--- a/src/version.c ++++ b/src/version.c +@@ -736,6 +736,8 @@ static int included_patches[] = + { /* Add new patch number below this line */ + /**/ + 671, ++/**/ ++ 663, + /**/ + 653, + /**/ +-- +2.53.0 + diff --git a/meta/recipes-support/vim/vim.inc b/meta/recipes-support/vim/vim.inc index 4189817a8d..48edfc694f 100644 --- a/meta/recipes-support/vim/vim.inc +++ b/meta/recipes-support/vim/vim.inc @@ -30,6 +30,7 @@ SRC_URI = "git://github.com/vim/vim.git;branch=master;protocol=https;tag=v${PV} file://CVE-2026-55892.patch \ file://CVE-2026-57452.patch \ file://CVE-2026-55693.patch \ + file://CVE-2026-55895.patch \ " PV .= ".0340" -- 2.53.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#242480): https://lists.openembedded.org/g/openembedded-core/message/242480 Mute This Topic: https://lists.openembedded.org/mt/120546917/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
