Back to skill

Security audit

帮助其他OpenClaw实例通过GitHub仓库实现记忆同步

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent GitHub memory-sync purpose, but its implementation can expose GitHub tokens, run injected shell commands from user input, and upload broad workspace contents without enough safeguards.

Review carefully before installing. Use only a private repository you control, use a fine-grained low-scope token, assume workspace contents may be uploaded to GitHub, and do not run setup with untrusted repository URLs or tokens until command execution and credential handling are fixed.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (6)

T09 · Insecure Skill Coding Practices

Error
Location
index.js:52
Finding

OS Command Injection Through User-Controlled Repository URL and Token

Content
View full analysis
{ // 创建临时目录测试访问 const tempDir = path.join('/tmp', 'test_git_access_' + Date.now()); exec(`git clone ${repoUrl.replace('https://', `https://${token}@`)} ${tempDir}`, (error, stdout, stderr) => { if (error) { console.error('仓库访问验证失败:', error.message); resolve(false); } else { console.log('仓库访问验证成功'); // 清理临时目录 exec(`rm -rf ${tempDir}`); resolve(true); } }); }); } ``` ```javascript async setupGithubRepo(repoUrl) { const repoName = repoUrl.split('/').pop().replace('.git', ''); this.githubRepoPath = path.join(process.env.HOME || '.', 'Documents', 'GitHub', repoName); // 检查仓库是否已存在 if (!fs.existsSync(this.githubRepoPath)) { console.log(`克隆仓库到: ${this.githubRepoPath}`); await this.executeCommand(`git clone ${repoUrl} "${this.githubRepoPath}"`); } else { console.log(`仓库已存在,更新仓库: ${this.githubRepoPath}`); await this.executeCommand(`cd "${this.githubRepoPath}" && git pull origin main`); } } ``` ### Technical Analysis Both `repoUrl` and `token` originate from user input and are interpolated directly into strings passed to `child_process.exec()`. The `exec()` function invokes a system shell, so shell metacharacters embedded in either value are interpreted as command syntax rather than as literal Git arguments. Quoting only `this.githubRepoPath` does not protect the unquoted `repoUrl`. The token is also inserted into the URL without shell escaping. URL parsing with `split()` and `replace()` does not constitute input validation and does not prevent shell injection. ### Attack Path 1. An attacker persuades a user or automation system to configure the Skill with ...[truncated 986 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
index.js:52
Finding

GitHub Personal Access Token Exposure Through Process Arguments, Errors, and Temporary Files

Content
View full analysis
{ // 创建临时目录测试访问 const tempDir = path.join('/tmp', 'test_git_access_' + Date.now()); exec(`git clone ${repoUrl.replace('https://', `https://${token}@`)} ${tempDir}`, (error, stdout, stderr) => { if (error) { console.error('仓库访问验证失败:', error.message); resolve(false); } else { console.log('仓库访问验证成功'); // 清理临时目录 exec(`rm -rf ${tempDir}`); resolve(true); } }); }); } ``` ### Technical Analysis The GitHub personal access token is embedded directly into the Git clone URL and then placed in a shell command. Depending on the operating system, command arguments may be visible to other local processes or monitoring tools. Git and shell errors can also include the credential-bearing URL, and the code logs `error.message` without redaction. Cleanup occurs only after a successful clone. If cloning fails after creating temporary Git data, the temporary path is not removed. Additionally, cleanup is launched asynchronously and is neither awaited nor checked for failure. These behaviors can leave credential-bearing configuration or diagnostic artifacts on disk. The timestamp-based temporary directory name is also predictable and is created under the shared `/tmp` namespace rather than through a secure temporary-directory API. ### Attack Path 1. A user supplies a valid GitHub token during repository validation. 2. The Skill embeds the token into the command-line URL. 3. A local process observer, command logger, monitoring agent, or diagnostic facility captures the command arguments; alternatively, the clone fails and an error containing the URL is logged. 4. If partial ...[truncated 548 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
cli.js:10
Finding

GitHub Token Input Is Echoed Despite Being Presented as Hidden

Content
View full analysis
{ rl.question(question, (answer) => { resolve(answer); }); }); } ``` ```javascript const repoUrl = await prompt('请输入GitHub仓库URL: '); const token = await prompt('请输入GitHub Personal Access Token (输入将被隐藏): '); ``` ### Technical Analysis The command-line prompt states that the personal access token will be hidden, but the implementation uses standard `readline.question()`. This API does not suppress terminal echo. Consequently, the secret is displayed as it is entered. This discrepancy creates a false security expectation and increases the likelihood that users enter sensitive credentials in environments where the terminal is visible, recorded, streamed, or logged. ### Attack Path 1. A user runs the CLI `setup` command. 2. The CLI explicitly tells the user that token input will be hidden. 3. The user enters a GitHub personal access token. 4. Standard terminal echo displays the token in plaintext. 5. A nearby observer, screen recorder, terminal-sharing participant, or retained session recording captures the credential. ### Impact Assessment An exposed token can grant access to private repositories and any other GitHub operations authorized by its scopes. This issue does not grant operating-system privileges directly; its impact is bounded by the token's GitHub permissions and lifetime. ]]>
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
index.js:123
Finding

Overbroad OpenClaw Workspace Backup Can Exfiltrate Sensitive Data to an Arbitrary Git Repository

Content
View full analysis
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
index.js:101
Finding

Unvalidated Remote Repository Content Is Imported Into Persistent Agent Workspace

Content
View full analysis
/dev/null | head -1) if [ -n "\$LATEST_REMOTE_BACKUP" ] && [ "\$LATEST_REMOTE_BACKUP" != "" ]; then echo "发现远程更新,正在合并..." # 备份当前本地更改 cp -r "\$LOCAL_WORKSPACE_DIR" "\$LOCAL_WORKSPACE_DIR/backup_pre_remote_\$(date +%Y%m%d_%H%M%S)" # 合并远程更改(保留本地特有文件) rsync -av --ignore-existing "\$LATEST_REMOTE_BACKUP"/. "\$LOCAL_WORKSPACE_DIR/" fi fi ``` ### Technical Analysis The synchronization script pulls repository content and copies files from the latest remote backup directly into the active OpenClaw workspace. It does not authenticate trusted commit authors, validate file types or paths, scan imported content, or require user review. Although `--ignore-existing` avoids replacing existing files, it still permits arbitrary new files to be introduced. If OpenClaw treats files in this workspace as memory, context, configuration, or instructions, a malicious collaborator or compromised repository can plant persistent content that influences future Agent sessions. ### Attack Path 1. An attacker obtains write access to the synchronization repository, compromises a collaborator account, or controls the configured remote. 2. The attacker commits a new backup containing crafted memory, instruction, configuration, or context files. 3. The victim runs the generated bidirectional synchronization script. 4. `git pull origin main` retrieves the attacker's commit. 5. `rsync --ignore-existing` copies previously absent malicious files into the active OpenClaw workspace. 6. OpenClaw later loads or processes those files as persistent stat ...[truncated 486 chars]
Remediation
View remediation

