Back to skill

Security audit

pentest-lyan

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed web penetration-testing skill, but it weakens authorization checks and persistently stores live credentials and unredacted report evidence.

Install only for targets where you have explicit written permission and a defined scope. Before running it, keep pentest-data and pentest-report out of synced or shared folders, prefer test accounts, avoid production unless approved, and plan to redact, encrypt, revoke, or delete session and report artifacts after use.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
references/report-template.md:119
Finding
Plaintext Session Credentials Are Persisted and Embedded in Reports## Vulnerability Details **File Location**: `references/report-template.md:119-121`; related retention guidance in `references/post-delivery.md:10-14` **Vulnerability Type**: Plaintext sensitive-data storage and disclosure **Risk Level**: High ### Vulnerable Code `references/report-template.md:119-121`: ```markdown - Must use **BurpSuite raw HTTP request format** (not a curl command or JSON fragment) - **No redaction**: Preserve complete credentials (Cookie/Token/phone number) in the report because they are required for reproduction; redaction is deferred to delivery (encryption/internal transfer; see “Post-delivery”) - Mark key parameters with `【】`, such as `userId=【12345】` and `{"id":【5】}` ``` `references/post-delivery.md:10-14`: ```markdown Prompt the user: - [Warning] **Credential cleanup**: `pentest-data/{project-id}/sessions/account_*.json` contains plaintext tokens and cookies. Recommend cleanup or encrypted storage after delivery. Confirm that `pentest-data/` is in `.gitignore`. - [Warning] **Reports contain sensitive information**: `pentest-report/*.docx` contains complete requests and responses, including Authorization headers. Use encryption or internal transfer for delivery. ``` ### Technical Analysis The workflow deliberately retains active cookies and tokens in plaintext session files and requires complete, unredacted authentication material to be copied into persistent Markdown and DOCX reports. These artifacts can therefore contain reusable session cookies, bearer tokens, Authorization headers, personal information, and complete request and response bodies. A `.gitignore` rule only reduces accidental Git commits. It does not protect artifacts from other repository synchronization systems, backups, shared workspaces, local users, malware, report forwarding, or overly broad filesystem permissions. The post-delivery controls are advisory rather than enforced: the Skill prompts the user to clean or encry ...[truncated 2013 chars]
Remediation
## Remediation Suggestions 1. Redact authentication values from all retained reports by default. Replace them with placeholders such as `Cookie: sessionid=[REDACTED]` while preserving request structure. 2. If exact credentials are indispensable, place them in a separate encrypted evidence package and require explicit user consent before generating it. 3. Store session material in an operating-system credential store or an encrypted temporary file rather than ordinary JSON files. 4. Create sensitive files with owner-only permissions, such as mode `0600`, and ensure containing directories are not accessible to other users. 5. Automatically remove session files and temporary deliverable files after report generation unless the user explicitly requests retention. 6. Revoke or invalidate test sessions at the end of the assessment where the target supports logout or token revocation. 7. Make encrypted delivery mandatory for unredacted artifacts rather than presenting it only as a recommendation. 8. Add automated checks that fail report generation when live Cookie, Authorization, bearer-token, or other secret patterns remain in a standard deliverable.

T08 · Insecure Dependencies

