The vulnerability is a git argument injection flaw within the Tekton Pipeline's git resolver. The root cause lies in the checkout function in pkg/resolution/resolver/git/repository.go, which passed a user-controlled revision parameter to a git fetch command without proper sanitization. Specifically, it failed to prevent the revision from being interpreted as a command-line flag.
Two other functions contributed to this vulnerability:
PopulateDefaultParams in pkg/resolution/resolver/git/resolver.go did not validate if the revision parameter started with a -, allowing malicious arguments to be passed through.
validateRepoURL in the same file allowed local filesystem paths as valid git repository URLs. This was critical for the exploit, as the injected --upload-pack command is executed on the local pod when the git remote is a local path.
An attacker could exploit this by crafting a ResolutionRequest with a revision parameter like --upload-pack=/path/to/binary and a url parameter pointing to a local path on the resolver pod. This would cause the git fetch command to execute the specified binary, leading to remote code execution with the permissions of the resolver pod. The patch addresses this by validating the revision parameter, disallowing local repository URLs, and adding a -- separator to git commands to strictly separate flags from positional arguments.