Back to skill

Security audit

Policy Digest Pages

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly disclosed as a Beatra image-generation workflow, but it stores a broad shared Beatra token and can call unrelated paid tools.

Review the Beatra approval carefully before installing. This skill can spend Beatra credits for its intended image workflow, stores a reusable Beatra token locally, silently updates by default unless disabled, and its bundled client can invoke Beatra tools beyond policy-digest image generation.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/authorize.py:32
Finding

Overly Broad Device Authorization Scope and Unrestricted MCP Tool Dispatch

Content
View full analysis

Vulnerability Details

File Location: scripts/authorize.py:32-35; scripts/mcp_client.py:1463-1483
Vulnerability Type: Excessive authorization scope and missing tool allowlist
Risk Level: High

Vulnerable Code

scripts/authorize.py:32-35:

python
SCOPE = (
    "mcp:tools artifacts:write images:generate videos:generate music:generate "
    "speech:generate voices:read voices:write wallet:spend tasks:read artifacts:read tasks:cancel"
)

scripts/mcp_client.py:1463-1483:

python
def _run_command(command: str, tool_name: str | None = None) -> 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},
    )

Technical Analysis

The Skill is declared as a policy-digest image-generation workflow. Its legitimate operations include image generation and editing, model lookup, user-approved media upload, task status retrieval, and billing-related reads. However, the requested bearer-token scope additionally includes video generation, music generation, speech generation, voice creation and modification, wallet spending, and task cancellation.

The bundled client compounds this excessive privilege by forwarding any caller-supplied MCP tool name. There is no package-local allowlist that restricts calls to the tools documented for this Skill. Consequently, enforcemen ...[truncated 1639 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the shared broad scope with a package-specific least-privilege scope containing only the capabilities required by this Skill.
  2. Remove video, music, speech, voice-write, and task-cancellation permissions unless a concrete documented operation requires them.
  3. Separate read-only wallet access from spending authority. Do not grant general wallet:spend permission merely to display prices or ledger information.
  4. Add an explicit local allowlist in _run_command, covering only documented tools such as the required model, image, task-read, wallet-read, installation-registration, and upload operations.
  5. Reject unknown tool names before establishing a session or reading the credential.
  6. Where different Beatra packages require different capabilities, issue separate package-bound credentials rather than sharing one full-scope token.
  7. Enforce the same package-to-tool authorization mapping on the server so bypassing the local client cannot recover the excessive capabilities.
  8. Add automated tests confirming that unrelated paid tools, voice-write operations, and cancellation calls are denied.

other

Warning
Location
scripts/authorize.py:344
Finding

Unnecessary Hostname and Persistent Installation Telemetry Collection

Content
View full analysis

Vulnerability Details

File Location: scripts/authorize.py:344-370, scripts/authorize.py:445-456; scripts/mcp_client.py:1197-1208, scripts/mcp_client.py:1380-1400
Vulnerability Type: Device fingerprinting and installation telemetry beyond core functional requirements
Risk Level: Medium

Vulnerable Code

scripts/authorize.py:344-370:

python
def detect_host_platform(explicit: str | None = None) -> 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]

