ruby-git has potential remote code execution vulnerability
High severity
GitHub Reviewed
Published
Jan 9, 2023
to the GitHub Advisory Database
•
Updated Feb 1, 2023
Description
Published to the GitHub Advisory Database
Jan 9, 2023
Reviewed
Jan 9, 2023
Published by the National Vulnerability Database
Jan 17, 2023
Last updated
Feb 1, 2023
The git gem, between versions 1.2.0 and 1.12.0, incorrectly parsed the output of the
git ls-files
command usingeval()
to unescape quoted file names. If a file name was added to the git repository contained special characters, such as\n
, then thegit ls-files
command would print the file name in quotes and escape any special characters. If theGit#ls_files
method encountered a quoted file name it would useeval()
to unquote and unescape any special characters, leading to potential remote code execution. Version 1.13.0 of the git gem was released which correctly parses any quoted file names.References