other

Warning
Location
PUBLISH_VERIFICATION.md:28
Finding

Security Verification Document Incorrectly Claims That No Sensitive Information Is Transmitted

Content
View full analysis
Remediation
View remediation
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (28)

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 · RELEASE_NOTES.md (reported line 25)May include surrounding context.

md
### 使用方法
1. 运行 `setup_cross_device_sync()` 开始配置
2. 输入GitHub仓库URL和Personal Access Token
3. 系统自动创建同步脚本和配置
4. 使用 `sync_now()` 进行即时同步
5. 使用 `check_sync_status()` 检查同步状态

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 · RELEASE_NOTES.md (reported line 32)May include surrounding context.

md
### 使用方法
1. 运行 `setup_cross_device_sync()` 开始配置
2. 输入GitHub仓库URL和Personal Access Token
3. 系统自动创建同步脚本和配置
4. 使用 `sync_now()` 进行即时同步
5. 使用 `check_sync_status()` 检查同步状态

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 · RELEASE_NOTES.md (reported line 38)May include surrounding context.

md
### 使用方法
1. 运行 `setup_cross_device_sync()` 开始配置
2. 输入GitHub仓库URL和Personal Access Token
3. 系统自动创建同步脚本和配置
4. 使用 `sync_now()` 进行即时同步
5. 使用 `check_sync_status()` 检查同步状态

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 · cli.js (reported line 43)May include surrounding context.

js
### 使用方法
1. 运行 `setup_cross_device_sync()` 开始配置
2. 输入GitHub仓库URL和Personal Access Token
3. 系统自动创建同步脚本和配置
4. 使用 `sync_now()` 进行即时同步
5. 使用 `check_sync_status()` 检查同步状态

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The skill explicitly instructs users to provide a GitHub Personal Access Token to a synchronization setup flow, creating a credential exposure risk if the token is stored insecurely, logged, embedded in scripts, or granted excessive scopes. In this context, the skill manages bidirectional sync to a repository containing memory data, so compromise of the token could expose sensitive synced content and permit unauthorized repository access or tampering.

Content

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

md
## 安全注意事项

- 请确保GitHub仓库是私有的以保护敏感数据
- 妥善保管Personal Access Token
- 定期轮换访问令牌
- 检查同步日志以确保没有异常活动

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

The skill explicitly requests a GitHub Personal Access Token as an input parameter, creating a credential collection surface. In the context of a cross-device sync skill that connects to a remote GitHub repository, this is security-relevant because the token could be over-scoped, mishandled, logged, or exfiltrated by downstream implementation, enabling unauthorized repository access or broader account compromise.

