Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

The gift that keeps giving: Exploiting Git Integrations in Cloud Services- 2083

nopnopPosted 18 Days Ago
  • git version control is supported on various cloud providers. Under the hood, it uses the git CLI or some wrapper around it. Because of this, the usage of files, and the features of git, there are a lot of ways to get RCE or exploit its integrations.
  • git config settings, git hooks, and bare repositories, all give RCE primitives if you can control data in these locations. Classic symlink attacks can also work too. They give a huge list of values that are useful for controlling.
  • In Google Clouds Looker, they were using raw git commands via bash. Because of how powerful git is, there is a large amount of parameters that can be useful for file writes, and RCE. In a Ruby wrapper called cli_git_command(), it tries to tries to remove all bad bash characters but allows = and -. This is perfect for argument injection! By using the parameter --pathspec-from-file= with a local secret, an error message would print a local secret token.
  • They have several directory traversal bugs in Looker that allowed for RCE. Some of them were second-order inputs, which was interesting to see. They used the various hooks, configs, and things to abuse these directory traversal's into RCE bugs.
  • In Google Dataform, they used a directory traversal with a symlink to bypass a blacklist on the .git folder. With JGit disables a lot of the RCE primitives, they decided to play with more symlinks via enabling this in the git settings. By enabling this feature, and creating a symlink in their repository it gave them cross-tenant access!
  • Recently, an escape of the Claude Code sandbox was found using git related techniques. By tricking Claude to create a worktree named .git, it created a confusion the repository this was executed in. They also used a symlink for this attack to reference $HOME to get outside of the directory. Because of this confusion, a classic git-based code execution outside the context of the current folder.
  • To prevent these bugs, use libraries instead of raw CLI commands. Most of the libraries don't execute hooks or config directives, killing RCE vectors. Secondly, sanitize your inputs. Third, restrict access to .git at all costs. Overall, a good posts with lots and tricks real bugs!