Back to skill

Security audit

Cnb Cool Git

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent CNB Git/API helper, but it documents token-handling patterns that can expose powerful repository and API credentials.

Review this skill before installing if the CNB tokens have write, merge, or pipeline permissions. Prefer least-privilege, expiring tokens, avoid cloning with tokens embedded in URLs, check git remote -v after use, and rotate any token previously used with the documented clone pattern.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:47
Finding

CNB credentials may be exposed through command-line arguments and persistent Git remote configuration

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 47-49 and 61-64
Vulnerability Type: Credential exposure through process arguments and repository configuration
Risk Level: Medium

Vulnerable Code

bash
git clone https://cnb:${CNB_COOL_GIT_TOKEN}@cnb.cool/your-group/your-repo.git
bash
curl -H "Authorization: ${CNB_COOL_API_TOKEN}" \
     -H "Accept: application/vnd.cnb.api+json" \
     "https://api.cnb.cool/..."

Technical Analysis

The documented Git command interpolates CNB_COOL_GIT_TOKEN directly into a URL passed as a command-line argument. After environment-variable expansion, the credential can become visible in the process argument list to local users or monitoring systems with sufficient process-inspection privileges.

More importantly, Git commonly records the clone URL as the repository's origin remote. This can cause the token-bearing URL to persist in .git/config, exposing the credential to users, tools, diagnostics, backups, or archives that can read the working copy.

The documented curl commands similarly interpolate CNB_COOL_API_TOKEN into an HTTP header supplied through the command line. Although this exposure is generally transient, the expanded token may be captured by process inspection, debugging output, command tracing, endpoint telemetry, or unsafe shell wrappers.

Attack Path

  1. An authorized user exports valid CNB Git and API tokens and follows the documented commands.
  2. The shell expands the secret variables before launching git or curl.
  3. A local user, process-monitoring service, diagnostic collector, or other sufficiently privileged process captures the expanded command arguments.
  4. For the Git command, the credential-bearing URL may also be stored persistently as the repository's origin in .git/config.
  5. An attacker with access to the captured arguments, repository metadata, backup, or archive extracts the token.
  6. The ...[truncated 759 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not embed access tokens in Git clone URLs. Use a credential-free remote URL:
    bash
    git clone https://cnb.cool/your-group/your-repo.git
    
  2. Provide Git credentials through a protected credential helper, an appropriately secured GIT_ASKPASS implementation, or another CNB-supported authentication mechanism that does not place the token in process arguments or remote configuration.
  3. Configure credential helpers to use encrypted or operating-system-backed storage where available. Avoid plaintext credential stores.
  4. Supply API credentials through a protected curl configuration or standard-input mechanism rather than an expanded command-line header. Ensure any temporary configuration has restrictive permissions and is deleted immediately after use.
  5. Disable shell tracing around secret-bearing operations and ensure logs, diagnostics, and telemetry redact authorization headers and credential-bearing URLs.
  6. Verify cloned repositories with:
    bash
    git remote -v
    
    If a token is present, replace the remote URL with a credential-free value:
    bash
    git remote set-url origin https://cnb.cool/your-group/your-repo.git
    
  7. Rotate any token previously used with the documented clone pattern because it may remain in repository metadata, process telemetry, shell diagnostics, or backups.
  8. Grant each token only the minimum repository and API permissions required, use separate tokens for distinct functions, and apply expiration and regular rotation policies.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (19)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

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

md
---
AIGC:
    ContentProducer: Minimax Agent AI
    ContentPropagator: Minimax Agent AI
    Label: AIGC
    ProduceID: 5282d543add8072b9878699edc211fb0
    PropagateID: 5282d543add8072b9878699edc211fb0
    ReservedCode1: 3046022100f08c7a6975ef7a4387563429a8120e4ab79cb5ad7d41c4267cc637681acc899f022100ca2aaa4853dc830a1607b57a86755f6eb81398beb2b2f17d2bbdd0e692875d55
    ReservedCode2: 3045022057c25d43ffd6f94e2c7c68fba886004d0c3e8828a823f9eff52bd9ce9b34dc56022100ebeaaf1311141b4d00bf392ec576d5c080e1ab1ae439a9301279ba094f7df3f0
description: CNB 云原生构建平台的 Git 操作技能。使用 git 和 CNB Open API 进行代码克隆、提交、推送、分支管理、Merge Request 管理、流水线触发、流水线结果读取等操作。首次使用需收集用户的 Git 用户名和邮箱信息。
name: cnb-coo

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

API 服务地址:https://api.cnb.cool

⚠️ Token 类型注意:CNB 的 MCP Token(MCP 读写权限)不支持 REST API,所有接口均返回 404。必须使用**经典令牌(Classic Token)**或具有 REST API 权限的 Personal Access Token。

bash
# 所有 API 调用都需携带以下两个 Header

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 59)May include surrounding context.

bash
# 所有 API 调用都需携带以下两个 Header
curl -H "Authorization: ${CNB_COOL_API_TOKEN}" \
     -H "Accept: application/vnd.cnb.api+json" \
     "https://api.cnb.cool/..."

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 61)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 79)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 88)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 93)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 106)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 118)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 126)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 139)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 151)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 159)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 167)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 176)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 181)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 203)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 209)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 220)May include surrounding context.

所有 API 调用都需携带以下两个 Header

curl -H "Authorization: ${CNB_COOL_API_TOKEN}"
-H "Accept: application/vnd.cnb.api+json"
"https://api.cnb.cool/..."

text

## Merge Request(MR)操作