Back to skill

Security audit

lean4-theorem-proving

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Lean 4 proof-development skill with expected code-editing workflows and disclosed external search tools, not hidden or destructive behavior.

Install for Lean 4 projects where automated proof repair, local search, and LSP-assisted workflows are useful. Review patches before applying them, keep repair logs local if the project is sensitive, and prefer local search over remote tools when proof goals or identifiers are confidential.

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
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (16)

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly says to use it for 'ANY Lean 4 development,' making invocation scope very broad for a markdown skill. Overly broad routing can cause the agent to activate this skill in marginal contexts, increasing exposure to its automation features, external scripts, subagents, and repair workflows where unnecessary actions or unsafe tool use could occur.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/lean-lsp-server.md (reported line 51)May include surrounding context.

md
## Critical Rules

1. **NEVER edit without checking goal state first** (`lean_goal`)
2. **ALWAYS check diagnostics after edits** (don't wait for build)
3. **Search before guessing** - use `lean_local_search` FIRST (fast & unlimited!)
4. **Check goals between tactics** - see intermediate progress

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/lean-lsp-server.md (reported line 213)May include surrounding context.

md
## Critical Rules

1. **NEVER edit without checking goal state first** (`lean_goal`)
2. **ALWAYS check diagnostics after edits** (don't wait for build)
3. **Search before guessing** - use `lean_local_search` FIRST (fast & unlimited!)
4. **Check goals between tactics** - see intermediate progress

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file initially defines the external tools as only lean_loogle, lean_leansearch, and lean_state_search, but later documents lean_leanfinder as an external tool subject to the same shared 3 requests/30 seconds limit. This is an active documentation contradiction about which tools are external and rate-limited, which can mislead users about network use and availability.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The Stage 2 section states the precise escalation model is opus, but later sections describe the stronger second-stage model as Sonnet. Because this file is operational guidance for the repair workflow, the inconsistency actively contradicts what the repair process is supposed to do and could mislead users about actual model selection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown instructs the user to apply patch.diff with git apply, which changes repository files, but the surrounding guidance does not explicitly warn that the workflow performs file modifications. Under the markdown-specific warning criterion, behaviours that affect user data or system state should be disclosed clearly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation tells users to submit natural-language queries and even raw proof goals to external services, but does not clearly warn that this content leaves the local machine. In a theorem-proving workflow, goals, snippets, identifiers, and project-specific statements may contain proprietary or embargoed research content, so users may unintentionally disclose sensitive material to third-party services.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description enumerates LSP integration, build-first workflow, lemma search, and specific search aids like mathlib lookup, but this file adds a distinct external semantic-search tool (lean_leanfinder) with its own workflow and third-party backing. That broadens the described behavior beyond the manifest's stated set of capabilities, especially because it is presented as a recommended first choice for Mathlib search.

Content

No source excerpt is available for this finding.