Back to skill

Security audit

Github Ops

Security checks for vulnerabilities and agentic risk

Overview

This GitHub automation skill is purpose-related but should be reviewed because it encourages fully automatic credentialed GitHub publishing with weak scoping and unsafe credential handling.

Install only in a controlled environment with a least-privilege, revocable GitHub token. Require explicit approval before creating public repositories, pushing commits, creating releases, or triggering deployment; use a dedicated checkout instead of the whole workspace and avoid storing tokens in Git remote URLs.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:62
Finding
GitHub Token Persisted in an Authenticated Git Remote URL## Vulnerability Details **File Location**: `SKILL.md`, line 62 **Vulnerability Type**: Credential exposure through an authenticated URL **Risk Level**: High ```bash git remote add origin https://${GITHUB_TOKEN}@github.com/username/repo.git ``` ### Technical Analysis The command expands `GITHUB_TOKEN` directly into the Git remote URL. Git normally stores this URL in the repository's `.git/config` file. The credential may also be captured by shell tracing, command logging, process inspection, diagnostic output, backups, or accidental disclosure of repository metadata. Although the destination is the legitimate GitHub domain rather than an attacker-controlled endpoint, persisting a bearer token in plaintext violates secure credential-handling practices. Anyone who obtains the expanded URL can authenticate with the permissions assigned to the token until it expires or is revoked. ### Attack Path 1. The Skill obtains `GITHUB_TOKEN` from the execution environment. 2. The shell expands the token inside the remote URL. 3. Git writes the expanded URL to `.git/config`. 4. A local user, diagnostic process, backup reader, log reader, or subsequent automated task obtains the stored URL. 5. The exposed token is extracted from the URL. 6. The token is reused through Git or the GitHub API to access resources authorized by its scopes. ### Impact Assessment Successful exploitation grants access equivalent to the compromised token. Depending on its scopes, this can include reading private repositories, pushing arbitrary commits, modifying releases, creating repositories, altering repository settings, or accessing organization resources. The impact is constrained by the token's permissions and any organization-level access controls.
Remediation
## Remediation Suggestions - Keep the Git remote URL free of credentials, for example: ```bash git remote add origin https://github.com/username/repo.git ``` - Authenticate through a secure Git credential helper, GitHub CLI, or an ephemeral `GIT_ASKPASS` implementation. - Prefer short-lived, narrowly scoped credentials over long-lived personal access tokens. - Disable shell tracing while credentials are in use and redact authenticated URLs from logs and diagnostics. - Inspect existing `.git/config` files and logs for exposed tokens. - Revoke and rotate any token that may already have been persisted.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:110
Finding
Indiscriminate Workspace Staging Can Publish Secrets and Unrelated Data## Vulnerability Details **File Location**: `SKILL.md`, lines 110-114 **Vulnerability Type**: Unrestricted file staging and unintended data disclosure **Risk Level**: High ```bash cd /home/node/.openclaw/workspace git add . git commit -m "Test commit" GITHUB_TOKEN=$(cat /home/node/.openclaw/secrets/github_token.txt) git push ``` ### Technical Analysis Running `git add .` at the root of the complete OpenClaw workspace recursively stages every unignored file. The procedure contains no path allowlist, staged-diff review, secret scan, repository-visibility check, or validation that all staged files belong to the requested operation. The Skill also documents repository creation with public visibility. Consequently, credentials, environment files, private configuration, agent state, generated artifacts, or unrelated user data present in the workspace can be committed and uploaded to a public repository. Removing a secret in a later commit would not eliminate it from Git history. ### Attack Path 1. A sensitive or unrelated file exists anywhere beneath `/home/node/.openclaw/workspace`. 2. The Skill changes to the workspace root and executes `git add .`. 3. The sensitive file is included in the Git index because it is not covered by an effective ignore rule. 4. The Skill commits the staged content without inspecting the staged diff. 5. `git push` uploads the commit to the configured GitHub repository. 6. An unauthorized party reads or clones the repository and extracts the sensitive file, including from Git history if it is later deleted. ### Impact Assessment This can disclose source code, API keys, access tokens, private configuration, personal information, internal documents, or unrelated project data. If credentials are exposed, the secondary impact can extend to every system those credentials authorize. Public repository publication permits unrestricted external access and cloning; private publication exposes the d ...[truncated 65 chars]
Remediation
## Remediation Suggestions - Stage only the files or directories explicitly requested by the user; do not run `git add .` at the workspace root. - Use a dedicated, isolated checkout containing only the intended repository contents. - Establish a restrictive `.gitignore` for credentials, environment files, agent state, caches, and generated artifacts. - Review `git diff --cached --name-only` and `git diff --cached` before committing. - Run a secret scanner over the working tree and staged changes before every commit. - Verify the destination repository owner, name, remote URL, and visibility before pushing. - Require explicit approval before the first push to a new repository or any public repository. - If sensitive data has already been pushed, revoke affected credentials and rewrite repository history rather than merely deleting the file in a later commit.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:88
Finding
Direct Fixed-Path Credential Retrieval Weakens Least-Privilege Controls## Vulnerability Details **File Location**: `SKILL.md`, line 88 **Vulnerability Type**: Direct access to a long-lived privileged credential **Risk Level**: Medium ```bash export GITHUB_TOKEN=$(cat /home/node/.openclaw/secrets/github_token.txt) ``` ### Technical Analysis The Skill instructs the executing agent to retrieve a GitHub credential directly from a predictable filesystem path and export it into the process environment. This bypasses a mediated secret-injection design in which the runtime supplies only the credential needed for an approved operation. Once exported, the token is available to the current shell and inherited child processes. The surrounding Skill behavior uses it for repository creation, pushes, and release management without documenting target restrictions or approval boundaries. This creates a broad authorization path if the Skill is invoked under manipulated, ambiguous, or mistaken instructions. The finding does not establish access beyond the token's configured GitHub permissions. The weakness is that the Skill directly retrieves and exposes a reusable credential instead of operating through a constrained authorization mechanism. ### Attack Path 1. An attacker influences a request, repository name, destination, or other task context processed by the agent. 2. The agent invokes the Skill and reads the token from the documented fixed path. 3. The token is exported to the shell and inherited by commands launched during the operation. 4. The Skill performs an authenticated GitHub operation without a target allowlist or explicit approval boundary. 5. GitHub resources are created, modified, or published using the token owner's authority. 6. If another child process or diagnostic mechanism can inspect the environment, the token may also be captured and reused. ### Impact Assessment The obtainable privileges are limited to the GitHub token's scopes and the account or organizations that accept it. Po ...[truncated 243 chars]
Remediation
## Remediation Suggestions - Do not let Skill instructions read reusable credentials directly from fixed filesystem paths. - Inject credentials through the runtime secret manager only after the requested operation and destination have been validated. - Use short-lived GitHub App installation tokens restricted to selected repositories and required permissions. - Separate permissions for repository creation, content pushes, and release management rather than using one broadly scoped token. - Validate the target account, organization, repository, branch, and visibility against an explicit allowlist. - Require user approval for public repository creation, first-time pushes, release publication, and operations outside previously approved repositories. - Prevent credentials from entering model-visible context, logs, command output, or inherited processes that do not require them. - Rotate the credential regularly and audit GitHub access logs for unexpected operations.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Missing User Warnings

