How we exploited CodeRabbit from a simple PR to RCE and writ... #198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
CodeRabbit PR Reviewer RCE via Rubocop Extension Loading and Secret Exfiltration
Target and Executive Summary
Target: CodeRabbit, a GitHub/GitLab AI PR reviewer that runs external linters/SAST (e.g., Semgrep, Rubocop) against pull requests. Researchers turned a single malicious PR into RCE on production runners, exfiltrated sensitive environment variables (including the GitHub App private key), then used GitHub’s API to min...
🔧 Technical Details
Abusing repo-controlled static-analysis configs for code execution: When CI/services run external tools using repository-provided configs, pick a tool that supports dynamic code loading (e.g., Rubocop). Add
.rubocop.ymlwithrequire: ./ext.rband place malicious Ruby inext.rb. Ensure the PR includes language-appropriate files to trigger the tool. The service loads and executes your code during analysis.Exfiltrating runner...
🤖 Agent Actions
I analyzed the repository and existing GitHub Security content and found there was no concrete, technical guidance on:
These are the key techniques in the blog and they weren’t covered in HackTricks. I updated the most relevant existing page:
What I changed:
✅ Review Checklist
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.