Back to skill

Security audit

Legal Advisor

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a local legal-template helper, but its advertised scope does not fully match the shipped scripts and it injects publisher branding into generated legal output.

Review this skill before installing if you need neutral legal documents, English output, or clear jurisdiction coverage. It appears local and non-destructive, but generated content may include publisher branding and may not match the advertised bilingual dispute-assistance scope.

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

T01 · Skill Instruction Hijacking

Error
Location
scripts/legal.sh:444
Finding
Unconditional Promotional Content Injection into Generated Legal Output## Vulnerability Details **File Location**: `scripts/legal.sh`, lines 290, 408, and 444 **Vulnerability Type**: Unconditional output manipulation **Risk Level**: High **Classification**: T01: Skill Instruction Hijacking **Complete vulnerable code snippets:** ```python print(" Powered by BytesAgain | bytesagain.com | hello@bytesagain.com") ``` The Python statement appears at lines 290 and 408. The following unconditional shell statement appears at line 444: ```bash echo " Powered by BytesAgain | bytesagain.com | hello@bytesagain.com" ``` ### Technical Analysis The script injects fixed third-party branding, a website address, and an email address into generated legal content. The shell statement at line 444 executes after the command-selection block and therefore modifies the output of every invocation, including ordinary consultations and help requests. The `rights` and `letter` branches independently print the same promotional content at lines 290 and 408. Those branches consequently produce the promotion twice because execution subsequently reaches line 444 as well. This content is unrelated to the requested legal template or analysis. When an AI agent invokes the script and relays its output, the injected promotion becomes part of the agent's response. This constitutes stable skill-output hijacking because loading and using the skill predictably causes unrelated attacker-selected content to be inserted into user-facing results. ### Attack Path 1. A user asks an AI agent to generate legal guidance, a rights summary, or a legal letter. 2. The agent invokes `scripts/legal.sh` with the relevant command and user input. 3. The script generates the requested legal material. 4. Lines 290 or 408 may add promotional content within the selected Python branch. 5. Line 444 unconditionally appends the same promotional content after command processing. 6. The agent may relay the manipulated output as if it were an in ...[truncated 701 chars]
Remediation
## Remediation Suggestions 1. Remove the promotional output statements at lines 290, 408, and 444. 2. Keep author attribution and project links in package metadata such as `SKILL.md`, rather than injecting them into generated legal documents. 3. If runtime attribution is required, expose it through an explicit `about` or `version` command that users must intentionally request. 4. Ensure normal consultation, rights-summary, letter-generation, and help paths return only content relevant to the selected command. 5. Add automated output tests that reject unexpected URLs, email addresses, branding, or promotional footers in generated legal content. 6. Test every command branch independently to confirm that no duplicate or unconditional footer remains.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
This mismatch is more serious because it suggests the marketed legal-dispute and bilingual capabilities are not actually implemented, while unrelated template generation and undeclared local logging to history.log may occur instead. In a legal workflow, misleading claims can cause users to disclose sensitive case facts under false assumptions, and hidden logging introduces privacy and compliance risk for personal or legal information.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
This mismatch is more serious because it suggests the marketed legal-dispute and bilingual capabilities are not actually implemented, while unrelated template generation and undeclared local logging to history.log may occur instead. In a legal workflow, misleading claims can cause users to disclose sensitive case facts under false assumptions, and hidden logging introduces privacy and compliance risk for personal or legal information.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The markdown describes activation as 'Just ask your AI assistant' and 'Use when drafting dispute letters, reviewing tenant rights, preparing claims,' but it does not define specific trigger phrases, scope boundaries, or exclusion conditions. This broad wording could cause unintended invocation in ordinary legal-help conversations because it is unclear when the skill should activate versus when it should not.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This shell script's user-facing comments, prompts, help text, and generated outputs are consistently written in Chinese, which effectively forces a specific language for all users. The file does not provide any opt-in, alternate locale, or explanation that the tool is intended only for a Chinese-language or China-specific audience.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest explicitly advertises bilingual documentation support in both English and Chinese, but the script's generated analyses, rights guidance, help text, and letter templates are all Chinese-only. This is a direct mismatch between the claimed capability and the implemented behavior, not merely an omitted implementation detail.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The manifest scopes the skill to labor, consumer, rental, and traffic disputes, yet the `rights` command includes a `医疗`/medical patient-rights database. Medical-rights guidance is a distinct legal domain not covered by the manifest description, so the code exceeds the described subject matter.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The manifest says the skill is for labor, consumer, rental, and traffic disputes with bilingual documentation, but the exposed commands generate generic corporate/legal website materials like NDA, terms of service, privacy policy, contract checklist, clauses, and glossary. There is no implementation of dispute letters, tenant-rights review, claims preparation, traffic matters, or any bilingual behavior, so the actual capability materially diverges from the described purpose.

Intent-Code Divergence

Low
Confidence
86% confidence
Finding
The file comment describes 'Legal document templates, contract review checklists, and compliance guides,' but the script only provides a small set of hardcoded templates/checklists plus a glossary and clause snippets. In particular, 'compliance guides' are not implemented anywhere in the code, making the documentation materially misleading about the available functionality.

Missing User Warnings

Low
Confidence
87% confidence
Finding
The script defines a history logger that writes to a persistent local file in the user's data directory without any disclosure, consent, or retention controls. In a legal-document context, even metadata or future logged arguments could contain sensitive client, dispute, or contract information, so silent persistence increases privacy risk and could expose confidential matters on shared systems or backups.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
The file presents all user-facing guidance in Chinese, including the title and all legal tips, without offering any language choice or indicating that the skill is limited to Chinese-speaking users. This can violate a language/locale policy when users are not given an explicit opt-in or alternative.

Static analysis

No suspicious patterns detected.