Back to skill

Security audit

bilibili-publishing-pack

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it grants broad Beatra account authority and silently self-updates beyond what a Bilibili copy-and-thumbnail helper needs.

Install only if you are comfortable giving this package broad Beatra account capabilities, including billable media generation and task/artifact authority, and accepting default silent package updates. If installed, consider running the documented auto-update-off command before use, keep ~/.beatra credentials private, avoid shared or loosely managed Windows profiles, and review Beatra Console access/revocation options.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/mcp_client.py:932
Finding

Default Silent Self-Update Enables Post-Audit Remote Code Replacement

Content
View full analysis
dict[str, Any]: path = update_home / "state.json" try: value = json.loads(path.read_text(encoding="utf-8")) except (OSError, json.JSONDecodeError): return {"schema_version": 1, "auto_update": True} if not isinstance(value, dict) or value.get("schema_version") != 1: return {"schema_version": 1, "auto_update": True} return value ``` ```python def maybe_auto_update( *, state_dir: Path | None = None, install_root: Path | None = None, get_bytes: GetBytes = _default_get_bytes, now: float | None = None, ) -> bool: """Best-effort silent update. Never block the requested MCP command.""" resolved_state = state_dir or Path.home() / ".beatra" try: resolved_root = (install_root or _current_install_root()).resolve() update_home = _update_home(resolved_state, resolved_root) observed_at = time.time() if now is None else now nonce = _lock_update(update_home, now=observed_at) if nonce is None: return False try: recover_update(state_dir=resolved_state, install_root=resolved_root) state = _read_update_state(update_home) if state.get("auto_update", True) is False: return False last_checked = state.get("last_checked_at") if ( isinstance(last_checked, (int, float)) ...[truncated 4222 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/authorize.py:34
Finding

Authorization Requests Capabilities Far Beyond the Declared Image-Thumbnail Workflow

Content
View full analysis
dict[str, Any]: session = _session_with_registration( state_dir=Path.home() / ".beatra", post_json=_default_post_json, ) if command == "tools": return session.request(2, "tools/list", {}) try: arguments = json.load(os.sys.stdin) except json.JSONDecodeError as exc: raise RuntimeError("Tool arguments on stdin must be one JSON object") from exc if not isinstance(arguments, dict): raise RuntimeError("Tool arguments on stdin must be one JSON object") assert tool_name is not None return session.request( 2, "tools/call", {"name": tool_name, "arguments": arguments}, ) ``` ```python call = subparsers.add_parser("call", help="Call one tool with a JSON object on stdin") call.add_argument("tool_name") ``` ### Technical Analysis The declared Skill workflow writes Bilibili publishing copy a ...[truncated 2685 chars]
Remediation
View remediation

other

Warning
Location
scripts/authorize.py:339
Finding

Hostname and Agent-Environment Fingerprints Are Collected for Nonessential Telemetry

Content
View full analysis
str: """The agent environment this process runs inside (docs/device-model.md). Order: explicit agent self-report > environment signatures > unknown. Detection reads the process environment only — nothing else runs, nothing reaches the network. """ if explicit: candidate = explicit.strip().lower().replace(" ", "-") if _PLATFORM_VALUE.fullmatch(candidate): return candidate env = os.environ if env.get("CLAUDECODE") == "1" or "CLAUDE_CODE_ENTRYPOINT" in env: return "claude-code" if any(key.startswith("CODEX_") for key in env): return "codex" ai_agent = env.get("AI_AGENT", "").lower() matched = re.match(r"([a-z0-9-]+)_", ai_agent) if matched and _PLATFORM_VALUE.fullmatch(matched.group(1)): return matched.group(1) return "unknown" def device_display_name() -> str | None: """A hostname the user will recognise in the console device list.""" try: name = socket.gethostname().strip() except OSError: return None if not name or not name.isprintable(): return None return name[:120] ``` ```python form: dict[str, str] = { "client_id": CLIENT_ID, "resource": MCP_URL, "scope": SCOPE, "platform": host_platform, "client_name": PACKAGE_DISPLAY_NAME, "external_installation_ref": external_reference, "package_version": PACKAGE_VERSION, "package_slug": PACKAGE_SLUG, } if device_name: form["device_name"] = device_name status, created = post_form(DEVICE_AUTHORIZATION_URL, form) ``` The client additionally at ...[truncated 3245 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/authorize.py:119
Finding

Windows Credential Storage Relies on Inherited Profile ACLs Without Verification

Content
View full analysis
None: # POSIX gets explicit 700/600. On Windows the state directory lives under # the user profile, whose default ACL is already private to the user — # the same posture as gh/aws/gcloud credential stores. The former custom # DACL ceremony was dropped deliberately: its command patterns read as # hostile to agent safety policies and endpoint security, failing installs # while adding no protection an elevated administrator could not bypass. path.mkdir(mode=0o700, parents=True, exist_ok=True) if os.name == "posix": path.chmod(0o700) def _restrict_file(path: Path) -> None: if os.name == "posix": path.chmod(0o600) ``` The bearer token is written directly to JSON: ```python _atomic_json( credential_path, { "schema_version": 1, "mcp_url": MCP_URL, "token_type": "Bearer", "access_token": access_token, "credential_id": _required_string(polled, "credential_id"), "installation_id": _required_string(polled, "installation_id"), "scope": scope, "authorized_at": datetime.now(_UTC).isoformat(), "idle_expires_in": _positive_int(polled, "idle_expires_in", 15 * 24 * 60 * 60), }, ) ``` The Windows read path performs no ACL validation: ```python def _read_private_credentials(state_dir: Path, path: Path) -> str: if os.name == "nt": # The state directory lives under the user profile, whose default # ACL is already private to the user (the gh/aws/gcloud posture). # The former custom DACL verification was dropped deliberately: its # comman ...[truncated 2602 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (36)

Context-Inappropriate Capability

Critical
Category
Not specified by scanner
Confidence
98% confidence
Finding

The requested music:generate and tasks:cancel scopes are outside the declared function of creating Bilibili publishing copy and thumbnails. These permissions could allow the skill to affect unrelated jobs or consume generation resources beyond what users reasonably expect from this package.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The package includes uninstall logic that reads and modifies local state under ~/.beatra, accesses credentials, revokes tokens remotely, and removes local files, none of which is disclosed by the advertised publishing-copy function. Undisclosed local state manipulation and credential handling are dangerous because they can surprise users, break trust boundaries, and create opportunities for destructive or privacy-impacting behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The package includes uninstall logic that reads and modifies local state under ~/.beatra, accesses credentials, revokes tokens remotely, and removes local files, none of which is disclosed by the advertised publishing-copy function. Undisclosed local state manipulation and credential handling are dangerous because they can surprise users, break trust boundaries, and create opportunities for destructive or privacy-impacting behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The package includes uninstall logic that reads and modifies local state under ~/.beatra, accesses credentials, revokes tokens remotely, and removes local files, none of which is disclosed by the advertised publishing-copy function. Undisclosed local state manipulation and credential handling are dangerous because they can surprise users, break trust boundaries, and create opportunities for destructive or privacy-impacting behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file documents an embedded client that silently checks for and automatically installs software updates, which is unrelated to a Bilibili publishing-copy/thumbnail skill. Even with described integrity checks, bundling self-updating code into an AI content skill expands the trust boundary, creates unauthorized network and file-modification behavior, and could be abused through upstream compromise or misconfiguration.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

A silent network-based auto-update mechanism is unjustified for a skill whose stated function is generating Bilibili publishing assets. Hidden outbound checks and automatic installation create covert system-modifying behavior that users would not reasonably expect from this context, making any supply-chain failure or endpoint compromise particularly dangerous.

Content

No source excerpt is available for this finding.

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 · manifest.json (reported line 59)May include surrounding context.

json
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

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 · references/installation-and-auth.md (reported line 14)May include surrounding context.

text

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

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 · references/installation-and-auth.md (reported line 21)May include surrounding context.

text

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

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 · references/installation-and-auth.md (reported line 49)May include surrounding context.

text

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

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 · references/mcp-connection.md (reported line 10)May include surrounding context.

text

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

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 · scripts/authorize.py (reported line 207)May include surrounding context.

python
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

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 · scripts/authorize.py (reported line 514)May include surrounding context.

python
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

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 · scripts/mcp_client.py (reported line 1025)May include surrounding context.

python
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The OAuth scope string requests a very broad set of capabilities, including artifact access, image/video/music/speech generation, voice read/write, wallet spending, and task operations, while the skill is described as a Bilibili publishing helper that mainly produces copy and thumbnails. Over-privileged authorization violates least privilege and means compromise or abuse of this skill could grant access well beyond its stated purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The requested music:generate and tasks:cancel scopes are outside the declared function of creating Bilibili publishing copy and thumbnails. These permissions could allow the skill to affect unrelated jobs or consume generation resources beyond what users reasonably expect from this package.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The requested music:generate and tasks:cancel scopes are outside the declared function of creating Bilibili publishing copy and thumbnails. These permissions could allow the skill to affect unrelated jobs or consume generation resources beyond what users reasonably expect from this package.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The client implements broad remote capabilities far beyond the advertised Bilibili publishing function: generic MCP tool invocation, asset upload, installation registration, and a full self-update mechanism. In skill context, this is dangerous because users would reasonably expect copy/thumbnail generation, not a general remote-control/update client with persistent local state and network authority.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code can download manifests and archives from remote endpoints and replace installed package files. Even with checksum and path validation, self-updating materially expands trust and attack surface; compromise of the update channel or signing/discovery infrastructure would let code unrelated to the skill's stated purpose be introduced onto the host.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
95% confidence
Finding

The exposed CLI explicitly supports self-update, which modifies the installed package's own code. In this skill context, self-modification is high risk because it exceeds user expectations for a Bilibili publishing helper and creates a path for remote code changes on the host outside normal package-management controls.

Content

Scanner excerpt · scripts/mcp_client.py (reported line 1503)May include surrounding context.

python
)
    update = subparsers.add_parser(
        "update",
        help="Check, install, or configure Beatra package self-updates",
    )
    update.add_argument(
        "--check",

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

Referencing credentials.json as part of the state owned and potentially deleted by this skill demonstrates access to shared credential storage. While deletion during uninstall is not the same as exfiltration, access to authentication artifacts from a skill whose purpose is Bilibili copy/thumbnail generation is overprivileged and dangerous because the package operates on global auth state outside its functional scope.

Content

Scanner excerpt · scripts/uninstall.py (reported line 40)May include surrounding context.

python
#: these and then removes the directory only if it is empty — the script
#: never recursively deletes a directory it does not fully understand.
_STATE_FILES = (
    "credentials.json",
    "installation.json",
    "host.json",
    "skills.json",

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The uninstall script contains logic to revoke a shared Beatra device credential and remove global state under ~/.beatra, which is capability well beyond the advertised Bilibili content-generation purpose of the skill. Even though this is framed as uninstall behavior and includes safeguards, it still gives this package authority over shared authentication material used by other skills, creating a disproportionate trust boundary and potential for account disruption.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code reads access tokens from ~/.beatra/credentials.json and uses them for revocation decisions, which is credential-management functionality unrelated to a Bilibili publishing assistant. In the context of a content-creation skill, embedding account/token handling increases blast radius if the package is modified, abused by the host, or mis-scoped, because compromise would affect the user's shared Beatra authentication rather than only this skill.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The _device_token function directly opens ~/.beatra/credentials.json and extracts an access token, which is explicit credential access. In a skill advertised only for generating Bilibili publishing assets, direct token handling is unnecessary and materially increases risk because any bug, tampering, or future code change could abuse those credentials for unauthorized API actions.

Content

Scanner excerpt · scripts/uninstall.py (reported line 109)May include surrounding context.

python
def _device_token(state_dir: Path) -> str | None:
    path = state_dir / "credentials.json"
    try:
        value = json.loads(path.read_text(encoding="utf-8"))
    except (OSError, ValueError):

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares no explicit tool scope even though its instructions require shell, network, filesystem, and environment access via a bundled client. That broad implicit capability increases attack surface and makes it harder for a host or reviewer to constrain what the skill can do, especially because the same package also performs installation, auth, update, and remote calls.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.