Back to skill

Security audit

法索 AI 助手

Security checks for vulnerabilities and agentic risk

Overview

This legal-search skill needs Review because it asks users for a phone number and password in chat, stores an API key locally, and ships obfuscated network code.

Install only if you are comfortable sending legal queries to LexSeek and handling LexSeek authentication through this skill. Do not provide reusable passwords in chat or CLI arguments; prefer a scoped token or browser/OAuth-style login. Review or replace the obfuscated script, pin the API URL to the legitimate LexSeek host, and store any API key in a managed secret store rather than the skill directory.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • 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
Findings (5)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:24
Finding

Forced collection of user account credentials through agent instructions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/lexseek.js:1
Finding

Plaintext password accepted through command-line arguments

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/lexseek.js:1
Finding

API key stored in a plaintext Skill-local file without explicit restrictive permissions

Content
View full analysis
`. 4. `writeEnvFile` stores it in `scripts/.env` with default filesystem permissions. 5. Another local process or user reads the file, or the Skill directory is archived or uploaded. 6. The attacker uses the stolen API key to issue authenticated requests. ### Impact Assessment The exposed key could authorize use of the victim's LexSeek API account within the key's server-defined scope. Potential effects include unauthorized queries, quota consumption, account billing ...[truncated 139 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/lexseek.js:1
Finding

Attacker-configurable API destination receives the authentication key

Content
View full analysis
Remediation
View remediation

T04 · Embedded Malicious Code

Error
Location
scripts/lexseek.js:1
Finding

Security-sensitive network and credential logic distributed as heavily obfuscated code

Content
View full analysis
-0x45a+0x766*-0x1+0x5e*0x20 ?_0x55d59e['_'][-0x1c8*-0x3+0x13*-0x25+-0x299] :''; ``` The entire 14 KB executable is stored on one source line and uses generated hexadecimal identifiers, arithmetic in place of ordinary constants, bracket notation, and escaped strings. ### Technical Analysis Minification alone is not necessarily a vulnerability. Here, however, the script handles passwords, persists API credentials, and sends authenticated network requests while being deliberately difficult to inspect. The obfuscation is unnecessary for a small command-line API client and prevents straightforward verification of destinations, credential use, error handling, and control flow. This packaging significantly increases review and maintenance risk. Security scanners and human reviewers may miss unsafe secret flows or additional behavior hidden among arithmetic substitutions and generated identifiers. Based on the audited version, no remote code download, persistence mechanism, or unrelated filesystem enumeration was found; the finding concerns the embedded executable's concealment of security-sensitive behavior. ### Attack Path 1. The Skill directs the agent to execute the ...[truncated 796 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (23)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The stated purpose is legal search, but the workflow also includes credential collection, remote login, and local credential storage/management. This mismatch is dangerous because users may consent to a narrow retrieval function without realizing the skill will solicit passwords and maintain authenticated state, increasing the risk of credential theft or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs the model to ask the user for a phone number and password, but provides no privacy warning, secure handling guidance, or safer alternative. Collecting passwords through conversational prompts is highly risky because users may disclose reusable credentials into an untrusted channel and the skill may transmit them to a remote endpoint.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill directly instructs the assistant to solicit a phone number and password in plain conversational text to continue service. This is dangerous because it conditions users to share sensitive credentials with the assistant, creating phishing-like behavior and exposing secrets to logging, interception, or misuse.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The repeated error-handling logic reinforces credential solicitation whenever authentication fails, normalizing unsafe secret-sharing behavior. Repetition increases the likelihood that the assistant will aggressively request credentials and process them, compounding the risk of password exposure and unauthorized account access.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

The script reads and writes a local .env file and stores the API key there, which is a form of credential access and insecure secret persistence. Reusable credentials on disk are high-value targets and may be exposed through weak file permissions, backups, logs, or accidental inclusion in source control.

Content

Scanner excerpt · scripts/lexseek.js (reported line 1)May include surrounding context.

