Back to skill

Security audit

Atomgit Powershell

Security checks for vulnerabilities and agentic risk

Overview

This AtomGit skill is mostly a disclosed repository-management tool, but its batch PowerShell script can perform authenticated PR approvals just by being loaded.

Review this skill carefully before installing. Use only a least-privilege AtomGit token, avoid putting tokens in command lines or URLs, and do not dot-source the batch script unless it has been fixed so loading it cannot approve any PRs. Treat bulk approval and merge commands as live repository changes that may affect review integrity and automation.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/atomgit-batch.ps1.txt:14
Finding
Dot-Sourcing the Batch Script Automatically Approves Hard-Coded Pull Requests<![CDATA[ ## Vulnerability Details **File Location**: `scripts/atomgit-batch.ps1.txt:14-16` and `scripts/atomgit-batch.ps1.txt:366-368` **Vulnerability Type**: Unsafe top-level execution with destructive defaults **Risk Level**: High ### Vulnerable Code ```powershell [Parameter(Mandatory=$false)] [int[]]$PRs = @(2557, 2558, 2560), ``` ```powershell # If the script is run directly, execute the default operation if ($PRs.Count -gt 0) { Invoke-BatchApprove -Owner $Owner -Repo $Repo -PRs $PRs -Parallel:$Parallel.IsPresent -MaxConcurrency $MaxConcurrency } ``` The documented loading instructions explicitly tell users to dot-source the script: ```powershell . ~/.openclaw/workspace/skills/atomgit-powershell/scripts/atomgit-batch.ps1 ``` Relevant documentation locations include `SKILL.md:163-166`, `README.md:76-79`, and `commands.md:120-123`. ### Technical Analysis Dot-sourcing a PowerShell script executes all top-level statements in addition to importing its functions. The script assigns a non-empty default value to `$PRs` and unconditionally calls `Invoke-BatchApprove` whenever `$PRs.Count` is greater than zero. Consequently, the condition described by the comment as distinguishing direct execution does not actually distinguish direct execution from dot-sourcing. Loading the script according to its documentation immediately initiates authenticated write operations against the default repository and PR numbers. The invoked function posts `/lgtm` and `/approve` comments using the user's AtomGit bearer token. These are security-sensitive repository actions, not harmless initialization behavior. ### Attack Path 1. A user configures an `ATOMGIT_TOKEN` with permission to comment on or approve pull requests. 2. The user follows the documented instruction and dot-sources `atomgit-batch.ps1`. 3. PowerShell executes the script's top-level statements. 4. The default `$PRs` value contains PRs `2557`, `2558`, and `2560`. 5. The final condition evaluates to true and ...[truncated 761 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Change the default PR list to an empty array: ```powershell [int[]]$PRs = @() ``` 2. Remove all authenticated or state-changing operations from top-level script execution. Dot-sourcing should only define functions and constants. 3. If direct execution must be supported, implement a reliable direct-execution entry point rather than relying on `$PRs.Count`. 4. Require explicit PR identifiers for every invocation. 5. Add confirmation for approval operations using PowerShell's `SupportsShouldProcess` and `ShouldProcess`, with an explicit `-Confirm:$false` or `-Force` option only for intentional automation. 6. Add a dry-run mode that lists the repository, PRs, and operations before making requests. 7. Add tests verifying that dot-sourcing the script produces no network requests and no repository changes. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/atomgit-batch.ps1.txt:206
Finding
Parallel Batch Approval Bypasses Function-Level Input and Concurrency Validation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/atomgit-batch.ps1.txt:206-288` **Vulnerability Type**: Missing validation at an authenticated request boundary **Risk Level**: Medium ### Vulnerable Code ```powershell function Invoke-BatchApprove { param( [Parameter(Mandatory=$true)] [string]$Owner, [Parameter(Mandatory=$true)] [string]$Repo, [Parameter(Mandatory=$true)] [int[]]$PRs, [Parameter(Mandatory=$false)] [switch]$Parallel, [Parameter(Mandatory=$false)] [int]$MaxConcurrency = 3 ) Write-Host "`n🚀 AtomGit 批量 PR 处理工具 (并行优化版)" -ForegroundColor Cyan Write-Host "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`n" -ForegroundColor Gray Write-Host "📦 仓库:$Owner/$Repo" -ForegroundColor White Write-Host "🔀 PR 列表:$($PRs -join ', ')" -ForegroundColor White Write-Host "⚡ 模式:$(if ($Parallel) { '并行处理' } else { '串行处理' })" -ForegroundColor White $results = @() $startTime = Get-Date if ($Parallel) { $batchSize = [Math]::Ceiling($PRs.Count / $MaxConcurrency) $batches = @() for ($i = 0; $i -lt $PRs.Count; $i += $MaxConcurrency) { $end = [Math]::Min($i + $MaxConcurrency, $PRs.Count) $batches += $PRs[$i..($end - 1)] } foreach ($batch in $batches) { $jobs = @() foreach ($pr in $batch) { $job = Start-Job -ScriptBlock { param($owner, $repo, $pr, $token) $headers = @{ "Authorization" = "Bearer $token" } try { $lgtmBody = @{ body = "/lgtm" } | ConvertTo-Json $lgtmResponse = Invoke-RestMethod -Uri "https://api.atomgit.com/api/v5/repos/$owner/$repo/pulls/$pr/comments" ` -Headers $headers -Method Post -Body $lgtmBody -ContentType "appli ...[truncated 2857 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Apply declarative validation directly to the function parameters: ```powershell [ValidatePattern('^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$')] [string]$Owner [ValidatePattern('^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$')] [string]$Repo [ValidateRange(1, 2147483646)] [int[]]$PRs [ValidateRange(1, 10)] [int]$MaxConcurrency = 3 ``` 2. Repeat validation inside `Invoke-BatchApprove` before selecting either the serial or parallel branch. 3. Validate values again inside background jobs or pass only immutable, previously validated values. 4. Escape every URI path segment with an appropriate URI-encoding routine rather than relying only on interpolation. 5. Reject empty PR arrays and place a reasonable upper bound on the number of PRs in one batch. 6. Implement rate limiting, retry backoff, and cancellation handling for parallel requests. 7. Ensure the serial and parallel paths enforce identical security checks. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
API-REFERENCE.md:16
Finding
API Documentation Recommends Passing Access Tokens in URL Query Strings<![CDATA[ ## Vulnerability Details **File Location**: `API-REFERENCE.md:16-19` **Vulnerability Type**: Sensitive credential exposure through URL query parameters **Risk Level**: Medium ### Vulnerable Code ```bash # Method 3: URL parameter curl "https://api.atomgit.com/api/v5/user?access_token=YOUR_TOKEN" ``` ### Technical Analysis The documentation presents an access token in a URL query parameter as a supported authentication method. URL query strings are commonly retained in locations that are not treated as secret storage, including: - Shell command history - HTTP proxy and gateway logs - Endpoint monitoring and process telemetry - Debug and diagnostic output - Terminal recordings - Web server access logs Although HTTPS protects the URL in transit from passive network observers, it does not prevent disclosure through local command history, client telemetry, or infrastructure logs. ### Attack Path 1. A user follows the API reference and substitutes a real AtomGit token for `YOUR_TOKEN`. 2. The complete command, including the token, is saved in shell history or captured by process-monitoring software. 3. A local user, support operator, monitoring administrator, or attacker with log access retrieves the URL. 4. The attacker extracts the token from the `access_token` query parameter. 5. The attacker uses the token to access AtomGit resources within its assigned scopes. ### Impact Assessment A disclosed token grants the privileges associated with its configured AtomGit scopes. Depending on those scopes, an attacker may read private repository data, post comments, approve pull requests, manage collaborators, or perform other repository operations. The exposure may persist after the command finishes because histories and logs can be retained or centrally aggregated for long periods. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove query-string authentication from all examples and recommended workflows. 2. Require the `Authorization: Bearer` header: ```bash curl -H "Authorization: Bearer ${ATOMGIT_TOKEN}" \ https://api.atomgit.com/api/v5/user ``` 3. Clearly warn users that credentials must never be placed in URLs. 4. Recommend secret injection methods that avoid literal tokens in shell history. 5. Advise users to rotate any token previously used in a query string and remove affected history or log records where feasible. 6. Document least-privilege token scopes and expiration requirements. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (38)

Missing User Warnings

High
Confidence
93% confidence
Finding
The batch approval workflow enables parallel approval of multiple PRs and is presented as a performance feature without strong caution about governance or review integrity. In the context of a repository-management skill, bulk approvals can bypass meaningful human review at scale, increasing the chance of unsafe code being trusted and merged across important repositories.

External Transmission

Medium
Category
Data Exfiltration
Content
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
# AtomGit-PowerShell API 快速参考

> **API 版本**: v5  
> **Base URL**: `https://api.atomgit.com/api/v5`  
> **技能版本**: v3.0.0

---
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
97% confidence
Finding
The authentication section recommends header-based auth but also documents passing access tokens in the URL query string without any warning. Tokens in URLs can be exposed via browser history, shell history, logs, proxies, referrers, and monitoring systems, leading to credential leakage and unauthorized API access.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This markdown file includes POST/PUT endpoints for adding PR comments, creating/updating issues, and merging pull requests, plus a concrete merge example. The document does not disclose that these actions modify remote repository state and may be irreversible or workflow-impacting, which matches the markdown-specific missing-warning criterion for user data/system integrity effects.

External Transmission

Medium
Category
Data Exfiltration
Content
### 获取用户信息
```bash
curl -H "Authorization: Bearer TOKEN" \
  https://api.atomgit.com/api/v5/user
```
Confidence
60% 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
89% confidence
Finding
The documentation promotes parallel batch approval of multiple PRs, which is a safety-sensitive bulk operation affecting several remote resources at once. There is no accompanying warning about verifying the target PR list, limiting scope, or the risk of accidental mass approvals.

Missing User Warnings

Medium
Confidence
85% confidence
Finding
This markdown file describes state-changing operations such as approving and merging pull requests, which can directly affect repository workflow and project history. The examples show how to perform these actions but provide no warning or caution about their consequences, review requirements, or reversibility considerations.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill advertises capabilities such as approving, merging, and repository management directly in the top-level description, but does not pair them with an explicit warning that these actions modify remote state and may be irreversible. In an agent skill context, prominently exposing destructive operations without user-facing cautions increases the risk of accidental authorization of impactful actions.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The batch approval feature encourages parallel bulk processing of PRs and emphasizes performance gains, but does not include a strong warning that it can apply remote approvals at scale very quickly. That makes operator mistakes more damaging, especially in automated or agent-assisted workflows where multiple PRs may be approved before a human notices an error.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation instructs users to pass a personal access token directly on the command line without warning about secrecy or safer handling. Tokens entered this way may be exposed through shell history, process listings, logs, screenshots, or copied transcripts, which can lead to account compromise on the code hosting platform.

Static analysis

No suspicious patterns detected.