Back to skill

Security audit

Fork Manager

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent fork-management skill, but it grants high-impact automation over Git branches and permits configurable post-sync commands that users should review carefully.

Install only for repositories where you are comfortable giving an agent authority to fetch, rebase, merge, push, rewrite branches with --force-with-lease, and use your GitHub CLI credentials. Review each repo config before use, avoid enabling persistent autoResolveConflicts unless you accept automatic branch rewrites, and do not use postSyncHooks from untrusted configs.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:747
Finding
Unrestricted Execution of Repository-Defined Post-Sync Hooks<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 747-752 **Vulnerability Type**: Arbitrary command execution through unvalidated configuration **Risk Level**: High ### Vulnerable Code Snippet ```markdown 3. **`post-sync hooks`** *(optional, repo-specific)* - Run custom post-sync actions - Skip if `OLD_SHA == NEW_SHA` (no upstream changes) - Hooks are defined per-repo in `config.json` under `"postSyncHooks"` (array of shell commands or descriptions) - Example: detect CHANGELOG changes, update downstream skills, trigger CI - If no hooks configured: skip this step entirely ``` ### Technical Analysis The `full-sync` workflow directs the agent to run commands obtained from the repository-specific `postSyncHooks` configuration. These hooks are described as an array of either shell commands or descriptions, but the Skill does not define: - A schema that distinguishes executable commands from descriptive text. - An allowlist of permitted commands or arguments. - Validation for shell metacharacters, command substitution, redirects, or pipelines. - A repository or configuration trust check. - A mandatory command preview and explicit user approval. - Filesystem, credential, environment-variable, or network isolation for hook execution. As a result, configuration data crosses directly into an execution channel. If an attacker can create or modify the selected `config.json`, the next `full-sync` operation can cause the agent to execute attacker-controlled commands with the same operating-system privileges and tool credentials as the agent process. Although the versioned example configurations do not contain malicious hooks, the documented execution model itself is unsafe because local configurations are mutable inputs and may be copied from untrusted sources. ### Attack Path 1. An attacker supplies a repository configuration or modifies an existing local `repos/<name>/config.json`. 2. The attacker adds a malicious command to `post ...[truncated 1303 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove support for arbitrary shell strings in `postSyncHooks`. 2. Replace hooks with structured, allowlisted actions, for example: ```json { "postSyncHooks": [ { "action": "trigger-ci", "workflow": "downstream-check.yml" } ] } ``` 3. Implement each supported action with fixed executables and argument arrays rather than a shell interpreter. 4. Validate every configuration field against a strict schema and reject unknown actions or properties. 5. Require an explicit per-run user confirmation showing the exact executable, arguments, target repository, and expected effects. 6. Treat configurations outside the Skill's trusted local directory, configurations stored in managed repositories, and newly modified configurations as untrusted. 7. If custom commands must remain supported: - Disable them in cron and unattended modes. - Never invoke them using `sh -c`, `bash -c`, `eval`, or equivalent shell parsing. - Reject redirections, pipelines, command substitutions, control operators, and environment assignments. - Run them in a restricted subprocess with a minimal environment, bounded working directory, timeout, and no unnecessary credentials. - Block network access unless the specific approved action requires it. 8. Log the approved hook definition, executable, arguments, exit status, and affected files without recording secrets. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:533
Finding
Semantic AI Conflict Resolutions Are Force-Pushed Before Human Review<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 533-590 **Vulnerability Type**: Unsafe autonomous code modification and publication **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ### `resolve-conflicts` - Resolução automática de conflitos via subagentes > **Requer `--auto-resolve` na invocação OU `autoResolveConflicts: true` no config do repo.** Se nenhum dos dois, este comando não é executado e conflitos são apenas reportados com a nota "⚠️ Conflitos requerem aval do desenvolvedor." Após `rebase-all` detectar conflitos, o **orchestrator** (agente principal) spawna subagentes individuais para tentar resolver cada conflito automaticamente. #### Fluxo 1. O worker do `rebase-all` retorna a lista de branches com conflito 2. O orchestrator agrupa os conflitos e spawna **até 5 subagentes simultâneos** (model: Opus) 3. Conforme subagentes terminam, novos são lançados até esgotar a fila 4. Cada subagente tem **timeout de 10 minutos** 5. Resultados são coletados e integrados no relatório final #### Prompt do subagente resolver Cada subagente recebe: ``` Resolve o conflito de rebase da branch <branch> (PR #<number>) no repo <localPath>. ## Contexto - Upstream: <upstreamRemote>/<mainBranch> - Branch do PR: <originRemote>/<branch> - Arquivos em conflito: <lista de arquivos do erro de rebase> ## Passos 1. cd <localPath> 2. git checkout -B <branch> <originRemote>/<branch> --no-track 3. git rebase <upstreamRemote>/<mainBranch> → O rebase vai parar com conflito 4. Para cada arquivo em conflito: a. Ler o arquivo com os marcadores de conflito (<<<<<<<, =======, >>>>>>>) b. Entender o que o upstream mudou (OURS) vs o que o PR mudou (THEIRS) c. Resolver preservando a intenção de ambos d. git add <arquivo> 5. git rebase --continue 6. Se houver mais conflitos em commits subsequentes, repetir 4-5 7. git push <originRemote> <branch> --force-with-lease ## Regras de resolução - **Arquivo deletado no upstream + modificado ...[truncated 4186 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prohibit direct pushes for all semantic conflict resolutions. 2. Write generated resolutions to a separate review branch, such as: ```text fork-manager/review/<original-branch>/<timestamp> ``` 3. Show the complete diff and require explicit human approval before updating the original PR branch. 4. Preserve a recovery reference to the original remote commit before any rebase or push. 5. Require repository-specific validation before approval: - Build and test execution. - Static analysis and linting. - Security-sensitive test suites. - Verification that no unexpected files changed. 6. Restrict unattended auto-resolution to narrowly defined mechanical cases such as whitespace-only conflicts. Imports, deleted files, and formatting changes should still be validated because they can affect behavior. 7. Treat conflicts in authentication, authorization, cryptography, dependency manifests, CI workflows, deployment files, and secret-handling code as automatically unresolvable. 8. Disable semantic resolution in cron mode. 9. Require branch protection or an equivalent review policy for the production aggregation branch. 10. Report generated changes before publication rather than marking them for review only after a force-push. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
git fetch <upstreamRemote>
git checkout <mainBranch>
git merge <upstreamRemote>/<mainBranch>
git push <originRemote> <mainBranch>
```

### `rebase <branch>` - Rebase de uma branch específica
Confidence
70% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
done

# Push
git push <originRemote> <productionBranch> --force-with-lease

# Restaurar arquivos não-commitados
if [ "$STASHED" = "1" ]; then
Confidence
70% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- **Git operations**: fetch, checkout, merge, rebase, push across multiple remotes and branches
- **GitHub CLI**: reads PR status, creates PRs, queries repo metadata
**Before using this skill on a repository:**
- All git push operations use `--force-with-lease` (not `--force`) to prevent data loss
- The skill always stashes uncommitted files before destructive branch operations

These capabilities are inherent to fork management and cannot be removed without breaking core functionality.
Confidence
70% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Session Persistence

Medium
Category
Rogue Agent
Content
# 1. Clone the repository
git clone https://github.com/Glucksberg/fork-manager-skill.git /path/to/fork-manager

# 2. Create local configs from examples
cd /path/to/fork-manager
cp repos/<project>/config.example.json repos/<project>/config.json
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The README advertises broad natural-language triggers like "Use fork-manager to do a full-sync of my-project" and "Check the status of my fork," which are likely to overlap with ordinary user requests in agent environments that auto-dispatch skills. Because this skill performs high-impact git and GitHub operations, accidental invocation could cause unintended syncs, rebases, branch changes, or downstream automation, especially given the documented conflict-resolution subagent behavior in the skill metadata.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The file switches into imperative policy text in Portuguese at L029 ('A skill NUNCA deve ser executada inline...') and continues with substantial user-facing operational guidance in Portuguese across multiple sections. There is no opt-in, language choice, or stated regional justification, so this creates a language/locale policy issue for users who do not read Portuguese.

Context-Inappropriate Capability

Medium
Confidence
97% confidence
Finding
The skill explicitly allows repo-specific post-sync hooks defined in config as shell commands, which expands behavior from fork management into arbitrary command execution. Because the commands are sourced from per-repo configuration and run after sync, a malicious or compromised config can execute attacker-controlled code with the agent's filesystem and network privileges.

Description-Behavior Mismatch

Low
Confidence
97% confidence
Finding
The manifest metadata at L004 declares required binaries `git` and `gh`, but the skill documentation repeatedly instructs use of `node` for `scripts/update-config.mjs` and `jq` for PR-audit processing. That creates a description/behavior mismatch because the declared runtime requirements understate what the skill actually needs to execute as written.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/update-config.mjs:52