Back to skill

Security audit

MagicHaqi Operator

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent as an owner-only MagicHaqi operator, but it asks for long-running mutation authority while using a URL token and ambiguous remote telemetry.

Review before installing. Use this only in an owner-controlled MagicHaqi workspace, avoid putting real tokens in URLs, clarify or disable sdk.remoteLog unless you intentionally want remote telemetry in analytics, and run local content/state writes through a review or staging workflow before publishing or committing generated files.

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
PLAYBOOK.md:6
Finding

Authentication Token Exposed Through URL Query Parameter

Content
View full analysis

Vulnerability Details

File Location: PLAYBOOK.md, lines 6–10
Vulnerability Type: Authentication token exposure through a URL
Risk Level: Medium

Vulnerable code snippet:

markdown
## Pre-flight (every tick)
1. Ensure logged in: open `MagicHaqi.html?token=<TOKEN>&agent=haqi-operator`,
   check `getState().loggedIn === true`.
2. Load ops memory: read `agent/ops-state.json` (create with zeros if missing).
3. Read recent `agent/audit.log` (last ~30 lines) and current `getState()`.

Technical Analysis

The playbook instructs the operator to place an authentication token in the token URL query parameter. Although the documented value is a placeholder rather than a hardcoded credential, following this instruction with a real token can expose that credential through browser history, copied URLs, screenshots, diagnostic data, reverse-proxy or web-server access logs, and monitoring systems that record complete URLs.

Query parameters can also be propagated in referrer information when the page loads or navigates to another resource, depending on the application's Referrer-Policy, browser behavior, and destination. Any party with access to one of these disclosure channels could recover the token. Whether the token can then be replayed is dependent on authentication behavior in the MagicHaqi application, which is outside the audited project.

Attack Path

  1. The operator replaces the documented <TOKEN> placeholder with a valid authentication token.
  2. The operator opens the resulting URL in a browser as instructed.
  3. The complete URL is retained by browser history or recorded by infrastructure, telemetry, screenshots, or logs.
  4. An attacker with access to one of those records obtains the query-string token.
  5. If the application accepts bearer-token replay, the attacker submits the exposed token to impersonate the associated operator until the token expires or is revoked.

...[truncated 418 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not transmit authentication credentials in URL query parameters.
  • Establish the authenticated session using a secure mechanism such as an Authorization header or a Secure, HttpOnly, and appropriately configured SameSite cookie.
  • Change the playbook to direct the operator to the URL without a token, for example MagicHaqi.html?agent=haqi-operator, after authentication has been completed through the approved login flow.
  • Apply a restrictive Referrer-Policy, such as no-referrer, as defense in depth; this does not make query-string credentials safe.
  • Configure servers, proxies, analytics tools, and error-reporting systems to redact sensitive parameters from existing records.
  • Rotate any real tokens previously passed in URLs, use short-lived scoped credentials, and reject token replay where possible.
  • Add automated checks that flag credential-like query parameters in skill instructions and configuration.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The task explicitly states 'local sources only' but also permits reading sdk.remoteLog, which introduces an external telemetry source into an allegedly local-only analytics flow. In an autonomous operator skill with persistent state and recurring execution, this discrepancy can enable unintended data collection, privacy boundary violations, or reliance on untrusted remote input when making operational decisions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation contradicts itself by labeling all sources as local while listing sdk.remoteLog, creating ambiguity about data provenance and trust boundaries. In a live website operator agent, such ambiguity is dangerous because reviewers and future maintainers may assume data stays on-device while the agent actually ingests remote telemetry, weakening privacy review and threat modeling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The task describes collecting supplementary telemetry from sdk.remoteLog without any user-facing privacy disclosure or consent boundary. Because this skill operates continuously and writes derived analytics into persistent agent state, undisclosed telemetry use can expose behavioral data or expand monitoring beyond what operators or affected users expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The task grants broad authority to produce and modify repository content on a recurring basis without clear invocation boundaries, approval gates, or stop conditions. In an autonomous operator skill, vague scope increases the chance of unintended actions, drift into unreviewed content generation, and misuse of local tools and state files beyond what a user explicitly requested.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The task explicitly instructs the agent to save generated artifacts, update index files, and increment operational state, but provides no user-facing notice or approval requirement before modifying repository data. In the context of a live autonomous operator that maintains its own state, this creates a real risk of silent, repeated filesystem changes, accidental corruption, and unreviewed content being committed into production-managed directories.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown playbook directs the skill to create agent/ops-state.json if missing and later read/write multiple local log and state files. The document does not explicitly warn the user that running the playbook will modify files on disk, which is a user-impacting behavior relevant under the markdown warning criterion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The content lane instructs the agent to save generated artifacts into folders like minigames/, famous-pets/, famous-planets/, and pet-story/. Although this is part of the workflow, the markdown does not disclose to the user that execution will create or overwrite content files in these locations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The analytics and post-tick steps require writing KPI summaries and per-tick journal entries, as well as updating agent/ops-state.json. For a long-running loop, persistent logging is a behavior that can affect user data/storage and should be disclosed in the markdown description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The task explicitly instructs the agent to save generated marketing artifacts under agent/marketing/ and modify agent/ops-state.json, but it does not clearly foreground that these are persistent user/workspace changes requiring operator awareness. In an autonomous operator skill, silent writes to local state can create unexpected side effects, audit gaps, or accidental accumulation of content and state changes over time.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.