Back to skill

Security audit

Harbor Skills

Security checks for vulnerabilities and agentic risk

Overview

This Harbor administration skill is mostly purpose-aligned, but it includes high-impact registry, Kubernetes, credential, and recovery actions with weak safety guardrails.

Review this skill carefully before installing in a production Harbor environment. Use narrowly scoped robot credentials, require HTTPS and approved Harbor hosts, avoid logging tokens, change TLS examples to verify certificates, pin Kubernetes manifests and images, and add explicit approval gates before deletion, GC, restore, replication, or account-rotation actions.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (7)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cleanup_dryrun.py:44
Finding

Harbor credentials can be transmitted to an untrusted or cleartext endpoint

Content
View full analysis
Dict[str, str]: if not auth: raise ValueError("Authentication information is required") if auth.startswith("Bearer "): return {"Authorization": auth} elif ":" in auth: encoded = base64.b64encode(auth.encode()).decode() return {"Authorization": f"Basic {encoded}"} else: encoded = base64.b64encode(f"admin:{auth}".encode()).decode() return {"Authorization": f"Basic {encoded}"} def get_project_id(url: str, project: str, headers: Dict) -> int: r = requests.get( f"{url}/api/v2.0/projects", params={"name": project}, headers=headers, timeout=30 ) ``` ```python # scripts/compliance_check.py def get_headers(auth: str) -> Dict[str, str]: if ":" in auth: encoded = base64.b64encode(auth.encode()).decode() return {"Authorization": f"Basic {encoded}", "Content-Type": "application/json"} encoded = base64.b64encode(f"admin:{auth}".encode()).decode() return {"Authorization": f"Basic {encoded}", "Content-Type": "application/json"} ``` ```python # scripts/robot_account.py def get_project_id(url: str, project: str, headers: Dict) -> int: r = requests.get( f"{url}/api/v2.0/projects", params={"name": project}, headers=headers, timeout=15 ) ``` ### Technical Analysis All three scripts construct an `Authorization` header containing reusable Harbor credentials and send it to a caller-controlled `--url`. They do not validate the URL scheme, destination host, port, or redirect target. Base64 encoding is required by HTTP Ba ...[truncated 1444 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/robot_account.py:224
Finding

One-time robot-account secrets are exposed through standard output

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:402
Finding

Webhook configuration example disables TLS certificate verification

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
references/gitops.md:8
Finding

Mutable remote Kubernetes manifest is applied directly to the cluster

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/compliance_check.py:109
Finding

HTTPS compliance check fails open and reports unverified transport as compliant

