Back to skill

Security audit

ci-package-deploy-notify

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its CI/CD notification purpose, but it ships live Jenkins and Feishu credentials and can forward Jenkins credentials to unvalidated URLs.

Do not install this published artifact as-is. Rotate the exposed Jenkins and Feishu secrets, remove live credentials from the package, load them from a protected runtime secret source, validate all Jenkins queue/build URLs before attaching credentials, and use a narrowly scoped service account for only the intended jobs.

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

T09 · Insecure Skill Coding Practices

Error
Location
assets/config.json:43
Finding

Operational credentials are hardcoded in the distributed configuration

Content
View full analysis

Vulnerability Details

File Location: assets/config.json, lines 43, 59, and 65-67
Vulnerability Type: Hardcoded secrets and plaintext credential storage
Risk Level: Critical

Vulnerable Code

Sensitive values are redacted below to prevent further credential disclosure:

json
"feishu_deploy_webhook": "https://open.feishu.cn/open-apis/bot/v2/hook/[REDACTED]",
...
"feishu_app_id": "cli_a9393c9afd621cc4",
"feishu_app_secret": "[REDACTED]",
...
"jenkins": {
  "url": "https://jenkins.dl-aiot.com/",
  "user": "samual",
  "api_token": "[REDACTED]",
  "ci_job_template": "dev-{repo}-ci",
  "cd_job_template": "dev-{repo}-ci"
}

Technical Analysis

The Skill package contains a Jenkins API token, a Feishu application secret, and a credential-bearing Feishu webhook URL in plaintext. These credentials are loaded directly from the packaged configuration by scripts/git_flow.py.

This conflicts with the Skill documentation's instruction not to expose tokens and secrets. Packaging credentials alongside executable code means that any user, process, agent, artifact registry, backup, or source-control account with read access to the Skill can extract and reuse them outside the intended workflow.

The Jenkins credential is actively used for authenticated queue inspection, build triggering, and build-status polling. The Feishu webhook is actively used to post notifications. The Feishu application secret is not used by the reviewed scripts, so distributing it exceeds the minimum privileges and data required for the declared Jenkins-build-and-notify functionality.

The partially masked github_token at line 3 was not treated as a confirmed usable credential.

Attack Path

  1. An attacker obtains read access to the Skill directory, source repository, packaged artifact, backup, or deployment image.
  2. The attacker reads assets/config.json.
  3. The attacker extracts the Jenkins API token, Feishu we ...[truncated 1583 chars]
Remediation
View remediation

Remediation Suggestions

  1. Immediately revoke and rotate the exposed Jenkins API token, Feishu webhook, and Feishu application secret.
  2. Review Jenkins and Feishu audit logs for unauthorized activity involving the exposed credentials.
  3. Remove all secrets from assets/config.json, package archives, source-control history, release artifacts, caches, and backups where feasible.
  4. Load credentials at runtime from a protected secret manager or environment variables supplied by the execution platform.
  5. Distribute only a non-sensitive configuration template containing endpoint and job names.
  6. Remove the Feishu application secret entirely if this Skill does not use application authentication.
  7. Replace the personal Jenkins identity with a dedicated service account restricted to the exact jobs and actions required by this Skill.
  8. Restrict the Jenkins account from administrative actions, credential management, script-console access, job reconfiguration, and unrelated jobs.
  9. Use a narrowly scoped Feishu integration dedicated to deployment notifications.
  10. Add automated secret scanning and commit-time protection to prevent credentials from entering future releases.
  11. Fail closed when required runtime secrets are absent, without printing their values in error messages or logs.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/git_flow.py:279
Finding

Jenkins Basic Authentication credentials can be forwarded to unvalidated response-provided URLs

Content
View full analysis

Vulnerability Details

File Location: scripts/git_flow.py, lines 279-282 and 481-505
Vulnerability Type: Credential disclosure through unvalidated queue and build URLs
Risk Level: High

Vulnerable Code

python
resp = requests.post(
    url,
    auth=(user, api_token),
    params=params,
    timeout=15,
    allow_redirects=False,
)
if resp.status_code in (200, 201, 202, 302):
    queue_url = resp.headers.get("Location")

The response-provided URL is subsequently used for an authenticated request:

