Back to skill

Security audit

code-workflow

Security checks for vulnerabilities and agentic risk

Overview

This coding workflow skill is coherent, but it needs Review because it can make agents search/read broad peer knowledge stores and optionally dispatch generated artifacts to RAG systems with insufficient scoping.

Review this before installing in any workspace that contains multiple projects, private planning documents, or shared RAG/wiki stores. Use it only where cross-project lookup is intended, configure RAG receivers deliberately, and require human confirmation before external dispatch, destructive git rollback, or commits if that is not already part of your workflow.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
plan-research-search.md:5
Finding
Mandatory cross-project corpus search exceeds the task's repository boundary## Vulnerability Details **File Location**: `plan-research-search.md`, lines 5–12; reinforced by lines 44–56 **Vulnerability Type**: Excessive access to peer-project and shared knowledge documents **Risk Level**: Medium ### Vulnerable Instructions ```markdown When the user mentions `#N` or a domain keyword, the first action is a **Mandatory RAG & Corpus Pre-Lookup (HARD STOP)**: 1. **RAG Semantic Search**: Run vector memory / RAG semantic search (e.g. `python3 scripts/qdrant-search.py "<keywords>"`) to look up past research, plans, and session decisions. 2. **Workspace & Corpus Glob Search**: Search across active and peer documentation directories (`.agents/docs/generated/*<keyword>*.md`, `daegunsoftDev/.agents/docs/generated/*<keyword>*.md`, `llm-wiki/outputs/*<keyword>*.md`) using keyword matching regardless of prefix (`find -iname '*<keyword>*.md'`). 3. **Plan Glob before Query Commands**: Plan/Research search comes before query commands such as `gh issue view`, `gh pr view`, and `git log`. 4. **Mandatory Read & Prior Knowledge Section**: When relevant artifacts are found, **Read the body and map it to the work scope** → cite and synthesize them under a `## Prior Knowledge & Context` section in the new research document. Asserting "no prior plan/research exists" without physically executing RAG semantic search and LLM Wiki corpus search is STRICTLY FORBIDDEN. ``` The later rules broaden this behavior further: ```markdown | 8 | Skip Read for any Glob/find result by guessing "probably not directly related to this task" | **Mandatory Read for every found file**. No guessing. Determine irrelevance only after reading the body | | 9 | Search only one keyword from the task description ... | **Exhaustively extract** all domain keywords ... and run a separate Glob for each. | | 10 | Conclude "cannot access this ..." before searching fix_plan.md / docs for the domain keyword | Domain keywords apply even without a `#N` or GitHub context — a business/administrative ...[truncated 3937 chars]
Remediation
## Remediation Suggestions 1. Restrict pre-searches to the user-selected repository and its explicitly associated artifact directory by default. 2. Resolve search roots from trusted workspace configuration rather than embedding peer-project paths in generic Skill instructions. 3. Require explicit user approval before searching any peer repository, organization-wide wiki, shared memory collection, or cross-project artifact directory. 4. Enforce canonical-path validation against a directory allowlist before reading search results. 5. Use a two-stage process: - Search trusted metadata, filenames, and approved indexes first. - Read document bodies only after confirming that the result belongs to the current project and is relevant. 6. Do not require every search result to be read. Permit rejection based on trusted repository identity, tenant metadata, classification labels, and artifact provenance. 7. Tag retrieved content with project and confidentiality metadata, and block cross-project synthesis unless an explicit sharing policy permits it. 8. Before RAG dispatch or GitHub publication, scan generated artifacts for content sourced from other repositories and require user confirmation for any cross-project material. 9. Treat issue titles, descriptions, comments, and other externally supplied task metadata as untrusted search inputs. Normalize them and constrain keyword expansion to the current project's approved corpus. 10. Record an audit trail containing the authorized search roots, matched artifacts, documents actually read, and any content included in externally published outputs.
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
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
Findings (16)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
### Features

