Back to skill

Security audit

code-refactor

Security checks for vulnerabilities and agentic risk

Overview

This skill provides a disclosed workflow for refactoring, rewriting, and porting code, with normal workspace-limited code-editing authority and no hidden persistence or exfiltration behavior found.

Installers should prefer a pinned version or reviewed commit when possible. Once installed, expect this skill to make workspace code changes only when the user asks for an implementation task; for plans or reviews it instructs the agent not to edit files.

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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 161)May include surrounding context.

md
rces, concurrency, and each dependency's equivalent. Use the pair's section in `references/port-pairs.md` (Python↔Go, Python↔Rust, JS/TS↔Rust, TS↔Go, Java↔Kotli

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 213)May include surrounding context.

md
rces, concurrency, and each dependency's equivalent. Use the pair's section in `references/port-pairs.md` (Python↔Go, Python↔Rust, JS/TS↔Rust, TS↔Go, Java↔Kotli

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 · README.md (reported line 15)May include surrounding context.

md
| **rewrite** | Same language, the code isn't worth evolving: unreadable legacy, a dead framework, "rewrite from scratch" | The old implementation becomes the oracle: characterization tests first, then a parity check old vs new |
| **port** | The target language differs (Python → Go/Rust, TS → Go/Rust, Java → Kotlin, C → Rust, …) | Shared fixtures and a modest differential run against both implementations; numeric, string, error, ordering and concurrency semantics are mapped explicitly |

Guardrails / 硬性规则: the skill is read before searching files (even in an empty workspace); it stays inside the working directory, never installs toolchains without approval, writes no files for plan-only requests, works to a time/step budget (smallest verifiable slice first, report written early), and finishes instead of leaving a resume note.

Prefer refactor over rewrite whenever an incremental path exists. "Port and clean it up" is two projects: port first, refactor later. For tidying a single function or snippet, use [simplify-code](https://github.com/linkxzhou/simplify-code).

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 17)May include surrounding context.

md
Guardrails / 硬性规则: the skill is read before searching files (even in an empty workspace); it stays inside the working directory, never installs toolchains without approval, writes no files for plan-only requests, works to a time/step budget (smallest verifiable slice first, report written early), and finishes instead of leaving a resume note.

Prefer refactor over rewrite whenever an incremental path exists. "Port and clean it up" is two projects: port first, refactor later. For tidying a single function or snippet, use [simplify-code](https://github.com/linkxzhou/simplify-code).

## Language pairs / 语言对

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The README instructs users to run npx skills add ... without pinning a specific package version. That can lead to non-reproducible installs and increases supply-chain risk if a newer or compromised package version is pulled at execution time.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger list includes very broad terms like "rewrite" and "modernize," which can cause this skill to activate for loosely related requests that are not true refactor/port tasks. In an agent system, over-broad activation can misroute user intent, leading the agent to apply the wrong workflow, ignore a more appropriate skill, or make unnecessary code changes under an unsuitable process.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This JSON file is a manifest-like file, so natural-language requirements inside it are in scope. The expected output and expectation explicitly require Chinese-language reporting, but the file does not document this as an opt-in locale choice or clearly justify it as a region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Natural-language policy violations apply to all file types, including JSON. Requiring that the report be in Chinese and repeating that requirement in the expectations is a language/locale constraint without visible opt-in or justification, which matches the rule's prohibited pattern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The skill description is presented bilingually and continues with mixed English/Chinese section labeling, but there is no indication that language selection is based on user preference or can be changed. This can conflict with language/locale policy expectations when a skill imposes a specific additional language without explicit opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.