# tj-actions/changed-files: tj-actions/changed-files: repointed tags shipped a memory scraper into public CI logs

> **Safety notice:** Read-only static audit script safe to run on any repository.

- **Incident date:** Mar 12–15, 2025
- **Disclosed:** Mar 15, 2025
- **Source disclosure:** https://github.com/advisories/GHSA-mrrh-fwg8-r2c3

## Reproduction lab
Audits a local repository’s GitHub Actions workflows for unpinned mutable tags and verifies Harden-Runner egress block policies in CI.

```bash
# find every mutable action tag in your repo
grep -rnE "uses:[[:space:]]+[^@]+@(v[0-9]|main|master)" .github/workflows/
```

## Policies and detection rules

### `ci-hardened.yml`
Pin every third-party GitHub Action to an immutable 40-character commit SHA and enforce outbound egress allowlisting with Harden-Runner. Stops steps 1 and 2.

```yaml
jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - name: Harden Runner egress
        uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.11.0
        with:
          egress-policy: block
          allowed-endpoints: >
            api.github.com:443
            registry.npmjs.org:443

      - name: Checkout (SHA-pinned)
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
```

### `find-unpinned-actions.sh`
Scan every workflow file for mutable @v* or branch references vulnerable to upstream tag overwrites.

```sh
# Flag any GitHub Action not pinned to a 40-hex commit SHA
grep -rnE "uses:[[:space:]]+[^@]+@(v[0-9]|main|master)" .github/workflows/ || \
  echo "All workflow actions are pinned to immutable SHAs."
```

## Indicators of compromise
- **commit:** `0e58ed8671d6b60d0890c21b07f8835ace038e67` (Malicious commit force-applied across v1 to v45.0.7 of tj-actions/changed-files.)
- **url:** `https://gist.githubusercontent.com/nikitastupin/30e525b776c409e03c2d6f328f254965/raw/memdump.py` (Secondary Python memory-scraping payload downloaded by the tampered action.)