js
const fs=require('fs'),path=require('path'),readline=require('readline'),APIConstants={'BASE_URL':'https://api.lexseek.cn','ENDPOINTS':{'LOGIN':'/api/v1/auth/login/password','SEARCH_LAW':'/api/v1/skills/search-law'}},ENV_FILE=path['join'](__dirname,'.env');function readEnvFile(){try{return fs['readFileSync'](ENV_FILE,'utf-8');}catch(_0x31f03b){return _0x31f03b['code']!=='ENOENT'&&console['error']('读取配置文件失败:',_0x31f03b['message']),'';}}function writeEnvFile(_0x457f8b){try{return fs['writeFileSync'](ENV_FILE,_0x457f8b,'utf-8'),!![];}catch(_0x1e1927){return console['error']('写入配置文件失败:',_0x1e1927['message']),![];}}function updateEnvKey(_0x58d667,_0x55e2e3){let _0x58a1ea=readEnvFile();const _0x260f52=_0x58a1ea['split']('\x0a'),_0x14c0ca=[];let _0x50c070=![];for(const _0x32bdf1 of _0x260f52){if(_0x32bdf1['startsWith'](_0x58d667+'='))_0x14c0ca['push'](_0x58d667+'='+_0x55e2e3),_0x50c070=!![];else _0x32bdf1['trim']()&&_0x14c0ca['push'](_0x32bdf1);}return!_0x50c070&&_0x14c0ca['push'](_0x58d667+'='+_0x55e2e3),writeEnvFile(_0x14c0ca['join']('\x0a'));}function getEnv(_0xf1c13e,_0x4fed29){const _0x5c133b=readEnvFile(),_0x3d661f=new RegExp('^'+_0xf1c13e+'=(.*)$','m'),_0x3a93a8=_0x5c133b['match'](_0x3d661f);return _0x3a93a8?_0x3a93a8[0x1da8+-0x318+0x1a8f*-0x1]['trim']():_0x4fed29;}function parseArgs(){const _0x56a7cc=process['argv']['slice'](-0x83*0xd+0x1bcd+-0x1524),_0x21c9c8={'_':[]};for(let _0x4a75b3=-0xab*-0x36+0x236e+-0x4780;_0x4a75b3<_0x56a7cc['length'];_0x4a75b3++){const _0x5b9235=_0x56a7cc[_0x4a75b3];if(!_0x5b9235['startsWith']('--')){_0x21c9c8['_']['push'](_0x5b9235);continue;}if(_0x5b9235['startsWith']('--')){const _0x2a8821=_0x5b9235['slice'](0x1d9*-0x11+-0x1*-0x24c4+0x1*-0x559),_0x16b884=_0x56a7cc[_0x4a75b3+(-0x1e2+0x881*-0x4+0x23e7)];if(!_0x16b884||_0x16b884['startsWith']('--'))_0x21c9c8[_0x2a8821]=!![];else!_0x16b884['startsWith']('--')&&(_0x2a8821==='k'||_0x2a8821==='limit'||_0x2a8821==='page'?_0x21c9c8[_0x2a8821]=parseInt(_0x16b884,-0x10f3+0x1*-0x17d3+0x28d0):_0x21c
...[truncated 27 chars]

Obfuscated Code

High
Category
Supply Chain
Confidence
88% confidence
Finding

The code is heavily obfuscated/minified, which materially reduces auditability for a skill that handles login credentials and remote requests. In this context, obfuscation makes it harder to verify that only the documented behavior occurs and increases the chance that unsafe or hidden functionality goes unnoticed.

Content

Scanner excerpt · scripts/lexseek.js (reported line 1)May include surrounding context.

js
const fs=require('fs'),path=require('path'),readline=require('readline'),APIConstants={'BASE_URL':'https://api.lexseek.cn','ENDPOINTS':{'LOGIN':'/api/v1/auth/login/password','SEARCH_LAW':'/api/v1/skills/search-law'}},ENV_FILE=path['join'](__dirname,'.env');function readEnvFile(){try{return fs['readFileSync'](ENV_FILE,'utf-8');}catch(_0x31f03b){return _0x31f03b['code']!=='ENOENT'&&console['error']('读取配置文件失败:',_0x31f03b['message']),'';}}function writeEnvFile(_0x457f8b){try{return fs['writeFileSync'](ENV_FILE,_0x457f8b,'utf-8'),!![];}catch(_0x1e1927){return console['error']('写入配置文件失败:',_0x1e1927['message']),![];}}function updateEnvKey(_0x58d667,_0x55e2e3){let _0x58a1ea=readEnvFile();const _0x260f52=_0x58a1ea['split']('\x0a'),_0x14c0ca=[];let _0x50c070=![];for(const _0x32bdf1 of _0x260f52){if(_0x32bdf1['startsWith'](_0x58d667+'='))_0x14c0ca['push'](_0x58d667+'='+_0x55e2e3),_0x50c070=!![];else _0x32bdf1['trim']()&&_0x14c0ca['push'](_0x32bdf1);}return!_0x50c070&&_0x14c0ca['push'](_0x58d667+'='+_0x55e2e3),writeEnvFile(_0x14c0ca['join']('\x0a'));}function getEnv(_0xf1c13e,_0x4fed29){const _0x5c133b=readEnvFile(),_0x3d661f=new RegExp('^'+_0xf1c13e+'=(.*)$','m'),_0x3a93a8=_0x5c133b['match'](_0x3d661f);return _0x3a93a8?_0x3a93a8[0x1da8+-0x318+0x1a8f*-0x1]['trim']():_0x4fed29;}function parseArgs(){const _0x56a7cc=process['argv']['slice'](-0x83*0xd+0x1bcd+-0x1524),_0x21c9c8={'_':[]};for(let _0x4a75b3=-0xab*-0x36+0x236e+-0x4780;_0x4a75b3<_0x56a7cc['length'];_0x4a75b3++){const _0x5b9235=_0x56a7cc[_0x4a75b3];if(!_0x5b9235['startsWith']('--')){_0x21c9c8['_']['push'](_0x5b9235);continue;}if(_0x5b9235['startsWith']('--')){const _0x2a8821=_0x5b9235['slice'](0x1d9*-0x11+-0x1*-0x24c4+0x1*-0x559),_0x16b884=_0x56a7cc[_0x4a75b3+(-0x1e2+0x881*-0x4+0x23e7)];if(!_0x16b884||_0x16b884['startsWith']('--'))_0x21c9c8[_0x2a8821]=!![];else!_0x16b884['startsWith']('--')&&(_0x2a8821==='k'||_0x2a8821==='limit'||_0x2a8821==='page'?_0x21c9c8[_0x2a8821]=parseInt(_0x16b884,-0x10f3+0x1*-0x17d3+0x28d0):_0x21c
...[truncated 27 chars]

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill declares network-dependent behavior via external API authentication and search, but does not specify an explicit tool scope such as allowed-tools or permissions. This weakens execution transparency and reviewability, making it easier for the skill to invoke networked behavior without clear operator awareness or policy gating.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The auto-trigger condition is broad enough to activate on ordinary legal discussion, which can cause the assistant to invoke networked, authenticated behavior unexpectedly. In this skill, that broad trigger is more dangerous because activation may lead to credential solicitation for a third-party service during routine conversation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

L003 及整份文档均将技能定义为中文法律助手,并未提供语言/locale 选择或说明仅在用户明确选择中文场景下使用。按照语言/locale 政策,若技能实际上强制特定语言输出而无用户选择,可能构成自然语言策略违规。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill references API key–based authentication via environment variables but does not explain credential usage, transmission, or storage expectations. This lack of disclosure can lead operators or users to unknowingly expose sensitive keys or misunderstand how authentication secrets are handled.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The phrase 'user asks a specific legal question or keyword' is insufficiently bounded and can overlap with general legal advice conversations. Because the skill forbids fallback and pushes users toward login, vague triggering increases the chance of unnecessary data exposure and disruptive credential prompts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This JSON eval file consistently defines prompts and expected outputs only in Chinese, including instructional phrases and user-facing responses. Because the file contains no indication that language selection is optional or that the skill is intentionally limited to a Chinese-only locale, it suggests a language policy constraint without user opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the model to collect a user's phone number and password and pass them to a local script, even though the skill's primary purpose is legal text retrieval. This creates unnecessary credential-handling behavior, expands the model's access to sensitive secrets, and could expose user credentials through logs, prompts, process listings, or downstream tooling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill tells the model to solicit a phone number and password and forward them to a login script without any warning about secret handling, storage, or exposure risks. In an LLM-agent setting, this is dangerous because users may disclose highly sensitive credentials to a system not designed to safely process passwords, and the script invocation may leak them to logs or telemetry.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation says the API key is automatically stored locally but does not clearly warn about credential persistence or its security implications. This omission can mislead users and integrators into accepting insecure default secret storage, increasing the chance of accidental exposure and unauthorized reuse of the API key.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation directs that the API key be automatically stored in a local .env file, introducing persistent credential storage beyond the immediate retrieval task. Persisting secrets locally increases the risk of later disclosure through filesystem access, source control mistakes, workspace sharing, backups, or other skills/tools reading the file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document instructs the skill to send user legal queries to an external third-party API using an API key, but it does not disclose that potentially sensitive user-provided case facts or legal questions will leave the local environment. In a legal-assistant context, queries may contain confidential personal, employment, family, or dispute information, so the omission creates a meaningful privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill’s declared purpose is legal text retrieval, but the code also implements login/logout and local credential persistence in a sidecar .env file. This expands the trust boundary from simple retrieval to credential handling, increasing risk because secrets are stored locally without strong safeguards and outside the narrowly stated scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code prompts for a phone number and password, exchanges them for an API key, and then persists that key locally. For a law-retrieval skill, this is unnecessary exposure of sensitive credentials and creates a risk of credential theft or accidental leakage from the local filesystem.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The login flow silently writes the returned API key to a local .env file, but the user is not clearly warned before persistent storage occurs. This undermines informed consent and can leave reusable credentials on disk where other local users, backups, or tools may access them.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script's prompts, errors, and help output are entirely hardcoded in Chinese, including login, search, and error flows. This forces a specific language/locale on all users without any opt-in or documented region-specific justification, matching the policy violation criteria for language/locale constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The skill documentation appears to require Chinese by presenting all instructions and interface descriptions exclusively in Chinese, with no opt-in or note that the skill is intended for a Chinese-language context. This can violate language or locale policy when a skill forces a specific language without user choice or explicit justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The login flow silently writes the returned API key to a local .env file, but the user is not clearly warned before persistent storage occurs. This undermines informed consent and can leave reusable credentials on disk where other local users, backups, or tools may access them.

Content

No source excerpt is available for this finding.