High
Confidence
96% confidence
Finding
The top-level description advertises fully automatic GitHub operations without user intervention, but does not warn that these actions can create public repositories, push local content, and publish releases. Omitting warnings around destructive or privacy-impacting behavior makes it more likely that users or orchestrators invoke the skill without understanding its external side effects.

Natural-Language Policy Violations

Medium
Confidence
83% confidence
Finding
The top-level description is written as a Chinese-only operational description, and the file provides no indication that users can choose language or that the skill is intentionally limited to a Chinese-speaking context. This can constitute a locale/language policy issue when no opt-in or justification is given.

External Transmission

Medium
Category
Data Exfiltration
Content
### 1. 创建仓库
```bash
# 函数:create_repo
curl -X POST \
  -H "Authorization: token $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/user/repos \
Confidence
95% confidence
Finding
This command performs an authenticated POST to the GitHub API to create repositories, transmitting account-affecting data and credentials to an external service. In the context of a fully automated skill, this becomes dangerous because it enables outbound writes with potentially broad side effects and no described approval gate.

External Transmission

Medium
Category
Data Exfiltration
Content
curl -X POST \
  -H "Authorization: token $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/user/repos \
  -d '{"name":"repo-name","description":"描述","private":false}'
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
curl -X POST \
  -H "Authorization: token $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/user/repos \
  -d '{"name":"repo-name","description":"描述","private":false}'
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
curl -X POST \
  -H "Authorization: token $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/user/repos \
  -d '{"name":"repo-name","description":"描述","private":false}'
```
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The markdown openly describes stored GitHub credentials and automated remote operations but provides no accompanying safety guidance, approval boundary, or misuse warning. In practice, this encourages autonomous use of sensitive credentials for network actions without clarifying ownership, scope, or consent requirements.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The skill instructs the agent to read a locally stored GitHub token from a secrets file and use it for remote operations. Even if the token is intended for GitHub tasks, embedding secret-file access directly in skill instructions increases the chance of unauthorized use, token reuse across contexts, and accidental disclosure through logs, commands, or downstream tooling.

External Transmission

Medium
Category
Data Exfiltration
Content
GITHUB_TOKEN=$(cat /home/node/.openclaw/secrets/github_token.txt)
curl -s -X POST \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  https://api.github.com/user/repos \
  -d '{"name":"test-repo","private":false}' | jq '.name'
# 预期输出:"test-repo"
```
Confidence
94% confidence
Finding
The test case performs a real authenticated POST to create a repository using a token read from local storage. Live tests against production GitHub create opportunities for accidental resource creation, misuse of account privileges, and unreviewed external side effects.

External Transmission

Medium
Category
Data Exfiltration
Content
### 测试 3: 创建 Release
```bash
GITHUB_TOKEN=$(cat /home/node/.openclaw/secrets/github_token.txt)
curl -s -X POST \
  -H "Authorization: token ${GITHUB_TOKEN}" \
  https://api.github.com/repos/sandmark78/v61-docs/releases \
  -d '{"tag_name":"v1.0.0","name":"v1.0.0"}' | jq '.tag_name'
Confidence
95% confidence
Finding
This test command sends an authenticated request to create a GitHub release on an external repository. Because it is framed as a routine test, it normalizes live external mutations using stored credentials and could publish artifacts or tags unintentionally.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The skill is presented as a GitHub operations capability, but its documented workflow extends into Vercel deployment and returning a deployment URL. This is a scope expansion into additional remote actions and data flows that the description does not clearly declare, which can cause the agent to perform unintended external operations under the guise of a narrower GitHub task.

Skill Enumeration

Medium
Category
Agent Snooping
Content
---

*此技能已真实写入服务器*
*验证:cat /home/node/.openclaw/workspace/skills/github-ops/SKILL.md*
Confidence
88% confidence
Finding
The skill includes a concrete server-local path and a verification command showing where the skill is installed in the workspace. Exposing internal filesystem layout aids environment enumeration and can help an attacker craft follow-on attacks targeting local secrets, neighboring skills, or deployment-specific assumptions.

Static analysis

No suspicious patterns detected.