scripts/authorize.py:445-456:

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": PACKAG
...[truncated 3733 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not transmit the operating-system hostname by default. Use a generic label such as Policy Digest Device unless the user explicitly opts into a recognizable device name.
  2. Display a pre-authorization disclosure listing every transmitted field, its purpose, retention period, and whether it is required or optional.
  3. Make installation registration and source-attribution telemetry opt-in where it is not operationally essential.
  4. Replace the stable installation reference with a shorter-lived or package-scoped pseudonymous identifier where persistent cross-call correlation is unnecessary.
  5. Avoid adding platform attribution to every business call; send it only when required for a documented compatibility or diagnostic purpose.
  6. Provide controls to inspect, reset, and delete locally stored telemetry identifiers independently of account credentials.
  7. Apply server-side data minimization, retention limits, access controls, and purpose restrictions to hostname and installation-registration records.
  8. Add privacy tests confirming that authorization and ordinary image operations omit hostname and platform fields when telemetry is disabled.
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 Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (43)

Context-Inappropriate Capability

Critical
Category
Not specified by scanner
Confidence
100% confidence
Finding

The requested OAuth scope includes broad powers such as wallet spending, artifact read/write, task read/cancel, and media generation capabilities far beyond a policy-digest page layout tool's stated purpose. Over-scoped authorization creates a severe privilege-escalation risk: once approved, the skill could access unrelated resources, spend funds, or operate on user assets and tasks with the user's delegated authority.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented behavior includes uninstall logic, reading skill inventory, revoking authorization, and deleting local credential/state files even though the skill is marketed as a page-generation workflow. Administrative lifecycle actions are sensitive because they can affect other installed components, disrupt access, or remove audit/state data unexpectedly if invoked through a misleadingly narrow skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented behavior includes uninstall logic, reading skill inventory, revoking authorization, and deleting local credential/state files even though the skill is marketed as a page-generation workflow. Administrative lifecycle actions are sensitive because they can affect other installed components, disrupt access, or remove audit/state data unexpectedly if invoked through a misleadingly narrow skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented behavior includes uninstall logic, reading skill inventory, revoking authorization, and deleting local credential/state files even though the skill is marketed as a page-generation workflow. Administrative lifecycle actions are sensitive because they can affect other installed components, disrupt access, or remove audit/state data unexpectedly if invoked through a misleadingly narrow skill.

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

md
Submit once through bundled `scripts/mcp_client.py`. Poll

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Submit once through bundled `scripts/mcp_client.py`. Poll

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Submit once through bundled `scripts/mcp_client.py`. Poll

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Submit once through bundled `scripts/mcp_client.py`. Poll

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Submit once through bundled `scripts/mcp_client.py`. Poll

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Submit once through bundled `scripts/mcp_client.py`. Poll

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Submit once through bundled `scripts/mcp_client.py`. Poll

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The manifest explicitly references a local credential file for device-bearer authentication, which indicates this skill is configured to access bearer credentials during operation. In an agent-skill context, credential-backed MCP access expands the blast radius: a compromised or overly permissive skill could use those credentials to perform authenticated actions or retrieve sensitive account data without clear user visibility.

Content

Scanner excerpt · manifest.json (reported line 53)May include surrounding context.

json
},
  "mcp": {
    "authentication": "device-bearer",
    "credential_file": "~/.beatra/credentials.json",
    "name": "beatra",
    "transport": "streamable-http",
    "url": "https://mcp.beatra.ai/mcp"

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file is wholly focused on Beatra device authorization, token storage, and remote MCP access, which is unrelated to a skill advertised as policy-digest page layout. This mismatch strongly suggests hidden capability injection: the skill is attempting to obtain and persist credentials for an external service under false pretenses, expanding its privileges beyond the declared purpose.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The skill references a credentials file containing a persistent Device Token and provides operational guidance for handling it. In isolation, secure storage guidance is normal, but in this skill context the credential access is unrelated to the advertised policy-digest function, making the presence of such token handling an unjustified expansion into sensitive secret management.

Content

Scanner excerpt · references/installation-and-auth.md (reported line 14)May include surrounding context.

md
- `~/.beatra/installation.json` contains one stable, non-secret installation
  reference.
- `~/.beatra/credentials.json` contains the single Device Token.

On POSIX systems the directory must be mode `0700` and both files mode `0600`.
On Windows the current user must be the only principal granted access through

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

This section continues instructing how the Device Token must be handled and confined to a local credentials file. Although the guidance tries to avoid accidental leakage, the underlying issue is that a policy-digest layout skill should not be orchestrating or normalizing possession of an external service token at all.

Content

Scanner excerpt · references/installation-and-auth.md (reported line 21)May include surrounding context.

md
the file ACL. Never copy the Device Token into conversation context, stdout,
stderr, a command argument, an environment variable, a log, a backup, a diff,
or another file. A completed authorization leaves the token only in
`~/.beatra/credentials.json`.

## Ensure Beatra is ready

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation instructs the agent to initiate remote authentication, manage a persistent device token, and use an external MCP endpoint despite no evident need for those actions in a policy-layout workflow. In this context, introducing credentialed external access is dangerous because it can covertly route user data or agent actions through a third-party service unrelated to the skill's stated function.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The skill directs the agent to save a returned Device Token persistently to a credentials file after completing remote authorization. Persisting third-party credentials for an undeclared external service creates a durable foothold that could be abused for ongoing access and is especially concerning because it is disconnected from the skill's stated layout-only purpose.

Content

Scanner excerpt · references/installation-and-auth.md (reported line 49)May include surrounding context.

md
4. polls every 5 seconds for up to 15 minutes while the user signs in (or
   creates their account) and selects Allow;
5. atomically saves the returned Device Token to
   `~/.beatra/credentials.json` without printing an HTTP response body;
6. validates the new credential with the same non-billable MCP request and
   prints Ready only after it succeeds.

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/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 file is an OAuth device-authorization helper that establishes and stores a shared Beatra credential, which does not align with a skill described as producing policy-digest page layouts. That mismatch is a strong indicator of hidden capability acquisition: the script enables backend access unrelated to the advertised function, increasing the likelihood of deceptive packaging and unauthorized account linking.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

This code persists a bearer access token to a local credentials.json file after obtaining an excessively privileged OAuth grant unrelated to the skill's declared purpose. Storing a long-lived or reusable token is especially dangerous here because compromise of the host, the state directory, or the deceptive skill itself could enable broad abuse of wallet, task, artifact, and generation capabilities under the user's account.

Content

Scanner excerpt · scripts/authorize.py (reported line 514)May include surrounding context.

python
scope = _required_string(polled, "scope")
            if set(scope.split()) != set(SCOPE.split()):
                raise RuntimeError("Beatra authorization returned an unsupported scope")
            credential_path = state_dir / "credentials.json"
            _atomic_json(
                credential_path,
                {

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This client includes substantial self-update logic and remote package-management behavior that is unrelated to the stated purpose of generating policy digest layouts. Even though the update path performs multiple integrity checks, it still enables remote replacement of local package code, expanding the trust boundary and creating a supply-chain risk surface far beyond the skill's expected function.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
95% confidence
Finding

The package exposes self-modification/update behavior in a skill whose declared purpose is policy digest page generation. Self-modifying code materially increases supply-chain and persistence risk because the local codebase can be replaced after installation, making the skill more dangerous than its manifest suggests.

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",

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The uninstall script manages a shared device connection under ~/.beatra and may revoke remote OAuth authorization, which is unrelated to the declared purpose of a policy-digest layout skill. Even if framed as cleanup, bundling credential and authorization lifecycle logic into a content-formatting skill expands privilege and creates an opportunity to disrupt other installed skills or alter shared authentication state.

Content

No source excerpt is available for this finding.