Warning
Location
references/docx-template.md:59
Finding
Unpinned Runtime Installation of a Third-Party Package## Vulnerability Details **File Location**: `references/docx-template.md:59-64` **Vulnerability Type**: Uncontrolled dependency installation **Risk Level**: Medium ### Vulnerable Code ```markdown 1. Write the deliverable content to the temporary file `pentest-report/{project-id}-deliverable-tmp.md` 2. Run `python3 scripts/render_docx.py pentest-report/{project-id}-deliverable-tmp.md pentest-report/{project-id}-{system-name}-pentest-{YYYYMMDD}.docx` 3. If `python-docx` is not installed, first run `pip3 install python-docx` 4. After confirming `SAVED`, delete the temporary Markdown file 5. Retain the full Markdown report and DOCX deliverable ``` ### Technical Analysis The workflow directs the Agent to install the latest available `python-docx` package at runtime without a pinned version, cryptographic hashes, lockfile, isolated virtual environment, trusted-index restriction, or explicit user approval. Python package installation may execute package-controlled build or installation logic. Although `python-docx` is a legitimate package and no malicious dependency is included in this repository, resolving an unconstrained current release makes the effective dependency different over time. A compromised package release, package-index compromise, malicious index configuration, or unexpected dependency change could introduce code execution into an otherwise static Skill. The installation also uses the ambient `pip3` environment. Depending on system configuration, this can modify a shared Python environment and may affect unrelated tools or future runs. ### Attack Path 1. A report is generated on a host where `python-docx` is unavailable. 2. The workflow invokes `pip3 install python-docx`. 3. `pip3` resolves the package and transitive dependencies using the host’s configured package indexes. 4. A compromised release, maliciously configured index, or altered dependency is selected. 5. Package build or installation code exe ...[truncated 733 chars]
Remediation
## Remediation Suggestions 1. Define the dependency in a locked requirements file with an audited exact version. 2. Require cryptographic hashes, for example through `pip install --require-hashes -r requirements.lock`. 3. Install dependencies inside a dedicated virtual environment rather than the ambient Python installation. 4. Restrict installation to an explicitly trusted package index and disable unexpected extra indexes. 5. Require explicit user approval before any runtime dependency installation. 6. Prefer documenting dependencies as prerequisites or shipping a reproducible, prebuilt environment instead of installing packages during Skill execution. 7. Periodically review and update the pinned dependency through a controlled security-update process.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The README explicitly states that simply invoking the skill is treated as authorization, which bypasses the need for explicit confirmation of scope, ownership, environment, and time bounds. In a penetration-testing skill, that materially increases the risk of unauthorized or out-of-scope security testing against third-party systems based on ambiguous user prompts.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The documentation says testing should continue even with zero or one account, which weakens safeguards for an authorized web-app pentest workflow and encourages degraded testing without sufficient access context. In practice, this can push the agent toward probing registration, authentication, or public attack surfaces without adequate confirmation of intended test coverage or account-approved scope.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The skill explicitly says that a user's request is treated as sufficient proof of authorization, removing any meaningful authorization check before conducting intrusive security testing. This can enable unauthorized scanning or exploitation based solely on a natural-language claim, undermining the skill's own safety boundary.

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The documentation claims the skill is limited to authorized testing, but the operating rule immediately nullifies that safeguard by assuming authorization from invocation alone. This contradiction makes the safety restriction ineffective in practice and increases the chance of misuse against third-party targets.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
The HARD GATE repeats the same flawed trust model: it labels authorization as required while also treating user tasking as confirmed authorization. Because this sits in gate logic, it operationalizes the bypass and makes unsafe behavior part of the core control flow.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The skill explicitly treats invocation syntax alone as proof of authorization and tells the model to proceed without re-validating scope or authority. In a penetration-testing skill, this weakens a critical safety boundary and can enable unauthorized testing if a user provides a target they do not control or misrepresents authorization.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The template explicitly requires retaining full credentials, cookies, tokens, phone numbers, and other sensitive identifiers in the internal Markdown report body, even when that level of detail is not strictly necessary for the stated purpose of summarizing threats tested. This creates avoidable secret sprawl: anyone with access to the report or its backups can reuse live session material or exposed PII, turning a reporting artifact into a secondary breach source.

Vague Triggers

High
Confidence
98% confidence
Finding
The invocation guidance uses an overly broad rule that any tasking constitutes authorization, creating a dangerous shortcut for a high-risk skill. Because this skill is designed to perform active offensive security actions, ambiguous authorization handling is especially dangerous and can lead to misuse against systems the requester does not control.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill instructs persistent storage of session cookies and account files containing plaintext credentials, but does not provide an upfront warning or secure-handling requirements before collecting and storing them locally. This raises avoidable exposure and retention risk for sensitive authentication material.

Missing User Warnings

Medium
Confidence
83% confidence
Finding
The skill is designed to perform active authenticated security testing, including cross-role and attack-phase actions, but the documentation in this section emphasizes workflow rather than clearly warning users that intrusive actions will be taken against the target. This can lead to uninformed use and accidental impact on production systems.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The skill instructs the model to read and reuse session cookies for cross-role testing, which involves direct handling of sensitive session material. While this may be operationally relevant to authorized security testing, the documentation lacks explicit safeguards for secret minimization, storage restrictions, redaction, and user awareness, increasing the risk of credential leakage or misuse.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The guide explicitly instructs the agent to create and update multiple files under a local pentest-data workspace, including index and state files, without requiring user confirmation or clearly warning that the skill will modify the caller's filesystem. In an agent setting, silent persistence and resumable state creation can be surprising and unsafe, especially if the user expected read-only analysis or is operating in a sensitive repository.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The guide directs broad endpoint probing, existence checks, asset fetching, and later authenticated requests across discovered APIs, but does not mandate a prominent warning or confirmation about network activity and the use of session cookies. Even in an authorized pentest skill, this can cause unintended scanning, trigger defenses, or expose live credentials/session data to unintended targets if the target or environment is mis-scoped.

