Back to skill

Security audit

Atomgit Curl

Security checks for vulnerabilities and agentic risk

Overview

This AtomGit automation skill matches its stated purpose, but it needs review because it uses persistent tokens and can change repositories while overstating its safety controls.

Install only if you are comfortable giving this skill an AtomGit token that can read or modify the repositories in that token's scope. Prefer a least-privilege token, avoid passing tokens on the command line or in URLs, review targets before using approve/merge/batch/collaborator commands, and be aware it may read AtomGit credentials from OpenClaw config files outside the workspace.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/atomgit.sh:121
Finding

AtomGit bearer token exposed through curl process arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/atomgit.sh:121, scripts/atomgit.sh:131, scripts/atomgit.sh:141, and scripts/atomgit.sh:151
Vulnerability Type: Credential exposure through process arguments
Risk Level: Medium

Vulnerable Code

bash
case "$method" in
    GET)
        result=$(curl $SAFE_CURL_OPTS -H "Authorization: Bearer $ATOMGIT_TOKEN" "$url" 2>/dev/null) || true
        ;;
    POST)
        result=$(curl $SAFE_CURL_OPTS -X POST -H "Authorization: Bearer $ATOMGIT_TOKEN" -H "Content-Type: application/json" -d "$data" "$url" 2>/dev/null) || true
        ;;
    PUT)
        result=$(curl $SAFE_CURL_OPTS -X PUT -H "Authorization: Bearer $ATOMGIT_TOKEN" -H "Content-Type: application/json" -d "$data" "$url" 2>/dev/null) || true
        ;;
    PATCH)
        result=$(curl $SAFE_CURL_OPTS -X PATCH -H "Authorization: Bearer $ATOMGIT_TOKEN" -H "Content-Type: application/json" -d "$data" "$url" 2>/dev/null) || true
        ;;
esac

Technical Analysis

The bearer token is expanded by the shell and passed to curl as part of its argument vector. During request execution, the complete authorization header may therefore be observable through process inspection facilities, monitoring agents, debugging tools, or command-line telemetry.

The comment stating that a local variable prevents command-line exposure is inaccurate. Shell variable scope does not affect whether an expanded value is placed in the child process's argument vector.

Exploitation requires local process-observation access or a monitoring service capable of recording process arguments. Operating-system restrictions may reduce exposure between different users, but processes and diagnostic tools operating under the same account commonly retain sufficient visibility.

