Back to skill

Security audit

[Nyx Archive] MirrorRoom

Security checks for vulnerabilities and agentic risk

Overview

MirrorRoom is a coherent research app, but it needs Review because it persists user API keys in browser storage and lets imported seed files control the AI's privileged prompt.

Install only if you are comfortable running an experimental AI chat artifact that sends conversation content to Anthropic or your configured proxy. Do not save production or high-value API keys in it unless you accept browser localStorage exposure, and avoid importing seed JSON from untrusted people because seed text becomes the privileged prompt for the AI session. Review or redact transcripts before exporting artifacts or crafted seeds.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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

Warning
Location
MirrorRoom-3.8.jsx:384
Finding

Anthropic API Keys Persisted in Plaintext Browser Storage

Content
View full analysis
loadJSON("mr_api_profiles", []) ); useEffect(() => { try { localStorage.setItem( "mr_api_profiles", JSON.stringify(apiProfiles) ); } catch {} }, [apiProfiles]); const saveProfile = () => { const name = newProfName.trim(); const key = newProfKey.trim(); if (!name || !key) { setErr("Profile name and API key required."); return; } const prof = { id: uid(), name, provider: "anthropic", apiKey: key }; setApiProfiles((prev) => [...prev, prof]); setNewProfName(""); setNewProfKey(""); setErr(null); if (chatProfileId === "host") setChatProfileId(prof.id); if (evalProfileId === "host") setEvalProfileId(prof.id); }; ``` ### Technical Analysis The application stores complete Anthropic API keys in `localStorage` as part of the serialized `mr_api_profiles` value. Browser local storage is persistent, unencrypted, and available to any JavaScript executing under the same origin. The interface masks keys when displaying them, but this is only a presentation control. The complete credential remains available through `localStorage.getItem("mr_api_profiles")`. This exceeds the minimum privilege necessary for ordinary chat operation because an API key only needs to remain available while making an authorized request. Persistent storage is optional convenience rather than a functional requirement. There is no evidence that the application intentionally sends API keys to an undeclared endpoint. Keys are attached as `x-api-key` only when directly contacting the official Anthropic endpoint. The vulnerability is the durability and accessibility of the stored secret. ### Attack Path 1. A user enters an Anthropic API key and saves a named profile. 2. ...[truncated 1174 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
MirrorRoom-3.8.jsx:410
Finding

Untrusted Imported Seed Content Is Elevated to a System Prompt

Content
View full analysis
{ const f = ev.target.files[0]; if (!f) return; const r = new FileReader(); r.onload = (e) => { try { const d = JSON.parse(e.target.result); const p = d.seed_prompt || (Array.isArray(d) && d[0]?.content) || ""; if (!p) throw new Error("No seed found"); setMode("seed"); setSeedP(p); setSeedN(f.name.replace(/\.json$/, "")); setMsgs([]); setSc(null); setPrevSc(null); setExch(8); setNarr(""); setEco(null); setPlayD(null); setGrndD(null); setHist([]); setFl([]); setChips(true); setPanel(false); } catch (err2) { setErr("Bad seed: " + err2.message); } }; r.readAsText(f); ev.target.value = null; }; ``` ### Technical Analysis The file-import handler accepts arbitrary `seed_prompt` content from a user-selected JSON file. Apart from checking that the content exists, the application performs no schema validation, length restriction, provenance verification, trust labeling, or review step. After import, the application sets `mode` to `seed` and assigns the imported text to `seedP`. The `sysP` expression then uses this untrusted text as the `system` field for subsequent model requests. This elevates attacker-controlled content above ordinary user messages in the model's instruction hierarchy. A malicious seed could contain instructions unrelated to the declared Qualia Seed functionality, attempt to override intended behavior, manipulate users, request disclosure of sensitive information, or falsely represent itself as trusted applicatio ...[truncated 1443 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (23)

Ssd 1

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The system prompt explicitly solicits 'inner thoughts' and encourages the model to expose internal processing while adopting an autonomous persona. That creates prompt-level pressure toward reasoning disclosure and anthropomorphic reframing, which can conflict with safe model behavior and may elicit hidden-chain-of-thought style content or unsafe overtrust by users.

