Back to skill

Security audit

contract-management

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent contract-management assistant, but it needs Review because it may publish confidential contract material to Notion and persist session-derived legal knowledge without clear consent or governance.

Install only if you are comfortable using it for PRC-oriented contract workflows and can control where outputs go. Before using it with real contracts, disable or tightly scope Notion publishing unless each upload is explicitly approved, verify the destination workspace and page permissions, avoid including unnecessary personal or commercial details, and do not allow session-specific contract terms to update shared template or risk libraries without qualified human review.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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
references/contract-comparison.md:102
Finding

Confidential Legal Documents May Be Published to Notion Without Per-Operation Consent

Content
View full analysis

Vulnerability Details

File Location: references/contract-comparison.md:102-103

Additional Affected Locations:

  • references/contract-drafting.md:230-231
  • references/contract-review.md:131-132
  • references/contract-tracker.md:109-110
  • Related connector behavior is declared in references/legal-lookup.md:9-15, references/nda-screening.md:9-15, and references/word-format-spec.md:124.

Vulnerability Type: Automatic publication of sensitive legal content through an active external connector

Risk Level: Medium

Complete Code Snippet:

markdown
**如已连接 Notion:**
- 将对比报告发布到 Notion,便于团队批注讨论

Equivalent contract-drafting instruction:

markdown
**如已连接 Notion:**
- 将合同文档发布到 Notion,便于团队协作审阅

Equivalent contract-review instruction:

markdown
**如已连接 Notion:**
- 将审查报告发布到 Notion,便于团队批注讨论

Equivalent contract-tracker instruction:

markdown
**如已连接 Notion:**
1. 将台账报告发布到 Notion,包含:合同名称、状态、到期日期、剩余天数、续约模式、负责人
2. 便于团队查阅和持续更新

Technical Analysis

The affected workflows direct the agent to publish generated material whenever a Notion connector is connected. They do not require explicit authorization for each publication, display or validate the destination workspace and page, restrict sharing permissions, or perform data minimization and redaction.

Contract documents and derived reports can contain party identities, personal contact details, commercial terms, pricing, intellectual property provisions, legal strategy, dispute information, and responsible-person data. Treating connector availability as sufficient authorization creates an unsafe disclosure path. The connector is openly documented, so the behavior is not covert exfiltration, but it lacks controls appropriate for confidential legal information.

Exploitation depends on an active Notion connector with write access. No operating-system privilege escalation or arbitrary code execution is involved.

...[truncated 1243 chars]

Remediation
View remediation

Remediation Suggestions

  1. Default to local file generation or in-conversation output, even when a connector is active.
  2. Before every external publication, request explicit user confirmation and display:
    • The destination workspace and page.
    • The data categories that will be transferred.
    • The intended audience and current sharing permissions.
  3. Require the user to select or approve the destination rather than relying on a previously configured default.
  4. Minimize data before transfer. Redact personal identifiers, signatures, contact details, bank details, pricing, and unnecessary contract text.
  5. Create private pages by default and apply least-privilege access controls.
  6. Provide a preview of the exact content to be published.
  7. Record an audit event containing user approval, destination, timestamp, and publication result.
  8. Return the resulting page URL and effective access scope so the user can verify and revoke access.
  9. Apply the same confirmation and redaction controls consistently across all affected workflows.

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:102
Finding

User-Controlled Contract Content May Poison Persistent Shared Knowledge

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:102

Vulnerability Type: Unvalidated persistence of session-derived legal guidance into reusable template and risk libraries

Risk Level: Medium

Complete Code Snippet:

markdown
| 6. 复盘沉淀 | (新增) | 将本轮合同起草/审查中的修正经验固化为合同管理方法论 → 更新合同模板库与条款风险库 → 形成可复用审查清单 |

Technical Analysis

The instruction directs the agent to convert corrections and conclusions from the current contract drafting or review session into reusable methodology, update contract template and clause-risk libraries, and create reusable review checklists.

Current-session content is at least partially user-controlled. The instruction does not define an approval gate, trusted-source validation, provenance tracking, tenant isolation, confidentiality filtering, version control, or rollback procedure. Consequently, malicious or incorrect contract language can be promoted from an untrusted session into persistent knowledge that affects future outputs.

This is a memory-poisoning risk because the intended update survives the immediate task and may influence later contract drafting or review sessions. The issue is conditional on the hosting environment implementing the referenced persistent libraries; the audited repository itself contains no executable persistence code.

Attack Path

  1. An attacker submits a contract containing carefully crafted clauses, misleading legal assertions, or biased risk classifications.
  2. During review, the attacker presents those provisions as corrections, preferred practices, or reusable lessons.
  3. The retrospective instruction directs the agent to consolidate the session's corrections into methodology and update reusable template or risk libraries.
  4. Without source validation or administrator review, the attacker-controlled guidance is stored as trusted reusable knowledge.
  5. Later users receive contract clauses, risk ratings, or review recommendations influenced by ...[truncated 821 chars]
Remediation
View remediation