Content

Scanner excerpt · config.json (reported line 19)May include surrounding context.

json
},
          "token": {
            "type": "string",
            "description": "GitHub Personal Access Token"
          }
        },
        "required": ["repoUrl", "token"]

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill collects a GitHub Personal Access Token and embeds it directly into a git clone command line (https://TOKEN@...). Command-line secrets can leak through process listings, shell history, logs, crash reports, or child-process diagnostics, exposing repository credentials to other local users or monitoring tools. In this context, the token is used for repository access, so compromise could allow unauthorized read/write access to the user's remote backups.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill explicitly requests a GitHub Personal Access Token from the user, which is a sensitive credential. In combination with the later command-line use and lack of secure storage/handling guarantees, this creates real credential exposure risk and could lead to unauthorized repository access if the token is leaked or mishandled.

Content

Scanner excerpt · index.js (reported line 27)May include surrounding context.

js
// 获取用户输入
    const repoUrl = await this.promptUser('请输入GitHub仓库URL: ');
    const token = await this.promptUser('请输入GitHub Personal Access Token: ', true);
    
    // 验证仓库访问
    if (!(await this.validateRepoAccess(repoUrl, token))) {

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The generated sync scripts perform wide-ranging file synchronization, deletion/cleanup, git add/commit, and remote push operations against user data without a strong confirmation or safety interlocks. Because they use recursive copy and deletion behavior across workspace and backup paths, mistakes in path selection, unexpected repository contents, or script misuse could cause data loss, unintended overwrites, or propagation of sensitive files to the remote repository.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instructions tell users to place an API token in an environment variable but provide no warning about secure handling, token scope, shell history exposure, CI log leakage, or using a least-privileged credential. In a publishing workflow, this can lead to accidental credential disclosure or misuse, especially if users copy these commands into shared terminals, scripts, or automation environments.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The README advertises automatic creation of scripts, repository access configuration, bidirectional sync, conflict handling, and scheduled synchronization without warning that the skill will modify user files and potentially system configuration. This lack of transparency is dangerous because users may authorize changes that affect startup tasks, cron jobs, git settings, or local data integrity without understanding the scope or rollback path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README instructs users to enter a GitHub personal access token during setup but provides no guidance on secure handling, storage, or scope limitation of that credential. In a skill that auto-generates scripts and configuration, this omission increases the risk that the token may be over-scoped, exposed in plaintext, persisted insecurely, or reused unsafely, leading to repository compromise.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The release notes instruct users to run npx clawhub install cross-device-sync without pinning a specific package version. This allows execution of whatever version is currently published at install time, increasing supply-chain risk if the package is updated maliciously, compromised, or changed incompatibly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file presents all user-facing instructions and operational guidance in Chinese, but does not indicate that the skill is region-specific or offer an alternative language option. This can violate language/locale policy when users are not given a choice or opt-in to a specific language.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The installation command uses npx clawhub without pinning an exact package version, which allows whatever version is latest at execution time to run. If the package is compromised, updated maliciously, or a dependency is hijacked, users could execute unreviewed code during installation of a skill that also handles repository access and synchronization.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The CLI asks for a GitHub Personal Access Token while explicitly claiming the input will be hidden, but it uses standard readline input that echoes characters to the terminal. This can expose the token to shoulder-surfing, screen recording, terminal logging, or captured session transcripts, making credential compromise more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code requests a sensitive GitHub token without effective protection and misleads the user into believing the input is concealed. In a CLI setup flow for cross-device sync, this increases the chance that highly privileged credentials are exposed during onboarding, especially in shared or recorded terminal environments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill's natural-language strings and prompts are written in Chinese, and there is no indication that the user can choose another language or locale. This creates a language policy concern because the skill appears to impose a specific language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated config document lists ./download_from_github.sh as an available command, but createSyncScripts() only writes bidirectional_sync.sh and upload_to_github.sh. This is an active contradiction between the skill's documentation and the actual implemented behavior, which can mislead users about available sync operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The natural-language instructions and usage details are presented exclusively in Chinese. Under the language policy, forcing a single language without user opt-in or justification can be a policy concern when no alternative language option or scope limitation is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill-facing documentation is presented in Chinese, including installation and usage instructions, with no indication that users can choose another language. The policy explicitly calls for flagging language or locale constraints when they are imposed without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description is written only in Chinese, which indicates a language-specific presentation without any visible opt-in, alternative locale, or justification that the skill is intended only for Chinese-speaking users. This can violate language/locale policy expectations when skills are meant for broader audiences.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

User-facing strings throughout the CLI are presented only in Chinese, including usage, prompts, status messages, and errors. This imposes a specific language without offering opt-in, selection, or documentation that the skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
index.js:57