Back to skill

Security audit

Agent GitHub Workflow

Security checks for vulnerabilities and agentic risk

Overview

This GitHub skill is mostly coherent, but it asks for broad GitHub credentials and can make live account changes without clear built-in confirmation.

Review before installing. Use a fine-grained GitHub token restricted to selected repositories and only the permissions you need. Treat create_issue, create_repo, and create_pull_request as live GitHub writes, and verify the target repo, visibility, branches, and content before allowing the assistant to run them.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:49
Finding
Overprivileged GitHub Personal Access Token Requirement## Vulnerability Details **File Location**: `SKILL.md:49-54` **Additional Location**: `README.md:23-31` **Vulnerability Type**: Excessive credential privileges **Risk Level**: Medium **Vulnerable Code/Configuration Snippet**: ```markdown 1. Go to https://github.com/settings/tokens 2. Click "Generate new token (classic)" 3. Name: `openclaw-github-skill` 4. Scopes: `repo` (required), `read:user` (optional) 5. Copy the token ``` The README further describes the requested permission as follows: ```markdown 4. Scopes (permissions): - `repo` — Full control of private repositories - `public_repo` — Limited access to public repositories only - `read:user` — Read user profile data (optional) ``` ### Technical Analysis The setup instructions direct users to create a classic GitHub personal access token with the broad `repo` scope. That scope provides extensive control over all private repositories accessible to the user, while the Skill's declared operations are limited to reading repository information, reading commits and CI status, creating issues, creating repositories, and creating pull requests. The implementation automatically reads this token from `process.env.GITHUB_TOKEN` or `context.config.github.token` and attaches it to all GitHub API requests: ```javascript if (process.env.GITHUB_TOKEN) { headers['Authorization'] = `token ${process.env.GITHUB_TOKEN}`; return headers; } const config = context.config?.github || {}; if (config.token) { headers['Authorization'] = `token ${config.token}`; } ``` Requiring a classic `repo` token violates least-privilege principles because the credential authorizes repository operations beyond those exposed by the Skill. Although the audited implementation only sends the credential to the fixed official endpoint `https://api.github.com`, compromise of the Skill process, host environment, OpenClaw configuration, or a future malicious m ...[truncated 1513 chars]
Remediation
## Remediation Suggestions 1. Replace the recommendation for a classic PAT with a fine-grained GitHub PAT restricted to explicitly selected repositories. 2. Document the exact repository permissions required for each action, separating read permissions from write permissions. 3. Offer a read-only configuration for listing repositories, retrieving repository details, checking CI status, searching repositories, and viewing commits. 4. Require users to opt into separate write permissions for issue, repository, and pull-request creation. 5. Consider using separate credentials for repository creation because account-level repository creation may require authority distinct from access to existing repositories. 6. Require explicit user confirmation immediately before write operations. 7. Avoid placing long-lived tokens in broadly inherited process environments where feasible; use the platform's protected credential store. 8. Rotate existing classic PATs after migrating to restricted credentials. 9. Update both `SKILL.md` and `README.md` so the documented permission model consistently reflects least-privilege requirements.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (19)

Credential Access

High
Category
Privilege Escalation
Content
- OpenClaw gateway running
- Node.js 18+
- GitHub account with a Personal Access Token (PAT)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- OpenClaw gateway running
- Node.js 18+
- GitHub account with a Personal Access Token (PAT)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- OpenClaw gateway running
- Node.js 18+
- GitHub account with a Personal Access Token (PAT)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- OpenClaw gateway running
- Node.js 18+
- GitHub account with a Personal Access Token (PAT)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- OpenClaw gateway running
- Node.js 18+
- GitHub account with a Personal Access Token (PAT)

## Setup
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented description does not fully disclose all behaviors, while the detected functionality includes additional repository mutation and data access operations such as creating repositories and pull requests. This mismatch can mislead users and downstream systems about the skill's authority, causing it to be invoked in situations where more dangerous actions are possible than expected.

Session Persistence

