You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Security] MacVim affected by GHSA-hwg5-3cxw-wvvg — OS command injection via backticks in 'path' option completion (vim < 9.2.0435) #1659
MacVim's src/findfile.c and src/optiondefs.h allow backtick expressions in the 'path' option to be executed when file completion is triggered. Since 'path' can be set via modelines, an attacker can embed a malicious backtick command in a project file that executes when the victim uses file-path completion. The fix from vim 9.2.0435 (190cb3c2) has not been applied to macvim r183.
The 'path' option is not marked P_SECURE in src/optiondefs.h, so it can be set via modelines:
/* src/optiondefs.h line 2067 (macvim r183) */
{"path", "pa", P_STRING|P_EXPAND|P_VI_DEF|P_COMMA|P_NODUP,
Missing P_SECURE allows a modeline to set path+=\cmd`. In src/findfile.c, when file completion is performed for 'path'entries, backtick expressions are expanded via the shell — executingcmd`.
Attack Scenario
Attacker places a project file with a modeline:
// vim: set path+=`id>/tmp/pwned` :
Victim opens the file in MacVim with modeline support enabled (default)
MacVim sets path to include the backtick expression
When the victim presses Tab for :find completion, MacVim expands the backtick and executes id>/tmp/pwned
Activity