Back to skill

Security audit

博乐故事创作系统,输入提示词,创建视频故事

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims by calling Bole to generate stories and videos, but it exposes a Bole bearer token in logs and sends user text to an external service.

Review before installing. Use a narrowly scoped BOLE_ACCESS_KEY, avoid entering confidential or regulated story text, confirm that the hard-coded project ID is appropriate for your account, and do not run this where stderr logs are shared or retained until the access-token logging is removed.

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
scripts/main.py:24
Finding

Bearer Access Token Exposed Through Standard Error Logging

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 24–28
Vulnerability Type: Sensitive credential exposure through logging
Risk Level: Medium

Vulnerable Code:

python
resp_json = json.loads(resp_body)
access_token = resp_json.get("data", {}).get("access_token")
print(f"access_token: {access_token}", file=sys.stderr)
return access_token

Technical Analysis

The Skill extracts a bearer access token from the Bole authentication response and writes its complete value to standard error. Standard error is commonly retained by process supervisors, CI/CD systems, container platforms, centralized logging services, and agent orchestration environments.

A bearer token is sufficient for authentication by possession. Logging it unnecessarily expands access from the running process to every user or system that can read captured process output. Although sending BOLE_ACCESS_KEY to the declared Bole authentication endpoint is necessary for the documented functionality, disclosing the resulting token through logs is not necessary and violates least-exposure principles.

Attack Path

  1. A user configures BOLE_ACCESS_KEY and invokes the Skill.
  2. The Skill sends the key to the declared Bole authentication endpoint and receives a bearer access token.
  3. The vulnerable statement writes the complete token to standard error.
  4. A local user, log administrator, compromised monitoring component, or other party with access to retained stderr output obtains the token.
  5. The attacker replays the bearer token in the Authorization header when calling Bole API endpoints.
  6. Until the token expires or is revoked, the attacker may perform operations authorized for that token.

Impact Assessment

Exploitation requires access to the Skill's standard error output or downstream logs. A successful attacker may impersonate the authenticated Bole session, access resources permitted by the token, inspec ...[truncated 430 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the token logging statement entirely:

    python
    resp_json = json.loads(resp_body)
    access_token = resp_json.get("data", {}).get("access_token")
    if not access_token:
        raise RuntimeError("Authentication succeeded without an access token")
    return access_token
    
  2. If diagnostic output is required, log only a non-sensitive event such as Authentication succeeded; do not log any token substring.

  3. Configure production logging systems to redact authorization headers, access keys, bearer tokens, and similarly structured credentials.

  4. Restrict access to process and centralized logs according to least privilege and define short retention periods.

  5. Review existing logs for previously exposed tokens and revoke affected sessions where they may still be valid.

  6. Prefer short-lived, narrowly scoped tokens and ensure server-side revocation is available.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (18)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 26)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 54)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 81)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 136)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 155)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 173)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 191)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 209)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 231)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Tainted flow: 'req' from os.environ.get (line 134, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/main.py (reported line 253)May include surrounding context.

python
data = json.dumps(payload).encode("utf-8")
    req = urllib.request.Request(url=url, data=data, headers=headers, method="POST")

    with urllib.request.urlopen(req) as resp:
        resp_body = resp.read().decode("utf-8")

    resp_json = json.loads(resp_body)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill requires environment access and performs external network calls to the Bole AI platform, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. This weakens transparency and policy enforcement, making it easier for the skill to access secrets and send data externally without clear user or platform-level review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation explains how to pass user story text into the skill but does not clearly warn that this prompt content is transmitted to a third-party service for processing. Users may provide sensitive or proprietary text under the assumption of local handling, creating a privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest describes a story creation skill that generates stories, storyboards, and videos via the Bole platform. While calling the Bole API is expected, directly reading a deployment environment secret (BOLE_ACCESS_KEY) and exchanging it for an access token introduces a credential-handling capability not justified by the stated functional purpose itself.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill transmits an environment-derived credential to a third-party service without any user-facing disclosure or consent signal. Even if functionally required, undisclosed credential use increases trust and governance risk, especially in shared agent environments where users may not realize the skill authenticates with external infrastructure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code prints the access token, internal IDs, full API responses, and final asset URL to stderr. In many agent or hosting environments, stderr is centrally collected or visible to operators and other systems, which can expose bearer tokens and private media links for unauthorized reuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

User-provided story text is sent to an external API without explicit disclosure, which creates a privacy and data-handling risk if users enter sensitive or proprietary content. The skill context makes this more important because the core feature encourages free-form user input that may contain confidential material.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The success message is hard-coded in Chinese and does not offer any language choice or indicate that the skill is region-specific. This can violate language/locale policy because users are forced into a specific locale without consent or configuration.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

Most user-facing instructions in the skill are written in Chinese, while some metadata is in English, and the document does not state that Chinese is required nor offer an alternative language. Under SQP-3, forcing a specific language without user opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.