Missing User Warnings

High
Confidence
97% confidence
Finding
The template instructs inclusion of complete credentials and tokens in generated reports and does not pair that behavior with a prominent privacy warning, consent checkpoint, or secure-handling requirement at generation time. In a pentest context this is especially dangerous because the data may include valid session cookies, bearer tokens, or customer identifiers that enable account access or lateral movement if the report is leaked.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The guide recommends true concurrent race-condition testing with 30 parallel state-changing requests, but does not include guardrails about operational risk, rate limits, test-environment preference, or abort conditions. Even in an authorized pentest skill, such instructions can cause unintended denial of service, duplicate transactions, inventory corruption, or noisy production-side effects if used carelessly.

Ssd 3

High
Confidence
99% confidence
Finding
Treating any user task as implicit authorization is a dangerous trust decision because the model may perform offensive security actions without verifying the user's right to target the system. In this context, the skill is specifically for penetration testing, so the unsafe assumption is more dangerous than in a benign domain.

Ssd 3

High
Confidence
97% confidence
Finding
The skill directs storage of session cookies and plaintext credentials in project files, creating a concrete risk of credential leakage, replay, or accidental inclusion in logs, backups, or shared workspaces. Because these files are intended for ongoing testing and resume support, the exposure window is extended beyond the active session.

Ssd 3

Medium
Confidence
90% confidence
Finding
The resume logic encourages reusing persisted session cookies from prior runs, which prolongs the lifetime and utility of stolen or accidentally exposed authentication tokens. Continued reliance on stored tokens also normalizes insecure secret retention as part of standard operation.

Ssd 3

High
Confidence
98% confidence
Finding
The template directly tells the agent not to mask credentials and to preserve complete cookies, tokens, phone numbers, and other sensitive user data in the report. This is a classic sensitive-data exposure pattern: reports are often copied, indexed, emailed, synchronized, or retained longer than raw test artifacts, so embedding reusable secrets materially increases compromise impact beyond the test itself.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
1. 按上述结构写交付件内容,Write 成临时 `pentest-report/{project-id}-deliverable-tmp.md`(首部必须 `# 标题` + `>` 引用块 + `---`)
2. 执行 `python3 scripts/render_docx.py pentest-report/{project-id}-deliverable-tmp.md pentest-report/{project-id}-{系统名}-pentest-{YYYYMMDD}.docx`
3. `python-docx` 未安装先 `pip3 install python-docx`
4. 确认 `SAVED` 后删除临时 md:`rm pentest-report/{project-id}-deliverable-tmp.md`
5. 最终 pentest-report/ 留:完整报告 `.md` + 交付件 `.docx`

渲染脚本位置:`scripts/render_docx.py`。
Confidence
93% confidence
Finding
The skill instructs the agent to execute a shell deletion command using a path composed from variables such as {project-id}. If those values are not strictly validated and shell-escaped, an attacker could trigger unintended file deletion or command injection; even without injection, automated deletion of files in the workspace is a risky side effect for a documentation template. The pentest skill context makes this more dangerous because it already encourages tool use and file operations during an automated workflow.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- [ ] 语言**去 AI 化**:无"经测试发现""证据链完整""综上所述"等套话,短句直白,数字量化
- [ ] 修复建议 2-4 条简述,**不分**短期长期/P0P1
- [ ] 漏洞按等级降序排列
- [ ] 流程:写交付件 tmp.md → `python3 scripts/render_docx.py <tmp.md> <输出.docx>` → 确认 `SAVED` → `rm` tmp.md。pentest-report/ 最终留完整报告 `.md` + 交付件 `.docx`。失败先 `pip3 install python-docx`。
Confidence
89% confidence
Finding
The workflow includes shell-style commands with variable file paths and a destructive delete step (`rm tmp.md`) without guardrails, path validation, or safer deletion semantics. In an agentic/tool-using context, command patterns like this can normalize unsafe parameter handling and become dangerous if filenames, working directories, or output paths are later influenced by untrusted input, leading to unintended file deletion or command misuse.

Static analysis

No suspicious patterns detected.