Описание
GitProxy Hidden Commits Injection
Summary
An attacker can inject extra commits into the pack sent to GitHub, commits that aren’t pointed to by any branch. Although these “hidden” commits never show up in the repository’s visible history, GitHub still serves them at their direct commit URLs. This lets an attacker exfiltrate sensitive data without ever leaving a trace in the branch view. We rate this a High‑impact vulnerability because it completely compromises repository confidentiality.
Details
The proxy currently trusts only the ref‑update line (oldOid → newOid) and doesn't inspect the packfile’s contents
Because the code only runs git rev-list oldOid..newOid to compute introducedCommits but never checks which commits actually arrived in the pack, a malicious client can append extra commits. Those “hidden” commits won’t be pointed to by any branch but GitHub still stores and serves them by SHA.
PoC
Prerequisites
- A GitHub Personal Access Token stored in
~/.github-test-pat. - A test repository also registered in git-proxy, e.g.
your-org/test-repo.git, to which you have push rights.
1. Prepare the “visible” and “hidden” commits
2. Push only the visible commit to branch foo
3. Build and push a pack containing the hidden commit
Create a script named upload-pack.sh (replace the placeholder variables with the SHAs you recorded above):
Make it executable:
Run it:
4. Verify the hidden commit
Open in your browser (or via curl):
You will see the “Hidden commit”, even though it is not referenced by any branch.
Impact
-
Data Exfiltration (Confidentiality breach):
Attackers can inject secrets, credentials, or proprietary data into any repository they push to via git-proxy. -
Undetectable in UI:
Since the hidden commits never appear in branch graphs, standard code review will not surface them. -
Persistence Window:
GitHub retains unreferenced objects for a period long enough to allow automated retrieval before garbage‑collecting them.
Ссылки
- https://github.com/finos/git-proxy/security/advisories/GHSA-v98g-8rqx-g93g
- https://nvd.nist.gov/vuln/detail/CVE-2025-54586
- https://github.com/finos/git-proxy/commit/9c1449f4ec37d2d1f3edf4328bc3757e8dba2110
- https://github.com/finos/git-proxy/commit/a620a2f33c39c78e01783a274580bf822af3cc3a
- https://github.com/finos/git-proxy/releases/tag/v1.19.2
Пакеты
@finos/git-proxy
<= 1.19.1
1.19.2
Связанные уязвимости
GitProxy is an application that stands between developers and a Git remote endpoint. In versions 1.19.1 and below, attackers can inject extra commits into the pack sent to GitHub, commits that aren’t pointed to by any branch. Although these “hidden” commits never show up in the repository’s visible history, GitHub still serves them at their direct commit URLs. This lets an attacker exfiltrate sensitive data without ever leaving a trace in the branch view. We rate this a High‑impact vulnerability because it completely compromises repository confidentiality. This is fixed in version 1.19.2.