The vulnerability allows an authenticated user with workflow permissions to achieve remote code execution. This is done by chaining the 'Read/Write Files from Disk' node with git operations. The root cause of the vulnerability is the ability to write files into sensitive locations, specifically within .git directories.
The provided patches address this issue by introducing a file path blocking mechanism based on regular expressions. The main change is in the packages/core/src/execution-engine/node-execution-context/utils/file-system-helper-functions.ts file.
A new function, isFilePatternBlocked, is introduced, which checks a given file path against a list of configurable regex patterns. By default, this is configured to block access to .git directories.
The core of the vulnerability lies in the isFilePathBlocked function, which was modified to incorporate this new check. Before the patch, isFilePathBlocked did not have this capability, thus permitting file write operations into .git directories. Any file operation function, such as writeFile used by the 'Read/Write Files from Disk' node, would call isFilePathBlocked. An attacker could specify a path to a git hook (e.g., .git/hooks/pre-commit), and isFilePathBlocked would incorrectly approve it, leading to the file being written and subsequent code execution when a git operation is triggered.