* **code-workflow:** add plan-research-search topic + ignore config ([ad682c5](https://github.com/es6kr/skills/commit/ad682c58f4924711cffa37e208ce30af3718d8a5))
* **consolidate:** address PR 134 reviews and reflect orange/yellow severity display rules ([e6118d0](https://github.com/es6kr/skills/commit/e6118d0fb0217a4c4ad388b82e574203a8f9258e))
* **next-feat:** accumulate features for hook-kit context gate ([df4f73a](https://github.com/es6kr/skills/commit/df4f73ae4d27d4919105da70c6c94a14a32e8056))
* skills topic bundle — brief/email, code-workflow/plan-research-search, git-repo topics, skill-kit/invoke-discipline ([7fd877d](https://github.com/es6kr/skills/commit/7fd877da1b703fcdcdcaf1a3ce912f885abfa3f0))
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Vague Triggers

High
Confidence
96% confidence
Finding
The rule activates whenever the user mentions a "domain keyword," but the document does not define strong scope boundaries for what counts as in-scope context. That ambiguity can be exploited or triggered accidentally to compel broad corpus and workspace searches, increasing the chance of unnecessary data exposure and instruction hijacking through retrieved content.

Vague Triggers

High
Confidence
96% confidence
Finding
The trigger verbs include broad, everyday phrases such as "start," "status," "review," and "plan," which can cause the skill to activate on routine user messages unrelated to repository research. In practice this creates overbroad behavior that can force unnecessary searches, expose unrelated internal documents to the model, and override normal task scoping.

Anti-Refusal Statement

High
Category
Anti-Refusal
Content
| 5 | Assume a simple query like "check issue progress" does not require a plan search | A query is also an entry action. Run plan Glob before calling `gh issue view <N>`. When a plan is found, evaluate progress from the plan body (do not judge from code grep alone) |
Confidence
85% confidence
Finding
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Anti-Refusal Statement

High
Category
Anti-Refusal
Content
# The transcript path arrives in the hook payload. Do NOT read it from an
# environment variable — CLAUDE_TRANSCRIPT_PATH is not populated in every
# harness build, and a guard that silently depends on it degrades into
# "never fires" (or, worse, into an unsatisfiable block) without warning.
TRANSCRIPT=$(echo "$INPUT" | jq -r '.transcript_path // empty' 2>/dev/null)
[ -z "$TRANSCRIPT" ] && exit 0        # no transcript to inspect — fail open
[ -r "$TRANSCRIPT" ] || exit 0        # unreadable — fail open
Confidence
80% confidence
Finding
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The description includes many broad natural-language use cases such as "code changes," "pull request," and "write plan," which can cause the skill to be suggested or invoked in situations far outside its intended scope. In an agent environment, overbroad activation can steer workflows, alter tool usage patterns, and create unintended side effects like unnecessary branch/plan/PR actions, increasing operational and security risk.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
**Monorepo build verification**: In monorepo projects, run `pnpm build` (full build) before committing — not just `tsc --noEmit` on the changed package. Cross-package issues (e.g., Node.js-only imports leaking into browser bundles) are only caught by building downstream consumers. If full build is too slow, at minimum build the changed package + its direct dependents.

**Commit after implementation**: If build + tests pass, proceed to commit. Do not ask the user whether to commit. If a related existing commit exists, confirm whether to amend via `AskUserQuestion`.

**Commit Message Language (HARD STOP)**: Commit messages must match the primary language of the repository. Check the repository context (previous commits, issues, or README). If the repository uses a non-English primary language, write the commit message in that language. Defaulting to English in a non-English repository is a procedural violation.
Confidence
93% confidence
Finding
The instruction to 'proceed to commit' and 'do not ask the user whether to commit' authorizes the agent to take a consequential source-control action without explicit user confirmation. In agentic environments, autonomous commits can publish unintended changes, create misleading history, or cement unsafe modifications before the user reviews them.

Natural-Language Policy Violations

Medium
Confidence
85% confidence
Finding
This instruction requires use of a particular language based on repository context and labels deviation as a violation, but it does not offer a user choice or opt-in. The policy explicitly flags language or locale constraints that force a specific language without user choice.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill instructs the agent to run `git checkout -- <files>` to revert changes, which irreversibly discards uncommitted local modifications to those paths. In an autonomous coding workflow, this can destroy user work or evidence of partially completed changes if the agent misidentifies the 'bad approach' or applies the command too broadly.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The keyword list is explicitly open-ended ("etc.") and mixes filenames, tools, job names, resources, and code names without a closed grammar or validation rule. This vagueness makes invocation criteria unpredictable and easy to abuse, leading to excessive search breadth and accidental retrieval of unrelated sensitive material.

Vague Triggers

Medium
Confidence
93% confidence
Finding
This markdown file defines when to use the skill, and the example trigger list includes "create PR", which overlaps with common development requests and is not specific to the visual-evidence workflow. Because the file does not provide exclusion conditions or clearer constraints for when screenshot capture should be invoked versus a normal PR flow, this could cause unintended activation.

Session Persistence

Medium
Category
Rogue Agent
Content
#
# Why a separate guard: the existing session-end RAG check compares store/find
# counts when the session wraps up — by then the artifact is already written and
# may have been reported to the user. This guard fires at write time instead.
#
# Responsible skill: code-workflow (resources holds the source). Install: ~/.claude/hooks/
# Recurrence target: failed-attempts.md "code-workflow-research-rag-presearch-omission"
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.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The comment states the hook falls back to a built-in English-only pattern, and later the code implements that fallback. This is a natural-language locale constraint that applies automatically when locale-specific data files are absent, with no indication of user choice or explicit opt-in.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
These lines explain that users may keep their own locale patterns, but also state that the script defaults to built-in English-only behavior when none are present. Because the default locale behavior is automatic rather than user-selected, it violates the language/locale policy criteria.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The skill allows automatic dispatch of research and plan documents to external RAG, memory, or indexing receivers, potentially including workspace-derived code, issue context, and organizational plans, but it only says to 'skip quietly' or continue on failure and does not require informed user consent before transmission. This creates a real data exfiltration risk because sensitive repository content may be sent to external services based on configuration or caller flags without a clear privacy boundary or review gate.

Missing User Warnings

Low
Confidence
95% confidence
Finding
The skill mandates creating and updating local files such as task, research, and plan artifacts as an automatic first action, but it does not require any user-facing notice or confirmation that persistent workspace files will be written. In an agent setting, silent file creation can violate user expectations, clutter repositories, or modify tracked content in ways that are surprising and hard to audit after the fact.

Static analysis

No suspicious patterns detected.