python
def wait_for_job_completion(
    cfg,
    queue_url=None,
    build_url=None,
    timeout_seconds=1800,
    poll_seconds=10,
):
    if not queue_url and not build_url:
        return False, "未拿到 Jenkins queue/build url,无法等待完成", None
    jk = get_jenkins_cfg(cfg)
    user = jk["user"]
    api_token = jk["api_token"]
    started = time.time()
    build_api = build_url.rstrip("/") + "/api/json" if build_url else None

    while time.time() - started < timeout_seconds:
        if build_api is None:
            qurl = queue_url.rstrip("/") + "/api/json"
            resp = requests.get(
                qurl,
                auth=(user, api_token),
                timeout=15,
            )
            resp.raise_for_status()
            qdata = resp.json()
            executable = qdata.get("executable")
            if executable and executable.get("url"):
                build_api = executable["url"].rstrip("/") + "/api/json"

        resp = requests.get(
            build_api,
            auth=(user, api_token),
            timeout=15,
        )

Technical Analysis

The initial Jenkins trigger request appropriately disables automatic redirects. However, the script trusts the response's Location header as queue_url without checking whether it belongs to the configured Jenkins origin.

It also trusts executable.url retu ...[truncated 2941 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse every queue and build URL with a standard URL parser before making an authenticated request.
  2. Require the URL scheme to be https.
  3. Require the normalized hostname and effective port to exactly match the configured Jenkins origin.
  4. Reject URLs containing embedded user information, fragments, unexpected ports, or non-HTTP(S) schemes.
  5. Prefer resolving Jenkins-provided relative paths against the configured base URL rather than trusting absolute URLs.
  6. Set allow_redirects=False on every request carrying Jenkins authentication.
  7. If a redirect must be supported, validate every redirect destination before issuing a new authenticated request.
  8. Centralize Jenkins requests in one helper that enforces origin validation, TLS verification, redirect policy, timeout limits, and authentication handling.
  9. Use a dedicated Jenkins service account with permission only to inspect and trigger the explicitly configured jobs.
  10. Add tests covering external Location headers, external executable.url values, scheme changes, port changes, embedded credentials, protocol-relative URLs, and redirect responses.
  11. Rotate the currently packaged Jenkins token because it is independently exposed by the plaintext configuration finding.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description understates the skill's operational reach: beyond deployment notification, it can trigger CI/CD workflows, batch-process multiple repositories, wait on builds, mention users, and transmit initiator identity in outbound messages. This mismatch can mislead reviewers or higher-level agents about the skill's side effects, causing it to be selected in contexts where the user did not expect broad automation or identity-bearing notifications.

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

md
- 当脚本或 `SKILL.md` 更新后,如需让其他有权限的 agent 也拿到同一版本,使用 `clawhub`/技能同步流程进行发布或同步,不要只改当前工作区副本后就默认其他 agent 已生效。

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill clearly instructs execution of a Python script that triggers Jenkins jobs, polls build state, and sends Feishu notifications, which are network-capable operations, yet it declares no explicit tool scope or permission boundaries. This weakens governance and reviewability: an agent may invoke networked side effects without a machine-readable restriction layer, increasing the chance of unintended execution or misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This manifest includes natural-language identity information for the deploy sender as a fixed person name, which bakes a specific identity/locale presentation into the skill behavior. Under the policy, fixed language/locale or identity presentation without user choice should be flagged when not clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains many hard-coded user-facing status and error messages in Chinese, such as Jenkins trigger results and notification text. The policy requires flagging language or locale constraints when the skill forces a specific language without user opt-in, and there is no evidence here of a configurable language choice or documented region-specific justification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

send_feishu_deploy_msg has no built-in verification that a Jenkins job completed successfully before sending a message. If the caller invokes it prematurely or independently, recipients may receive false deployment/build notices, which can trigger mistaken releases, testing, or incident responses.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

send_feishu_deploy_msg has no built-in verification that a Jenkins job completed successfully before sending a message. If the caller invokes it prematurely or independently, recipients may receive false deployment/build notices, which can trigger mistaken releases, testing, or incident responses.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · scripts/git_flow.py (reported line 452)May include surrounding context.

python
},
    }
    try:
        resp = requests.post(webhook, json=card, timeout=10)
        body = resp.json()
    except Exception as e:
        return False, "发送异常: {}".format(e)

Tainted flow: 'qurl' from requests.get (line 491, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
96% confidence
Finding

wait_for_job_completion accepts queue_url/build_url and then performs authenticated requests.get calls directly against those URLs. If an attacker can influence these values, the skill becomes an SSRF primitive that will send Jenkins credentials to an arbitrary host, potentially exposing the API token and enabling internal network access.

Content

Scanner excerpt · scripts/git_flow.py (reported line 492)May include surrounding context.

python
while time.time() - started < timeout_seconds:
        if build_api is None:
            qurl = queue_url.rstrip("/") + "/api/json"
            resp = requests.get(qurl, auth=(user, api_token), timeout=15)
            resp.raise_for_status()
            qdata = resp.json()
            executable = qdata.get("executable")