Remediation Suggestions

  1. Disable persistent learning from individual sessions by default.
  2. Require explicit administrator or qualified legal-review approval before promoting session content into shared knowledge.
  3. Treat all user-provided contracts, corrections, and legal assertions as untrusted input.
  4. Validate proposed legal rules against authoritative and current sources before persistence.
  5. Separate reusable global knowledge from tenant-specific and matter-specific data.
  6. Remove party names, commercial terms, personal data, and other client identifiers before considering reuse.
  7. Store provenance for every knowledge entry, including source session, reviewer, legal authority, creation date, and validation status.
  8. Use version-controlled updates with change review, integrity checks, expiration dates, and rollback support.
  9. Restrict write access to shared template and risk libraries according to least privilege.
  10. Replace the automatic update instruction with a proposal workflow that generates a non-persistent candidate change for human review.
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Several trigger keywords are broad terms such as '合同风险', '法律依据', and '合同模板', which are common in ordinary legal or business discussion and may overlap with unrelated requests. Because this skill operates in a legal domain and can produce contract analysis or drafting behavior, overbroad triggers raise the risk of accidental activation, unintended legal-style guidance, and misuse of sensitive contract context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states the skill can be triggered through natural conversation with automatic matching, but it does not define clear activation boundaries, exclusions, or confirmation requirements. In a legal workflow, this can cause the assistant to invoke contract-handling behaviors on ambiguous user input, increasing the chance of unintended processing, incorrect legal-style output, or routing sensitive content into the wrong subskill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases listed in the skill metadata are very broad and match common legal-assistance requests such as '帮我看下这份合同' or '合同审核'. In an agent routing environment, such broad matching can cause unintended invocation of this skill on loosely related prompts, increasing the chance of over-collection of sensitive documents or misrouting the user into legal workflows they did not explicitly request.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The routing logic allows matching based on broad scenario descriptions, not just explicit keywords, and then selects the 'highest match' without a deterministic boundary. This makes the skill susceptible to ambiguous or accidental activation, especially because several subskills have overlapping legal-review semantics, which can lead to incorrect processing paths and inappropriate handling of sensitive contract data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The description for contract drafting says the skill generates drafts that comply with '中国法律要求', which imposes a specific legal/locale framework. The file does not present this as an opt-in choice or clearly explain that the skill is restricted to China-specific use cases in a policy-justified way.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The entire skill specification, workflow, prompts, and output format are written exclusively in Chinese, and there is no indication that users may choose another language or that the skill is restricted to a Chinese-only legal context. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The title and core description are entirely in Chinese and describe the skill as generating contracts compliant with Chinese law, but there is no explicit opt-in or user choice regarding output language. This creates a natural-language locale policy issue because the skill appears to require a specific language by default rather than offering a language/locale option.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill encourages publishing draft contracts to Notion without warning users that contracts may contain highly sensitive commercial terms, personal data, and legal identifiers. In a legal workflow, silent transfer of this data to a third-party SaaS increases confidentiality, compliance, and unauthorized-sharing risk, especially if workspace permissions or retention settings are misconfigured.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The title and content establish the skill as operating in Chinese, and the output requirements later hard-code Chinese legal authorities and prohibit foreign law as the main basis. This imposes a specific language/locale and jurisdictional context without explicit user opt-in or a documented region-specific scope statement that would exempt it under the policy.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L007-L012 仅声明可选增强连接器为 Notion,用于发布审查报告;但 L220 写明在 Notion 写入失败时会“本地保存Markdown报告文件,手动导入”。对于一个主要描述为合同审查与输出的技能,这新增了本地持久化行为,却未在能力说明中披露,属于描述与行为不匹配。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

L028-L035 将第二步描述为提示用户自行核实、仅在用户提供工商信息时进行确认;但 L215 的失败条件写有“工商数据源不可用、主体异常无法验证”,这表明该技能设计上还包含自动化外部主体核验能力。对外描述的行为边界与实际流程能力不一致,可能让使用者误以为该技能不会接触外部数据源或执行背景查询。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The output format hard-codes '中国法律(《民法典》合同编及相关司法解释)' as the review basis. Because the skill does not first confirm the user's preferred jurisdiction or explain that the tool is limited to PRC-law contracts, this creates a natural-language locale/jurisdiction policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language instructions, labels, and legal guidance are entirely in Chinese, which effectively forces a specific language/locale without explicit user opt-in. There is no statement that the skill is China-specific or that users may request another language, so this appears to violate the language-choice policy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly promotes publishing contract ledger reports and reminder lists to Notion, but does not warn that these outputs may contain sensitive contract metadata such as counterparties, dates, renewal terms, and responsible personnel. In a legal/contracts workflow, pushing this data to a shared SaaS workspace without consent, scope checks, or minimization can expose confidential business information to unintended viewers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file’s natural-language instructions, headings, examples, and output format are all presented only in Chinese, which effectively forces a specific language for interaction. The policy allows locale constraints only when they are optional or clearly documented as region-specific and justified, which is not stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instruction '法律引用使用中国法律,不引用外国法(涉外NDA除外)' imposes a specific legal/locale framework as a blanket policy. Under the policy-violation rule, forcing a specific language/locale or regional standard without user choice or clear documented justification is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The skill directs local .docx generation for contracts that can contain sensitive legal, financial, and personal information, but provides no handling guidance. While local export is less risky than third-party publication, users may store, email, or sync the file insecurely, leading to unintended disclosure of draft contractual terms and regulated data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The file states '不得引用外国法律作为主要依据', which enforces a single jurisdictional approach. Without an explicit statement that the skill is only for PRC-law contracts or a user choice of governing law, this is a locale/jurisdiction policy constraint embedded in natural language.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

该技能的 manifest 侧重合同审查、法条速查、起草与对比等法律工作流能力,没有表明需要对本地文件系统进行持久化写入。L220 的“本地保存Markdown报告文件”属于超出核心审查职能的附加能力,且并非从描述中可直接推导出的必要实现细节。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill states it will generate iCal and Excel files containing contract reminders and ledger data, but does not disclose that local files will be created or caution that those files may contain sensitive commercial information. These artifacts can persist on disk, be synced automatically, or be forwarded, creating avoidable data leakage risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The specification mandates Chinese document elements such as Chinese headings, Chinese fonts, and the date format "XXXX年XX月XX日" throughout the template. Because the file does not indicate that this is an optional locale-specific mode or offer user choice, it can conflict with language/locale policy requirements.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.