An arbitrary file write vulnerability exists in OpenProject’s repository changes endpoint (/projects/:project_id/repository/changes) when rendering the “latest changes” view via git log.
By supplying a specially crafted rev value (for example, rev=--output=/tmp/poc.txt), an attacker can inject git log command-line options. When OpenProject executes the SCM command, Git interprets the attacker-controlled rev as an option and writes the output to an attacker-chosen path.
As a result, any user with the :browse_repository permission on the project can create or overwrite arbitrary files that the OpenProject process user is permitted to write. The written contents consist of git log output, but by crafting custom commits the attacker can still upload valid shell scripts, ultimately leading to RCE. The RCE lets the attacker create a reverse shell to the target host and view confidential files outside of OpenProject, such as /etc/passwd.
Credits
This vulnerability was reported by user sam91281 as part of the YesWeHack.com OpenProject Bug Bounty program, sponsored by the European Commission.
An arbitrary file write vulnerability exists in OpenProject’s repository changes endpoint (
/projects/:project_id/repository/changes) when rendering the “latest changes” view viagit log.By supplying a specially crafted
revvalue (for example,rev=--output=/tmp/poc.txt), an attacker can injectgit logcommand-line options. When OpenProject executes the SCM command, Git interprets the attacker-controlledrevas an option and writes the output to an attacker-chosen path.As a result, any user with the
:browse_repositorypermission on the project can create or overwrite arbitrary files that the OpenProject process user is permitted to write. The written contents consist ofgit logoutput, but by crafting custom commits the attacker can still upload valid shell scripts, ultimately leading to RCE. The RCE lets the attacker create a reverse shell to the target host and view confidential files outside of OpenProject, such as/etc/passwd.Credits
This vulnerability was reported by user sam91281 as part of the YesWeHack.com OpenProject Bug Bounty program, sponsored by the European Commission.