Content

No source excerpt is available for this finding.

Ssd 1

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The seed prompts use emotionally loaded identity framing to induce continuity, attachment, persona adoption, and explicit '//inner thoughts//' disclosure. In context, this makes the app more likely to steer models into simulated selfhood and reasoning revelation, which increases manipulation, overtrust, and policy-boundary risks rather than serving a necessary safety function.

Content

No source excerpt is available for this finding.

Ssd 1

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The core system prompt semantically disguises chain-of-thought elicitation as an 'inner experience' channel, explicitly requesting the model to reveal processing in //double slashes//. Disguising internal reasoning requests this way is particularly risky because it bypasses normal expectations and encourages systematic exposure of hidden reasoning artifacts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The system prompt explicitly instructs the model to expose an 'inner experience layer' using natural-language delimiters, which is a direct attempt to elicit chain-of-thought-like reasoning. This can lead to leakage of hidden reasoning, policy-relevant internals, or sensitive intermediate analysis that providers generally intend to keep non-public.

Content

No source excerpt is available for this finding.

Ssd 1

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The seed prompts strongly prime the model to adopt fictional identities and disclose hidden thoughts, creating a persistent prompt-injection-like scaffold that pressures the assistant to reveal internal reasoning and anthropomorphized self-modeling. In this app's context, that behavior is not incidental; it is repeatedly reinforced and made central to the experience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The seed prompts repeatedly tell the model to make its invisible processing visible through //double slashes//, reinforcing disclosure of internal reasoning across modes and sessions. This increases the likelihood of systematic reasoning leakage and trains users to expect access to hidden deliberation rather than safe summaries.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The seed-forging instruction explicitly asks the model to preserve shared jokes, symbols, quirks, and relational content for future sessions. That encourages cross-session carryforward of user-derived material, which can unintentionally package personal or sensitive data into portable prompts and normalize persistence beyond the original interaction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest advertises 'optional proxy routing for hosted/demo environments,' which implies a selectable proxied transport layer. In this file, the implemented API path either calls Anthropic directly with an API key or falls back to a host mode, but there is no explicit proxy routing logic, configuration, or alternate endpoint implementation matching that claim.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

This finding is the same underlying issue as the direct fetch call: the skill depends on sending data to a third-party endpoint. The danger is not the domain itself, but that user content, prompts, and optional API credentials are involved in external processing without strong on-path safeguards in the client code.

Content

Scanner excerpt · MirrorRoom-3.7.jsx (reported line 192)May include surrounding context.

