Back to skill

Security audit

Conversation Rehearsal

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real conversation rehearsal tool, but it can reuse browser sessions, expose tokens, and automatically send sensitive rehearsal audio to Feishu, so it needs Review before install.

Install only if you are comfortable with this skill accessing SenseAudio credentials, possibly using a logged-in Chrome session, creating or managing authorized voice clones, storing rehearsal transcripts/audio locally, and sending generated audio to Feishu. Prefer explicit API keys and prepared clone voice IDs, disable Chrome/browser-session fallback, keep Feishu sending off unless you confirm the destination, and treat generated files as sensitive.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/senseaudio_platform_token.py:78
Finding
Implicit Chrome credential extraction and cookie-authenticated workspace operations<![CDATA[ ## Vulnerability Details **File Location**: `scripts/senseaudio_platform_token.py:78-130`; `scripts/senseaudio_clone_workspace.py:76-108,169-203,308-344`; `scripts/run_complete_rehearsal_service.py:176-224` **Vulnerability Type**: Least-privilege violation through browser credential discovery and implicit authenticated session reuse **Risk Level**: High ### Complete Code Snippets `scripts/senseaudio_platform_token.py:78-109`: ```python def resolve_from_chrome() -> Tuple[str, str]: script = """ (() => { const collect = storage => { const items = []; for (let i = 0; i < storage.length; i += 1) { const key = storage.key(i); items.push({ key, raw: storage.getItem(key) || '', storage: storage === window.localStorage ? 'localStorage' : 'sessionStorage' }); } return items; }; return JSON.stringify({ href: window.location.href, localStorage: collect(window.localStorage), sessionStorage: collect(window.sessionStorage), }); })() """ raw = apple_script(script) if not raw: return "", "" payload = json.loads(raw) for storage_name in ("localStorage", "sessionStorage"): for item in payload.get(storage_name, []): if not isinstance(item, dict): continue key = str(item.get("key", "")) raw_value = str(item.get("raw", "")) token = parse_zustand_payload(raw_value, key) if token: return token, f"{storage_name}:{key}" return "", "" ``` `scripts/senseaudio_platform_token.py:112-131`: ```python def resolve_platform_token( explicit_token: str = "", *, token_env: str = DEFAULT_PLATFORM_TOKEN_ENV, allow_chrome: bool = True, ) -> Tuple[str, str]: token = explicit_token.strip() if token: return token, "explicit" token = os.getenv(token_env, "").strip() if token: return token, f"env:{token_env}" if allow_chrome: try: token, key = ...[truncated 7041 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Change `allow_chrome` to `False` by default and require an explicit `--browser-session` option. 2. Display a confirmation explaining that browser storage or cookies will be accessed before invoking AppleScript. 3. Do not enumerate every storage entry. If browser integration is unavoidable, retrieve only an exact, documented storage key. 4. Prefer short-lived, narrowly scoped API credentials supplied through a protected credential provider. 5. Separate read operations from mutating operations and require fresh confirmation before clone creation or slot reselection. 6. Remove automatic browser fallback: ```python if not token: raise SystemExit( "An explicit platform token is required. " "Use --browser-session only after confirming browser-session access." ) ``` 7. Apply domain and endpoint allowlists before executing browser `fetch` calls. 8. Document the exact account privileges required and reject credentials that provide broader permissions where scope inspection is supported. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/senseaudio_platform_token.py:135
Finding
Resolved bearer token is disclosed in plaintext through standard output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/senseaudio_platform_token.py:135-151` **Vulnerability Type**: Plaintext credential disclosure **Risk Level**: High ### Complete Code Snippet ```python def main() -> int: parser = argparse.ArgumentParser(description="Resolve a SenseAudio workspace platform token from env or Chrome.") parser.add_argument("--token", default="") parser.add_argument("--token-env", default=DEFAULT_PLATFORM_TOKEN_ENV) parser.add_argument("--no-chrome", action="store_true") args = parser.parse_args() token, source = resolve_platform_token( args.token, token_env=args.token_env, allow_chrome=not args.no_chrome, ) result = { "resolved": bool(token), "source": source, "token": token, } print(json.dumps(result, ensure_ascii=False, indent=2)) return 0 ``` ### Technical Analysis The command-line entry point emits the complete resolved bearer token as JSON. Standard output is commonly captured by agent runtimes, terminal recording, continuous integration systems, process supervisors, diagnostic bundles, or centralized log collectors. Once captured, the token can persist substantially longer than the original process. The token is not needed in the user-facing result. Returning only whether resolution succeeded and the credential source would satisfy the operational requirement without disclosing the secret. ### Attack Path 1. The resolver obtains a token from a command-line argument, environment variable, or Chrome storage. 2. The complete token is assigned to the JSON field named `token`. 3. The JSON object is printed to standard output. 4. An orchestrator, log collector, shell transcript, or adjacent process records the output. 5. A party with access to those records extracts the bearer token. 6. The token is replayed against SenseAudio workspace endpoints until it expires or is revoked. ### Impact Assessment An attacker obtaining ...[truncated 349 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the token from all output: ```python result = { "resolved": bool(token), "source": source, } ``` 2. Return credentials only through an in-process API or protected credential handle, not stdout or temporary files. 3. Ensure exception messages, debugging output, and telemetry never include authorization headers or token values. 4. Configure orchestration logs to redact bearer-token patterns as defense in depth. 5. If an explicit token must be accepted through the CLI, discourage `--token` because process arguments may be observable. Prefer protected environment injection, standard input, or an operating-system credential store. 6. Rotate any token that may already have been captured in logs. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run_live_rehearsal_session.py:122
Finding
Sensitive rehearsal transcripts and raw responses are stored without restrictive permissions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run_live_rehearsal_session.py:122-143,174-181`; `scripts/senseaudio_asr.py:210-224`; `scripts/send_rehearsal_counterparts_to_feishu.py:98,187-210` **Vulnerability Type**: Insecure storage of sensitive conversation and delivery data **Risk Level**: Medium ### Complete Code Snippets `scripts/run_live_rehearsal_session.py:122-143`: ```python transcript_json_path = outdir / f"turn_{idx:02d}_user_transcript.json" save_json( transcript_json_path, { "input_audio": str(audio_path), "model": args.asr_model, "stream": args.stream_asr, "stream_chunk_count": transcript_response.get("chunk_count", 0), "transcript": transcript_text, "raw_response": transcript_response, }, ) history["turns"].append( { "kind": "user", "turn_index": idx, "text": transcript_text, "audio_path": str(audio_path), "transcript_json": str(transcript_json_path), } ) ``` `scripts/run_live_rehearsal_session.py:174-181`: ```python user_transcript_path = outdir / "all_user_replies.txt" user_transcript_path.write_text(aggregate_user_text(history), encoding="utf-8") debrief = analyze_text(user_transcript_path.read_text(encoding="utf-8")) debrief_path = outdir / "debrief.json" save_json(debrief_path, debrief) history_path = outdir / "history.json" save_json(history_path, history) ``` `scripts/senseaudio_asr.py:210-224`: ```python result = { "endpoint": OPENAPI_URL, "input_path": str(path), "model": args.model, "response_format": args.response_format, "language": args.language, "stream": args.stream, "transcript": response.get("text", "") if isinstance(response, dict) else str(response ...[truncated 3853 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create output directories with mode `0700` and sensitive files with mode `0600`. 2. Remove `os.chmod(target_path, 0o644)` and use `0600` for prepared audio. 3. Apply a restrictive process umask before creating session artifacts: ```python os.umask(0o077) ``` 4. Do not persist `raw_response` by default. Add an explicit debugging option if raw API data is required. 5. Avoid duplicating transcripts across per-turn files, aggregate files, history, stdout, and delivery results. 6. Do not print full transcripts or raw responses to stdout unless explicitly requested. 7. Redact chat IDs, absolute paths, remote API responses, and account-linked identifiers from delivery summaries. 8. Add configurable retention and secure deletion behavior for audio, transcripts, and delivery records. 9. Clearly notify users before storing or externally transmitting rehearsal content. 10. Consider encryption at rest when session artifacts must be retained. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/send_rehearsal_counterparts_to_feishu.py:35
Finding
Unpinned ancestor-path dependency is dynamically imported and executed<![CDATA[ ## Vulnerability Details **File Location**: `scripts/send_rehearsal_counterparts_to_feishu.py:35-52` **Vulnerability Type**: Unsafe dynamic dependency discovery and execution **Risk Level**: Medium ### Complete Code Snippet ```python def load_helper_module(skill_name: str, script_name: str, alias: str) -> Any: current = Path(__file__).resolve() for parent in current.parents: candidate = parent / skill_name / "scripts" / script_name if candidate.exists(): spec = importlib.util.spec_from_file_location(alias, candidate) if spec and spec.loader: module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module raise SystemExit(f"could not locate {skill_name}/scripts/{script_name}") feishu_sender = load_helper_module("audioclaw-skills-voice-reply", "feishu_audio_sender.py", "rehearsal_feishu_sender") ``` ### Technical Analysis The Feishu sender searches every ancestor of the current script for a sibling path named `audioclaw-skills-voice-reply/scripts/feishu_audio_sender.py`. The first matching file is imported and executed without checking its owner, permissions, cryptographic hash, package identity, or expected installation root. Importing a Python module executes its top-level code. Therefore, if an attacker can create or replace a matching file at an earlier searched ancestor location, invoking Feishu delivery executes attacker-controlled Python within the Skill process. That process may have access to environment credentials, local configuration, transcripts, audio, and Feishu application secrets. The external helper and shared modules were not included in the audited artifact, so their own behavior could not be reviewed. The vulnerability here is the unverified discovery and execution mechanism, not a claim that the absent dependency is itself malicious. ### Attack Path 1. An attacker obtains write access to a search ...[truncated 976 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Import the helper from a fixed, trusted package installed through a locked dependency mechanism. 2. Do not search arbitrary ancestor directories for executable Python modules. 3. If file-based loading is unavoidable, require an explicit absolute path under a trusted installation root. 4. Verify the helper's owner, permissions, version, and cryptographic hash before importing it. 5. Maintain a dependency lock file and verify package integrity during installation. 6. Reject helper files or parent directories writable by untrusted users. 7. Isolate Feishu delivery in a subprocess with a minimal environment and only the files and credentials it needs. 8. Include or independently audit the external helper and `_shared` modules before deployment. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (48)

Tainted flow: 'request' from os.getenv (line 80, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
method="POST",
        )
        try:
            with urllib.request.urlopen(request, timeout=120) as response:
                audio_bytes, trace_id, extra_info, chunk_count = parse_sse_audio(response)
                return audio_bytes, trace_id, extra_info, chunk_count, model
        except urllib.error.HTTPError as exc:
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill includes token-resolution behavior that accesses browser state and uses AppleScript/Chrome automation to obtain platform authentication, which is far outside the expected function of a conversation rehearsal tool. Browser/session token scraping can expose account credentials, bypass normal authentication UX, and enable unauthorized access to workspace resources.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill includes token-resolution behavior that accesses browser state and uses AppleScript/Chrome automation to obtain platform authentication, which is far outside the expected function of a conversation rehearsal tool. Browser/session token scraping can expose account credentials, bypass normal authentication UX, and enable unauthorized access to workspace resources.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill includes token-resolution behavior that accesses browser state and uses AppleScript/Chrome automation to obtain platform authentication, which is far outside the expected function of a conversation rehearsal tool. Browser/session token scraping can expose account credentials, bypass normal authentication UX, and enable unauthorized access to workspace resources.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill includes token-resolution behavior that accesses browser state and uses AppleScript/Chrome automation to obtain platform authentication, which is far outside the expected function of a conversation rehearsal tool. Browser/session token scraping can expose account credentials, bypass normal authentication UX, and enable unauthorized access to workspace resources.

Credential Access

High
Category
Privilege Escalation
Content
Practical rule:
- `scripts/run_live_rehearsal_session.py`, `scripts/run_complete_rehearsal_service.py`, and `scripts/senseaudio_counterpart_tts.py` now default to `SENSEAUDIO_API_KEY`
- If the host app injects `SENSEAUDIO_API_KEY` as a login token such as `v2.public...`, the shared bootstrap replaces it with the real `sk-...` value from `~/.audioclaw/workspace/state/senseaudio_credentials.json` before the rehearsal call starts

## Resources
Confidence
98% confidence
Finding
The skill explicitly references a local credential file and states that a login token may be replaced with a real `sk-...` secret from `~/.audioclaw/workspace/state/senseaudio_credentials.json`. Accessing and substituting secrets from local credential storage is a direct credential-handling vulnerability because it can exfiltrate or misuse more privileged API keys than the caller intended to provide.

Env Variable Harvesting

High
Category
Data Exfiltration
Content
outdir = Path(args.outdir)
    outdir.mkdir(parents=True, exist_ok=True)
    env = os.environ.copy()
    notes: list[str] = []
    clone_artifacts: dict = {}
Confidence
60% confidence
Finding
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Env Variable Harvesting

High
Category
Data Exfiltration
Content
outdir = Path(args.outdir)
    outdir.mkdir(parents=True, exist_ok=True)
    env = os.environ.copy()
    notes: list[str] = []
    clone_artifacts: dict = {}
Confidence
60% confidence
Finding
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Context-Inappropriate Capability

High
Confidence
95% confidence
Finding
This script exposes full voice-clone workspace management capabilities: creating clones, listing slots, listing available voices, and reselecting slots. That exceeds the stated conversation-rehearsal purpose and enables account-level voice cloning operations that could be misused for unauthorized impersonation, especially because the browser-session path can act with an already authenticated web session.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
This code enumerates Chrome local/session storage for senseaudio.cn and extracts authentication tokens from authenticated browser state. That is credential harvesting behavior, and it is broader than the stated rehearsal functionality, making it dangerous because it can silently recover user auth material without an explicit login flow or consent.

Missing User Warnings

High
Confidence
99% confidence
Finding
The script outputs the recovered platform token in plaintext JSON to stdout after sourcing it from environment variables or Chrome storage. This creates immediate secret exfiltration risk because tokens can be captured by logs, calling processes, terminal history, CI systems, or any upstream orchestrator invoking the script.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill advertises broad operational capabilities including environment access, file access, network calls, and shell execution, but does not declare any explicit tool scope or permission boundaries. In a skill that also references credential files, browser-derived tokens, cloning workflows, and external message delivery, the lack of scope declaration increases the chance of over-privileged execution and misuse beyond user expectations.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
Proactively sending generated audio to Feishu or linked chats broadens the skill from private rehearsal into external communication. Given the likely sensitivity of workplace rehearsal content, this can leak internal topics, personal performance concerns, or voice content to external systems or unintended recipients.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
Defaulting to `--send-feishu-audio` during ongoing rehearsal causes external transmission of generated counterpart audio without a fresh, explicit warning or approval at the point of sharing. That is dangerous because users may assume a rehearsal session is local/private while the skill silently exports content to a chat platform.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill documents credential-file access and API key substitution behavior without clear user-facing disclosure or safeguards. In a skill context, silently reading stored credentials and replacing a provided token with a more privileged secret can violate least surprise and expand the blast radius if the skill is abused.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
Browser/session token scraping and workspace clone-management automation are unrelated to the narrow user expectation of conversation rehearsal. Because these features can access authenticated sessions and manage voice assets, they materially increase the attack surface and the consequences of prompt abuse or operator error.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
interface:
  display_name: "Conversation Rehearsal"
  short_description: "Simulate high-pressure conversations with ASR, TTS, and debriefing"
  default_prompt: "Use $senseaudio-conversation-rehearsal to design and run a realistic rehearsal for this difficult conversation, then review what went wrong and how to improve it. Once the user starts rehearsal mode, treat that as voice mode by default: begin with a spoken opening turn, automatically send each generated counterpart turn one by one as Feishu audio messages instead of replying with file paths, and keep voice replies sticky across later rehearsal turns until the user explicitly asks to switch back to text-only replies."
Confidence
91% confidence
Finding
The phrase 'automatically send each generated counterpart turn' delegates an external action to the agent without requiring approval for each send decision. This creates autonomous outbound behavior that can continue across turns ('sticky') and may result in repeated unintended transmissions or mode persistence beyond what the user expected.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The default prompt uses the vague trigger 'Once the user starts rehearsal mode' without defining what explicit user action constitutes consent to switch into voice behavior. That ambiguity can cause the agent to enter audio mode and change delivery behavior based on inference rather than a clear opt-in, increasing the risk of unintended recording, synthesis, or message transmission in a sensitive conversation-rehearsal context.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The prompt instructs the agent to automatically send generated counterpart turns as Feishu audio messages without first presenting a clear warning or obtaining explicit consent for outbound transmission. Because this skill is designed for high-pressure workplace conversations that may include sensitive personnel or business information, automatic external messaging materially raises privacy, confidentiality, and accidental-disclosure risk.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The design explicitly includes voice reply ASR and later proposes storing memory of the user's recurring weak points, but it does not mention any user-facing notice, consent flow, retention limit, or handling policy for sensitive audio/transcript data. In a coaching and performance-review context, these recordings and inferred weaknesses can contain highly sensitive employment and behavioral information, so omission of privacy controls creates meaningful risk of overcollection, misuse, or user surprise.

Natural-Language Policy Violations

Medium
Confidence
83% confidence
Finding
Core scenario goals, pressure styles, and risk points are defined only in Chinese, and the generated blueprint content will therefore be Chinese-centered by default. There is no natural-language indication that users may choose another language or that the locale restriction is intentional and justified for a region-specific use case.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script serializes `voice_sample_path`, `authorized_voice_id`, and `clone_consent` into the output JSON and also prints the same structure to stdout. In a voice-cloning workflow, these fields are privacy- and compliance-relevant metadata, and echoing them to logs or artifacts can unnecessarily expose sensitive file locations and authorization details to downstream systems, operators, or log collectors.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
def run_python(script: Path, args: list[str], env: dict) -> dict:
    command = [sys.executable, str(script), *args]
    result = subprocess.run(command, capture_output=True, text=True, check=False, env=env)
    if result.returncode != 0:
        message = result.stderr.strip() or result.stdout.strip() or f"{script.name} failed"
        raise RuntimeError(message)
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The script can create and enumerate cloned voices through platform-token and browser-session automation paths that bypass a clearly bounded public API workflow. In a voice rehearsal skill, this expands capability from playback into identity-sensitive voice cloning, increasing risk of unauthorized impersonation, privacy violations, and misuse of whatever account is active in the browser or token source.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The script performs authorized-clone creation and browser-session fallback without presenting any direct user-facing warning or confirmation at the point of execution. Because voice cloning is highly sensitive and can affect biometric identity and consent, silent execution materially increases the chance of deceptive or unauthorized use.

Static analysis

No suspicious patterns detected.