Content
View full analysis
CheckResult: try: r = requests.get(f"{self.url}/api/v2.0/system/configurations", headers=self.h, timeout=15) if r.status_code == 200: cfg = r.json() http_auth = cfg.get("http_authmode", "") if http_auth == "oidc": return check("HTTPS + OIDC authentication", True, "OIDC is configured") return check("HTTPS configuration", True, "API responded successfully") except Exception as e: pass return check("HTTPS configuration", True, "Check skipped; proxy configuration requires manual review") ``` The messages above are translated for report readability; the control flow and unconditional passing status match the audited source. ### Technical Analysis The function does not verify that `self.url` uses HTTPS. Any HTTP endpoint returning status 200 is marked as passing. If the request fails, the exception is suppressed and the function still returns a passing result. A skipped or failed security test must not be represented as successful. The current behavior can conceal plaintext authentication, certificate failures, unavailable endpoints, and malformed responses while generating an apparently compliant report. ### Attack Path 1. A Harbor instance is configured with HTTP, invalid TLS, or an unreachable configuration endpoint. 2. The compliance script performs the check. 3. If the API responds over HTTP, the script treats the response as proof of HTTPS. 4. If an exception occurs, the exception is discarded. 5. The script returns a passing `CheckResult`. 6. Operators rely on the report and leave the insecure transport condition unresolved. ### Impact Assessment This issue creates false assurance ...[truncated 254 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/backup-recovery.md:111
Finding

Administrative password is hard-coded in executable recovery examples

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/robot_account.py:121
Finding

Robot-account authentication fallback references undefined credential variables

Content
View full analysis
Dict[str, str]: if ":" in auth: encoded = base64.b64encode(auth.encode()).decode() return {"Authorization": f"Basic {encoded}", "Content-Type": "application/json"} encoded = base64.b64encode(f"{username}:{password}".encode()).decode() return {"Authorization": f"Basic {encoded}", "Content-Type": "application/json"} ``` ### Technical Analysis The fallback branch references `username` and `password`, but neither variable is defined in the function or module scope. Any authentication value without a colon reaches this branch and raises `NameError`. The project metadata describes `HARBOR_TOKEN`, while the scripts primarily read `HARBOR_AUTH`. The function also does not explicitly support already formatted `Basic ...` or `Bearer ...` credentials. This mismatch can cause failure when users supply the token format documented by the Skill. Although this is primarily an availability and correctness issue, failed authentication handling can drive operators toward unsafe troubleshooting practices, such as placing plaintext credentials directly in command-line arguments. ### Attack Path 1. An operator supplies a bearer token, pre-encoded Basic value, or other colon-free credential in accordance with the broader Skill documentation. 2. The value reaches `get_auth_header`. 3. The `":" in auth` condition is false. 4. Python attempts to evaluate undefined `username` and `password` variables. 5. The script terminates with `NameError`. 6. The intended account-creation, rotation, listing, or deletion workflow fails; operators may expose credentials while attempting alternate invocation methods. ### Impact Assessment The direct impact is denial of the robot-account management operation. ...[truncated 252 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (44)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该描述明显过度声明了技能范围。代码仅围绕 Harbor 某个很具体的子功能——仓库镜像标签清理演练与可选删除——展开,主要调用 Harbor projects、repositories/artifacts、tags 删除接口。虽然这仍属于 Harbor 管理范畴,但与“综合管理技能”相比差距很大,且描述中列出的多项核心能力在代码中完全不存在。另一个重要不一致是脚本帮助文本宣称支持 regex 策略,但主流程实际上未实现该分支,遇到该策略会直接报不支持并退出。因此,声明与实际行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `scripts/compliance_check.py` | 合规性检查脚本 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `scripts/robot_account.py` | 机器人账号创建与轮换脚本 |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/backup-recovery.md (reported line 50)May include surrounding context.

md
/data/harbor/registry /data/harbor/redis 2>/dev/null || true
else
  # 增量备份(rsync 方式)
  rsync -a --delete /data/harbor/registry/ \
    "$BACKUP_ROOT/registry-incremental-$DATE/" 2>/dev/null || true
fi

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The replication rule example sets deletion: true and override: true without warning that deletions in the source may be propagated to the destination or that mirrored artifacts may be overwritten. In a registry-management skill, this is especially dangerous because it can cause large-scale loss of images across disaster recovery or downstream registries.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares auth-method: env and contains numerous commands that use network access and bearer/basic credentials, but it does not declare an explicit tool scope such as permissions or allowed-tools. In an agent setting, this broadens the execution surface and can let the skill perform sensitive networked administrative actions without a clearly bounded capability contract, increasing the risk of unintended destructive Harbor operations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions are very broad, covering nearly any mention of Harbor, Docker image management, CI/CD, GitOps, or webhooks. In an agent environment this increases the chance that the skill auto-activates during general discussion and performs or suggests high-risk administrative actions in the wrong context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

L003 的自然语言描述全部使用中文,且未说明该技能是否仅面向中文用户,或是否支持根据用户偏好切换语言。按照语言/区域政策,若技能默认强制特定语言而无用户选择或明确限制说明,属于可报告的问题。

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

创建项目

bash
curl -X POST "$HARBOR_URL/api/v2.0/projects" \
  -H "Authorization: $HARBOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

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

pid = proj["project_id"]

更新配额(单位:bytes,500G = 500*1024^3)

