The popular open source self-hosted Git service Gogs is affected by a critical-severity zero-day vulnerability that exposes servers to remote code execution (RCE), Rapid7 reports.

The critical-severity issue, assigned a CVSS score of 9.4, is an argument injection flaw that can be exploited by authenticated attackers via pull requests with malicious branch names.

In a technical report, Rapid7 explains that the pull requests inject “the –exec flag into git rebase during the ‘Rebase before merging’ merge operation”, leading to command execution with the privileges of the Gogs server process user.

“A standard merge creates a merge commit joining two branch histories. A rebase before merge replays the head branch’s commits on top of the base branch to produce a linear history,” Rapid7 explains.

While the ‘Rebase before merging’ operation is not enabled by default, any repository owner or administrator can enable it, and any registered user automatically becomes the owner of repositories they create.