Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The previous code used double quotes to surround paths, which still allows environment variables and shell code to be evaluated by the shell. Hence, we use single quotes now, to avoid this problem. PoC exploit: #!/bin/sh -eux POC=$(mktemp -d) mkdir -p "$POC" cd "$POC" git init git config difftool.Word.cmd '/path/to/WordGit/diff.js "$LOCAL" "$REMOTE"' # Test case Gaelan#1 touch '`touch foo`.docx' git add ./*.docx test ! -e foo # Will fail if file 'foo' exists (sanity check) git difftool -t Word --cached test ! -e foo # Will fail if file 'foo' exists. Oops. git reset --hard # Test case Gaelan#2 touch "'"'`touch bar`.docx'"'" git add ./*.docx* test ! -e bar # Will fail if file 'bar' exists (sanity check) ls git difftool -t Word --cached test ! -e bar # Will fail if file 'bar' exists. Oops. git reset --hard # Cleanup #rm -rf "$POC" You need to change the path to WordGit. Then you can run it and test the exit code. If the exit code is 1, the exploit worked. If the exit code is 0 the exploit is fixed.
- Loading branch information