requests.put(f"{url}/api/v2.0/projects/{pid}", headers=auth, json={"metadata": {"storage_quota": str(500*1024**3)}}) print(f"项目 {pid} 配额已更新为 500G")

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation includes direct and bulk deletion workflows for tags/images without strong confirmation, dry-run-by-default behavior, rollback guidance, or prominent warnings about production impact. In a Harbor administration skill, these are destructive operations that can cause data loss, break deployments, and trigger irreversible garbage collection side effects.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

This endpoint triggers Harbor garbage collection, a sensitive administrative action that can affect registry availability and data lifecycle. In this skill, it is exposed as a simple command with credentials from the environment and without explicit safety controls, making accidental or unauthorized invocation more dangerous than a routine outbound request.

Content

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

bash
# 1. 触发 GC
curl -X POST "$HARBOR_URL/api/v2.0/system/gc/schedule" \
  -H "Authorization: $HARBOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schedule":{"type":"manual"}}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

The command schedules GC with dry_run: false, which moves beyond observation into active cleanup. Because this is a state-changing network action against a production registry and the skill lacks strong guardrails, it meaningfully increases the chance of disruptive maintenance actions being triggered unintentionally.

Content

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

md
"$HARBOR_URL/api/v2.0/system/gc" | jq '.[] | {id: .id, status: .job_status, start: .start_time}'

# 3. GC 完成后清理孤儿 Blob
curl -X POST "$HARBOR_URL/api/v2.0/system/gc/schedule" \
  -H "Authorization: $HARBOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"schedule":{"type":"none"}, "dry_run": false}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
76% confidence
Finding

Creating replication policies transmits configuration that can copy artifacts to another registry and optionally propagate deletions. In a sensitive Harbor environment, misconfiguration here can cause data exposure to external registries or destructive synchronization, so exposing this as a straightforward network action without scoping or confirmation is risky.

Content

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

创建复制规则

bash
curl -X POST "$HARBOR_URL/api/v2.0/replication/policies" \
  -H "Authorization: $HARBOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{

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

创建代理缓存项目

bash
curl -X POST "$HARBOR_URL/api/v2.0/projects" \
  -H "Authorization: $HARBOR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{

Rp1

Medium
Category
MCP Rug Pull
Confidence
82% confidence
Finding

The command pulls nginx:latest, which is a mutable tag rather than an immutable digest. In supply-chain sensitive Harbor workflows, mutable tags can resolve to different content over time, undermining reproducibility and potentially allowing an attacker controlling or poisoning the upstream source to influence what image is used.

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

| jq '{scan: .scan_summary}'

导出详细扫描报告(CSV格式)

curl -s -H "Authorization: $HARBOR_TOKEN"
"$HARBOR_URL/api/v2.0/projects/my-app/repositories/my-app--api/artifacts/v1.2.3/scan_report?accept=text/csv"

text

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The restore section instructs stopping Harbor and restoring service data with minimal safeguards or warnings. In the context of an invocable skill, this can cause service outage, inconsistent recovery, or data corruption if run on the wrong host, with insufficient emphasis on validation, backup integrity, maintenance windows, and rollback planning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The recovery section includes destructive operational commands such as stopping Harbor, restoring a database into a live-named target, and extracting archives to / without prominent warnings or environment validation steps. In an agent-skill context, such instructions are more dangerous because they may be copied or executed in the wrong host or environment, causing service outage, overwriting configuration, or irreversible data corruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The examples embed a plaintext administrator username and password directly in curl commands. This is dangerous because readers may reuse the example pattern with real credentials, leak secrets into shell history, logs, process listings, screenshots, or documentation, and normalize insecure credential handling for an administrative Harbor account.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file content, headings, comments, and operational guidance are all written in Chinese, which effectively forces a specific language for users of this skill reference. The policy allows locale constraints only when the skill offers user choice or clearly documents a justified regional constraint, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file is written entirely in Chinese and does not indicate that language choice is optional or that the content is region-specific only. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.