ruby-git has potential remote code execution vulnerability
High severity
GitHub Reviewed
Published
Jan 9, 2023
to the GitHub Advisory Database
•
Updated Apr 4, 2025
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
Apr 4, 2025
The git gem, between versions 1.2.0 and 1.12.0, incorrectly parsed the output of the
git ls-filescommand 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-filescommand would print the file name in quotes and escape any special characters. If theGit#ls_filesmethod 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