Authenticated RCE via Argument Injection in Gogs Rebase Merg...#299
Open
carlospolop wants to merge 1 commit into
Open
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://www.rapid7.com/blog/post/ve-authenticated-rce-via-argument-injection-gogs-unfixed Content Categories: Based on the analysis, this content was categorized under "Pentesting CI/CD > Gogs Security > Authenticated RCE via Git rebase argument injection". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Rapid7 Labs disclosed an unfixed critical authenticated remote code execution vulnerability in Gogs, a self-hosted Git service written in Go. The bug is a CWE-88 argument injection issue in the pull request merge flow when the repository option
Rebase before mergingis enabled. Rapid7 rates it as CVSSv4 9.4 Critical. At publication time, the vendor had not released a patch.Affected versions confirmed ...
🔧 Technical Details
Git option injection through branch names: if an application passes user-controlled Git refs directly to Git commands without
--or--end-of-options, a branch name beginning with--can be interpreted as a command-line option instead of data. Validation withgit rev-parse --verify <ref>is not enough, because an attacker can first create a real ref named like an option, such as--exec=<payload>, making validation succeed while later unsafe command invocations parse the same value as an option.Abusing
git rebase --execfor RCE:git rebasesupports--exec=<cmd>, which runs the supplied command throughsh -cafter replaying commits. If an attacker-controlled base branch is passed asgit rebase --quiet <baseBranch> <headBranch>, a branch named--exec=touch${IFS}/tmp/rce_proof...🤖 Agent Actions
Done.
Updated:
src/pentesting-ci-cd/gogs-security/README.mdsrc/SUMMARY.mdWhat I added:
git rev-parse --verifyis insufficientgit rebase --execfor RCE${IFS}/ base64 payload shapingValidation:
SUMMARY.mdmdbook buildcould not be run becausemdbookis not installed in this environment (mdbook: command not found)This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.