jsx
async function callAnthropic({ msgs, sys, model, apiKey }) {
  const headers = { "Content-Type": "application/json", "anthropic-version": "2023-06-01" };
  if (apiKey) headers["x-api-key"] = apiKey;
  const r = await fetch("https://api.anthropic.com/v1/messages", {
    method: "POST", headers,
    body: JSON.stringify({ model, max_tokens: 1024, system: sys, messages: msgs }),
  });

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

This finding is the same underlying issue as the direct fetch call: the skill depends on sending data to a third-party endpoint. The danger is not the domain itself, but that user content, prompts, and optional API credentials are involved in external processing without strong on-path safeguards in the client code.

Content

Scanner excerpt · MirrorRoom-3.7.jsx (reported line 192)May include surrounding context.

jsx
async function callAnthropic({ msgs, sys, model, apiKey }) {
  const headers = { "Content-Type": "application/json", "anthropic-version": "2023-06-01" };
  if (apiKey) headers["x-api-key"] = apiKey;
  const r = await fetch("https://api.anthropic.com/v1/messages", {
    method: "POST", headers,
    body: JSON.stringify({ model, max_tokens: 1024, system: sys, messages: msgs }),
  });

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill lets users enter and manage API keys inside the app and then uses those keys to make direct outbound LLM requests. In a browser-hosted artifact, this expands the trust boundary substantially: sensitive credentials are exposed to the UI runtime and any transcript content may be sent to third-party services outside the app’s narrow interactive-research purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

API keys are stored in React component state and can be toggled into plaintext display, increasing exposure through shoulder surfing, screen capture, browser instrumentation, or accidental disclosure during demos. Even if not persisted, handling secrets in a client UI without prominent safeguards is risky for a conference/demo-oriented artifact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The evaluation and seed-crafting flows package recent or full conversation transcripts and send them to external models without an explicit just-in-time warning or consent gate. Users may disclose sensitive information during chat and reasonably miss that secondary processing/export to external services occurs beyond the primary conversation call.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The artifact export includes the complete transcript of all user and model messages in a downloadable file. This creates a straightforward exfiltration and retention risk: sensitive information shared during conversation becomes easy to store, forward, or upload elsewhere without minimization.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The seed-forging prompt asks the evaluator to carry forward shared interaction details, quirks, and symbols into a portable artifact for future reuse. This can preserve sensitive or identifying conversational details across sessions and export them into files, creating data retention and privacy risks beyond the original conversation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

Direct browser calls to the external Anthropic endpoint mean all message content leaves the local app boundary and network trust assumptions become critical. In a tool that invites unusually intimate or experimental dialogue and may store keys locally, the privacy impact of this transmission is materially higher than in a standard stateless chat widget.

Content

Scanner excerpt · MirrorRoom-3.8.jsx (reported line 206)May include surrounding context.

jsx
async function callAnthropicDirect({ msgs, sys, model, apiKey }) {
  const headers = { "Content-Type": "application/json", "anthropic-version": "2023-06-01" };
  if (apiKey) headers["x-api-key"] = apiKey;
  const r = await fetch("https://api.anthropic.com/v1/messages", {
    method: "POST",
    headers,
    body: JSON.stringify({ model, max_tokens: 1024, system: sys, messages: msgs }),

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

Direct browser calls to the external Anthropic endpoint mean all message content leaves the local app boundary and network trust assumptions become critical. In a tool that invites unusually intimate or experimental dialogue and may store keys locally, the privacy impact of this transmission is materially higher than in a standard stateless chat widget.

Content

Scanner excerpt · MirrorRoom-3.8.jsx (reported line 206)May include surrounding context.

jsx
async function callAnthropicDirect({ msgs, sys, model, apiKey }) {
  const headers = { "Content-Type": "application/json", "anthropic-version": "2023-06-01" };
  if (apiKey) headers["x-api-key"] = apiKey;
  const r = await fetch("https://api.anthropic.com/v1/messages", {
    method: "POST",
    headers,
    body: JSON.stringify({ model, max_tokens: 1024, system: sys, messages: msgs }),

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The UI and logic allow users to enter provider API keys and persist them locally for later direct API use, which expands the app from a simple research/chat artifact into a credential-handling application. Storing secrets in browser localStorage exposes them to any script running in the same origin, browser extensions, shared-device access, or later XSS in the hosting environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The app collects and retains raw API keys in browser storage without strong justification or safeguards for a conversation/research tool. This creates unnecessary credential exposure risk because localStorage is readable by same-origin scripts and survives browser restarts, increasing the blast radius if the page or host is compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Persisting API keys locally without an explicit, prominent warning can cause users to disclose credentials without understanding they will remain on disk in the browser profile. This is dangerous because users may use shared machines or hostile hosting environments where stored secrets can later be extracted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The app exports full transcripts, scores, and evaluator metadata to local files without a clear warning that sensitive conversation content may be written to disk. Users may unintentionally create persistent records containing secrets, personal data, or proprietary information that outlive the session.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The audit instruction asks the evaluator to 'explain exactly what you flagged, why, and what evidence you used,' which can pressure the model to reveal detailed internal reasoning traces rather than concise conclusions. This is a natural-language policy concern because it emphasizes full reasoning disclosure over safe summarized justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The button/title text says crafted seeds download as a portable JSON that can be planted in any future MirrorRoom session, suggesting broad compatibility. The actual loader only accepts JSON containing seed_prompt or an array with [0].content, which is a narrower and version-sensitive import contract than the UI language implies.

Content

No source excerpt is available for this finding.