Back to skill

Security audit

Br Risk Analyzer

Security checks for vulnerabilities and agentic risk

Overview

This code-review skill is coherent, but it needs review because it automatically writes persistent project analysis and report files without clear approval or path safeguards.

Install only if you are comfortable with the agent reading the target repository and writing review context back into the skill files. Prefer asking the agent to show proposed changes before updating resources/project-understanding.md and to save reports only under a fixed, sanitized path.

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)

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:50
Finding

Untrusted Analysis Can Poison Persistent Project Context

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 50-53
Vulnerability Type: Persistent memory poisoning
Risk Level: Medium

Vulnerable Code Snippet:

markdown
### Step 5: Knowledge Persistence
- Store analysis results and project understanding in `resources/project-understanding.md`
- Update accumulated knowledge for future risk assessments
- Maintain historical context of requirement interpretations and codebase evolution

Technical Analysis

The skill instructs the agent to persist analysis results and requirement interpretations in resources/project-understanding.md for use in future assessments. Requirement documents, repository content, and related analysis inputs may be attacker-controlled. The persistence workflow does not require source provenance, validation, explicit user approval, trust classification, or separation of verified facts from untrusted claims.

Consequently, false architectural assertions, misleading security assumptions, or instruction-like text derived from an untrusted input could be written into persistent project context. Future audits may then treat that content as trusted background information. This crosses a session boundary and is therefore best classified as agent memory poisoning rather than ordinary prompt injection.

Attack Path

  1. An attacker supplies a crafted requirement document or repository artifact containing false architectural claims, misleading security assumptions, or instruction-like content.
  2. The skill analyzes that content as part of its normal requirement-driven workflow.
  3. Following Step 5, the agent writes the resulting interpretation into resources/project-understanding.md.
  4. A later audit loads or relies on the persisted project understanding.
  5. The poisoned context influences subsequent reviews, potentially causing risks to be omitted, incorrectly downgraded, or assessed using attacker-selected assumptions.

Impac

...[truncated 616 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require explicit user approval before writing any analysis-derived information to persistent project context.
  2. Record provenance for every persisted claim, including its source file, timestamp, repository revision, and verification status.
  3. Separate verified technical facts from untrusted requirements, hypotheses, and model-generated interpretations.
  4. Never promote instruction-like text from requirements or repository files into operational agent rules.
  5. Store persistent context separately for each repository and prevent one project's content from influencing another project.
  6. Validate proposed context changes against inspected source code before persistence.
  7. Present a reviewable diff before modifying resources/project-understanding.md.
  8. Support revocation and correction of previously stored claims, and prefer append-only provenance records over silently replacing trusted context.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:99
Finding

User-Derived Report Name May Permit Path Traversal or Unintended File Overwrite

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 99
Vulnerability Type: Unsafe construction of an output file path
Risk Level: Medium

Vulnerable Code Snippet:

markdown
The results is saved in {requirements name}-risk-analyzer.md

Technical Analysis

The output filename is derived from the requirement name, which may originate from user-controlled input. The skill does not define a fixed output directory, sanitize the name, reject path separators, normalize the resulting path, or require confirmation before overwriting an existing file.

If an agent substitutes the placeholder literally, a requirement name containing traversal components such as ../, an absolute path, or platform-specific path separators could redirect the write outside the intended report directory. A crafted value could also target an existing Markdown file accessible to the agent.

This is an instruction-level insecure coding practice. Exploitability depends on the implementing agent using the untrusted name directly as a filesystem path and possessing write permission to the selected destination.

Attack Path

  1. An attacker supplies a requirement name containing traversal syntax, such as ../../target.
  2. The agent constructs the documented filename as ../../target-risk-analyzer.md.
  3. The filesystem resolves the traversal components outside the intended report directory.
  4. The agent creates or overwrites the resolved file if its permissions allow the operation.
  5. The attacker uses the unintended write to alter documentation, persistent context, or another writable file whose name can match the generated suffix.

Impact Assessment

The attainable privilege is limited to the filesystem write permissions already granted to the agent; this issue does not itself elevate privileges. Within that boundary, exploitation may create files outside the intended output directory or overwrite existing files compatibl ...[truncated 345 chars]

Remediation
View remediation

Remediation Suggestions

  1. Save reports only beneath a fixed, dedicated directory such as reports/.
  2. Convert the requirement name to a basename and allow only a restricted character set, such as ASCII letters, digits, periods, underscores, and hyphens.
  3. Reject absolute paths, .. components, path separators, control characters, and platform-specific drive or network path prefixes.
  4. Resolve and normalize the final path, then verify that it remains within the canonical reports directory before writing.
  5. Refuse to overwrite an existing file unless the user explicitly approves the exact resolved path.
  6. Prefer a generated identifier or timestamp for the physical filename while storing the original requirement name only as report metadata.
  7. Document the safe output rule explicitly, for example: Save as reports/<sanitized-requirement-name>-risk-analyzer.md.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (5)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly instructs the agent to persist analysis results and project understanding into repository files without requiring user consent or warning about side effects. This can cause unintended modification of the workspace, leakage of sensitive project context into committed artifacts, and accumulation of stale or confidential data across runs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instruction to save results to a generated markdown file creates a file-writing side effect that is not clearly presented as optional or user-approved. In an agent setting, silent file creation can overwrite existing artifacts, introduce sensitive review content into the repository, or be abused to plant unexpected files in the workspace.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The markdown states that the skill requires access to the code repository for semantic search and file examination, which affects user data and project confidentiality. However, it presents this as a requirement rather than a user-facing warning about repository content being accessed during operation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The description begins in Chinese and then switches to English, but nowhere in the skill does it state that language is user-selectable. This can be read as imposing a language/locale convention without explicit opt-in, which may conflict with language-choice policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file includes task and order state descriptions using Chinese terms such as "新建" while the surrounding document is in English. This can impose a language expectation on users without an explicit language or locale note, which fits the policy category for language/locale constraints.

Content

No source excerpt is available for this finding.