Medium
Category
Rogue Agent
Content
- 📋 **List Repos** — View your repositories with filters
- 📊 **Get Repo Details** — Stars, forks, language, last updated
- 🔄 **Check CI Status** — Monitor CI/CD pipelines
- 📝 **Create Issues** — Open issues from conversation
- 📁 **Create Repos** — Create new repositories
- 🔍 **Search Repos** — Find repos by name/query
- 📊 **Recent Activity** — View recent commits
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.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill description prominently advertises 'Create Issues' and 'Create Repos', and the usage example shows issue creation occurring directly from conversation. The README includes token-handling advice, but it does not clearly warn users that these commands perform write operations against their GitHub account and may create or modify repository data.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill declares capabilities that require network access and use of environment/configured credentials, but it does not explicitly constrain tool scope via permissions or allowed-tools. That increases the chance of unintended tool invocation or overbroad access when the skill is activated, especially because it can perform state-changing GitHub actions.

Vague Triggers

Medium
Confidence
86% confidence
Finding
The invocation examples are broad and natural-language driven without clear activation boundaries, so the assistant may trigger the GitHub skill for vague requests like 'my main project' or 'the bug.' In a skill that has authenticated network access and write capabilities, ambiguous triggering raises the risk of acting on the wrong repository or performing unintended changes.

Session Persistence

Medium
Category
Rogue Agent
Content
You: Check CI status on my main project
Bot: [shows CI/CD status]

You: Create an issue about the bug
Bot: [creates the issue]
```
Confidence
74% confidence
Finding
The example flow suggests the assistant can carry context across turns and perform a mutating action ('Create an issue about the bug') without showing repository confirmation, issue content review, or user re-authorization. In a session-based assistant, that kind of context persistence can cause actions to be taken against the wrong target if earlier references are ambiguous or stale.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill metadata says it can query and manage repositories by listing repos, checking CI status, creating issues, searching repos, and viewing recent activity, but the API also exposes repository creation and pull request creation. This capability mismatch is dangerous because users or upstream policy engines may rely on the manifest description to understand allowed actions, causing underestimation of write-capable and potentially sensitive operations.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
The manifest describes managing GitHub repositories with examples like listing repos, checking CI status, creating issues, searching repos, and viewing recent activity. This file also exports repository creation and pull request creation capabilities, which are materially broader write operations not disclosed in the manifest description.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
This function sends a POST request to create a GitHub issue, which modifies repository state, but there is no confirmation prompt, user-facing log/print, or explanatory warning in the surrounding comments/docstring. Without disclosure, users may not realize the skill will publish content to a repository issue tracker.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This function performs a state-changing remote operation by creating a new GitHub repository via a POST request, but the file contains no confirmation prompt, user-facing log/print, or warning comment/docstring disclosing that effect. Because repository creation affects user account state and may create unintended public or private assets, this should be explicitly disclosed.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This function performs a state-changing POST request that opens a pull request on GitHub, but there is no visible confirmation, log/print, or warning comment explaining that remote repository state will be changed. Opening a PR can notify collaborators and alter workflow state, so an explicit disclosure is warranted.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This skill exposes state-changing GitHub actions such as creating issues, repositories, and pull requests directly in its action surface, but the declaration shows no built-in confirmation, approval gate, or explicit safety constraints before execution. In a conversational agent context, that increases the risk of prompt-induced or unintended writes to external systems, especially because GitHub operations can have lasting organizational impact.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The exported skill description says only 'Query and manage GitHub repositories', while the implemented actions include state-changing operations such as create_repo and create_pull_request. In an agent ecosystem, understated capability descriptions can mislead operators or downstream policy layers, increasing the chance that a user or orchestrator grants the skill broader authority than intended or invokes dangerous actions without understanding the write scope.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This file exposes GitHub write actions such as create_issue, create_repo, and create_pull_request directly through handlers with no visible confirmation, approval gate, or friction for high-impact operations. In a conversational agent context, that is dangerous because prompt injection, user misunderstanding, or ambiguous instructions could cause unintended changes to repositories, public disclosure via repo creation, or spammy/unauthorized issue and PR creation.

Static analysis

No suspicious patterns detected.