Attack Path

  1. A victim configures a privileged ATOMGIT_TOKEN.
  2. The victim invokes any command that reaches api_request, such as `merge ...[truncated 886 chars]
Remediation
View remediation

Remediation Suggestions

  • Avoid placing authorization headers directly in command-line arguments.
  • Use a protected temporary curl configuration file with mode 0600, pass it through curl --config, and delete it with a reliable trap.
  • Alternatively, use an HTTP client library that accepts headers through in-process APIs rather than the process argument vector.
  • Ensure temporary credential material is created with umask 077 and is never written into the workspace or a shared directory.
  • Disable verbose request tracing around authenticated requests and review process-monitoring systems for argument collection.
  • Rotate any token that may already have been exposed and apply minimum necessary AtomGit scopes.

T09 · Insecure Skill Coding Practices

Note
Location
API-REFERENCE.md:17
Finding

API documentation recommends transmitting access tokens in URL query strings

Content
View full analysis

Vulnerability Details

File Location: API-REFERENCE.md:17-18
Vulnerability Type: Insecure credential transmission guidance
Risk Level: Low

Vulnerable Code

bash
# Method 3: URL parameter
curl "https://api.atomgit.com/api/v5/user?access_token=YOUR_TOKEN"

Technical Analysis

The documentation presents query-string authentication as an accepted method. Even when HTTPS protects the request in transit, URLs can be retained by shell history, reverse proxies, server access logs, observability platforms, debugging output, and endpoint monitoring products.

Unlike an authorization header, a query parameter is commonly treated as ordinary URL metadata and may be logged without credential redaction. Users following this example can consequently disclose long-lived AtomGit credentials.

Attack Path

  1. A user substitutes a real token into the documented command.
  2. The complete URL is retained in shell history or captured by URL-logging infrastructure.
  3. Another user, administrator, log consumer, or compromised monitoring account reads the recorded URL.
  4. The observer extracts the access_token value.
  5. The recovered token is replayed against the AtomGit API.

Impact Assessment

Successful exploitation grants access to the AtomGit permissions associated with the exposed token. This may include private repository access and repository-modifying operations.

The practical impact depends on where the URL is retained and who can access those records. The issue does not bypass AtomGit token scope restrictions.

Remediation
View remediation

Remediation Suggestions

  • Remove query-string authentication from all documentation.
  • Recommend only an Authorization: Bearer header or another officially supported header-based mechanism.
  • Add an explicit warning that credentials must not be placed in URLs.
  • Advise users who followed the existing example to remove affected shell-history entries and rotate the token.
  • Configure documentation examples to use placeholders that cannot be mistaken for production credentials.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/atomgit.sh:294
Finding

Unescaped user input permits JSON payload injection and request corruption

Content
View full analysis

Vulnerability Details

File Location: scripts/atomgit.sh:294-312, with additional affected sinks at lines 335, 347, and 363
Vulnerability Type: Improper construction of JSON from untrusted input
Risk Level: Medium

Vulnerable Code

bash
cmd_approve_pr() {
    check_token

    if ! validate_owner_or_repo "$1"; then
        echo -e "${RED}ERROR: Invalid Owner format${NC}"
        return 1
    fi
    if ! validate_owner_or_repo "$2"; then
        echo -e "${RED}ERROR: Invalid Repo format${NC}"
        return 1
    fi
    if ! validate_pr_number "$3"; then
        echo -e "${RED}ERROR: Invalid PR number${NC}"
        return 1
    fi

    api_request POST "/repos/$1/$2/pulls/$3/comments" "{\"body\":\"${4:-/lgtm}\"}" > /dev/null && echo -e "${GREEN}Approved${NC}"
}

Other affected payload construction includes:

bash
api_request PUT "/repos/$1/$2/pulls/$3/merge" "{\"merge_commit_message\":\"${4:-Merged}\"}"
bash
local result=$(api_request POST "/repos/$1/$2/issues" "{\"title\":\"$3\",\"body\":\"${4:-}\"}")
bash
local result=$(api_request POST "/repos/$1/$2/pulls" "{\"title\":\"$title\",\"body\":\"$body\",\"head\":\"$head\",\"base\":\"$base\"}")

Technical Analysis

User-provided titles, bodies, comments, branch names, and merge messages are inserted into JSON using string concatenation. The script does not JSON-encode quotation marks, backslashes, newlines, or control characters.

This is not shell command injection because the constructed data remains quoted when passed to curl. It is nevertheless JSON injection: crafted input can terminate the intended string and introduce additional properties or alter the structure of the authenticated API request.

For example, a crafted issue title such as:

text
Example","state":"closed

can produce a payload structurally resembling:

json
{"title":"Example","state":"closed","body
...[truncated 1265 chars]
Remediation
View remediation

Remediation Suggestions

  • Never construct JSON through shell string interpolation.
  • Use a real JSON encoder, for example:
bash
data=$(jq -n --arg body "${4:-/lgtm}" '{body: $body}')
api_request POST "/repos/$1/$2/pulls/$3/comments" "$data"
  • Apply the same approach to issue titles and bodies, PR titles and bodies, branch names, permissions, states, and merge messages.
  • Validate enumerated fields such as issue state, PR state, merge strategy, and collaborator permission against explicit allowlists.
  • Add tests covering quotation marks, backslashes, Unicode, multiline content, and control characters.
  • Reject invalid input before issuing a state-changing API request.

T05 · Unauthorized Access and Privilege Escalation

Note
Location
SKILL.md:9
Finding

Skill reads sensitive configuration outside its declared workspace-only file scope

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:9, scripts/atomgit.sh:73-80, and scripts/atomgit-check-ci.sh:7-32
Vulnerability Type: Undeclared access to sensitive configuration files
Risk Level: Low

Vulnerable Code

The Skill declares workspace-only file access:

yaml
metadata: {"clawdbot":{"emoji":"🔗","requires":{"bins":["curl","bash"],"env":["ATOMGIT_TOKEN"]},"os":["win32","linux","darwin"],"category":"development","license":"MIT","permissions":["network"],"security":{"sandbox":true,"networkAccess":true,"fileAccess":"workspace","inputValidation":true,"errorHandling":true,"tokenHandling":"secure","pathValidation":true,"rateLimiting":true,"commandInjection":false,"sslVerification":true,"evalUsage":false,"execUsage":false,"tempFileHandling":"secure","apiEndpointValidation":true}}}

The main script nevertheless reads outside the workspace:

bash
load_token() {
    local config_file="$HOME/.openclaw/openclaw.json"
    if [ -f "$config_file" ]; then
        local token=$(grep -o '"ATOMGIT_TOKEN"[[:space:]]*:[[:space:]]*"[^"]*"' "$config_file" 2>/dev/null | cut -d'"' -f4)
        if [ -n "$token" ]; then
            export ATOMGIT_TOKEN="$token"
            echo -e "${GRAY}Token loaded from openclaw.json${NC}"
            return 0
        fi
    fi
    return 1
}

The CI script searches additional host paths:

bash
local config_paths=(
    "$HOME/.openclaw/openclaw.json"
    "$USERPROFILE/.openclaw/openclaw.json"
)

config_paths+=("/mnt/c/Users/$win_user/.openclaw/openclaw.json")

Technical Analysis

The metadata states that file access is restricted to the workspace, but both executable scripts attempt to read OpenClaw configuration files from the user's home directory and, in WSL, mounted Windows user directories.

These files are outside the declared workspace and can contain sensitive Agent configuration. The current parsing logic extracts only ...[truncated 1240 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove automatic reads of ~/.openclaw/openclaw.json and require ATOMGIT_TOKEN through the declared environment-variable interface.
  • If configuration-file loading is required, explicitly declare the exact external path and permission in Skill metadata.
  • Request user consent before reading a persistent credential.
  • Do not search mounted Windows profiles or fallback user directories implicitly.
  • Keep credential access narrowly scoped and avoid exporting secrets to child processes that do not require them.
  • Align metadata claims with actual runtime behavior and add automated tests that enforce the declared file-access boundary.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (39)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code’s overall purpose does align with the declared description: it is an AtomGit Bash integration centered on repo, PR, issue, and collaborator operations via curl. So this is not a totally different or hidden-purpose script. However, the description materially overstates reliability and completeness. The most notable mismatch is the claim of 'full support' for the listed areas, while the implementation has clear gaps: api_request only handles GET/POST/PUT/PATCH, but remove-collaborator uses DELETE and therefore cannot work as advertised; the endpoint validator allows only limited path patterns and may reject valid endpoints such as /search/repositories and /users/.../repos, undermining advertised commands; help text mentions user-events but no such command exists; and the stated total of 36 commands does not match the visible implementation/help output consistently. There are no obvious undeclared malicious capabilities, but there is a meaningful description-versus-behavior mismatch because the declared completeness and command inventory are not accurately represented by the supplied code.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

The remove-collaborator path performs a destructive repository-permission action using positional parameters with no input validation, target verification, or confirmation, and the implementation is inconsistent with the dispatcher. In an agent/tooling context, this increases the chance that a malformed or unintended invocation could remove the wrong collaborator once the argument bug is corrected, causing unauthorized loss of access or workflow disruption.

Content

Scanner excerpt · scripts/atomgit.sh (reported line 455)May include surrounding context.

sh
cmd_remove_collaborator() {
    check_token
    api_request DELETE "/repos/$1/$2/collaborators/$4" > /dev/null && echo -e "${GREEN}Collaborator removed${NC}" || echo -e "${RED}Failed${NC}"
}

# 并行批量批准 PR (新增 v2.8.0)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation explicitly shows passing an access token in the URL query string, which can leak credentials through shell history, browser history, proxy logs, server logs, referrer headers, and shared terminal transcripts. Because this is an API reference for a curl/bash skill, readers are likely to copy the example directly, making accidental token exposure realistic.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

Unlike the other E1 findings, this example transmits the credential in the URL query string, which is prone to disclosure through logs, histories, and monitoring systems. In context, the external transmission is expected, but the chosen mechanism materially increases the risk of credential leakage.

Content

Scanner excerpt · API-REFERENCE.md (reported line 18)May include surrounding context.

curl -H "PRIVATE-TOKEN: YOUR_TOKEN" https://api.atomgit.com/api/v5/user

方式 3: URL 参数

curl "https://api.atomgit.com/api/v5/user?access_token=YOUR_TOKEN"

text

---

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 · API-REFERENCE.md (reported line 92)May include surrounding context.

获取用户信息

bash
curl -H "Authorization: Bearer TOKEN" \
  https://api.atomgit.com/api/v5/user

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The merge example performs a repository-changing action that may be difficult or impossible to fully undo, yet the reference presents it without any cautionary note or confirmation guidance. In an agent skill context, examples can be operationalized quickly, increasing the chance of accidental PR merges into the wrong repository or branch.

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 set a long-lived API token and then use commands that can approve, merge, and modify repositories, but it does not warn about token sensitivity, least-privilege scoping, shell history exposure, or the consequences of running privileged operations. In a skill that automates repository actions, this omission materially increases the chance of credential leakage or unintended destructive changes by users following the documentation verbatim.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

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.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill advertises state-changing operations like approve, merge, collaborator changes, and issue updates without emphasizing that they modify remote resources. In an agent-driven environment, insufficient warnings increase the chance of unintended destructive or permission-altering actions against live repositories.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The security metadata at L009 declares execUsage:false, and the security section at L040 says there is no command execution risk from not using eval/exec. However, L460 explicitly says OpenClaw integration requires invoking the script through exec, which contradicts the earlier safety claims about execution behavior. This is an intent/documentation contradiction rather than a mere omission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Examples for adding and removing collaborators normalize permission-changing actions without any confirmation, authorization, or impact warning. In practice, this can lead an agent or user to revoke access or grant repository permissions too casually on production repositories.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Approval and merge commands alter remote PR state and may trigger code integration, CI progression, or governance side effects. Documenting them as routine commands without a warning or confirmation pattern makes accidental high-impact repository changes more likely in automated use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation tells users to pass an access token directly as a command-line argument (login YOUR_TOKEN). Command-line arguments are commonly exposed through shell history, process listings, audit logs, and CI job logs, which can leak long-lived credentials to other local users or logging systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file documents approve-pr, batch-approve, and merge-pr, all of which can change review state or integrate code, but it does not warn users about their effect on repository state. For markdown files, SQP-2 covers omitted warnings for actions that may affect user data or system integrity, and these operations are impactful enough to merit disclosure.

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 · API-REFERENCE.md (reported line 4)May include surrounding context.

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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 · API-REFERENCE.md (reported line 12)May include surrounding context.

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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 · API-REFERENCE.md (reported line 15)May include surrounding context.

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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 · API-REFERENCE.md (reported line 93)May include surrounding context.

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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 · API-REFERENCE.md (reported line 99)May include surrounding context.

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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 · API-REFERENCE.md (reported line 105)May include surrounding context.

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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 · API-REFERENCE.md (reported line 113)May include surrounding context.

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

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

md
# AtomGit CI Check - 安全版
# 用途:解析 openeuler-ci-bot 的 HTML 评论,判断 CI 流水线状态

ATOMGIT_BASE_URL="https://api.atomgit.com/api/v5"

# 从 openclaw.json 读取 Token (自动检测路径)
load_token_from_config() {

Static analysis

No suspicious patterns detected.