Back to skill

Security audit

Go Concurrency Patterns

Security checks for vulnerabilities and agentic risk

Overview

The skill itself is ordinary Go concurrency guidance, but its README recommends an unpinned remote install path that could install content different from what was reviewed.

Review the install path before using this skill. Prefer installing from a pinned commit or verified release, or manually inspect and copy the reviewed files, rather than running an unpinned `npx add` command against a mutable GitHub branch. The skill content itself appears to be benign Go concurrency guidance.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
README.md:25
Finding

Unpinned npx Installer and Mutable Remote Skill Source

Content
View full analysis

Vulnerability Details

File Location: README.md, lines 25–29
Vulnerability Type: Supply-chain exposure through an unpinned executable package and mutable remote content
Risk Level: Medium

Vulnerable Code

markdown
## Installation

```bash
npx add https://github.com/wpank/ai/tree/main/skills/backend/go-concurrency
text

### Technical Analysis

The documented installation command invokes the npm package named `add` through `npx` without specifying an exact package version or integrity digest. When the package is not already available locally, `npx` can download and execute its current published version. Consequently, the code executed by this installation procedure may differ from the code reviewed when the Skill was audited.

The installation source is also a GitHub `main` branch path rather than an immutable commit. Content on that branch can change after review without any corresponding change to this repository. The command therefore relies on two mutable supply-chain components:

1. The unpinned npm installer package executed by `npx`.
2. The remotely hosted Skill content retrieved from a mutable branch.

This does not prove that either current upstream source is malicious. It creates an unsafe trust boundary through which a compromised package maintainer, npm account, GitHub account, or upstream repository could deliver altered code or Skill instructions.

### Attack Path

1. An attacker compromises the npm package used by `npx`, its maintainer account, the referenced GitHub repository, or an authorized upstream contributor.
2. The attacker publishes a malicious package version or modifies content under the referenced `main` branch.
3. A user follows the installation command in `README.md`.
4. `npx` resolves and executes the currently available installer package, which then processes content from the mutable GitHub location.
5. Attacker-controlled installer logic could execute in the user
...[truncated 819 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace implicit npx add execution with a clearly identified and trusted installer pinned to an exact package version.
  2. Enforce npm integrity verification using a lockfile, verified package digest, or equivalent trusted provenance mechanism.
  3. Reference the GitHub content by a reviewed commit SHA rather than the mutable main branch.
  4. Publish and verify a checksum or cryptographic signature for the expected Skill files before copying or loading them.
  5. Prefer a non-executing installation process, such as downloading a pinned archive and copying reviewed files, when arbitrary installer execution is unnecessary.
  6. Run installation with least privilege and avoid exposing unrelated credentials or sensitive environment variables to the installer.
  7. Document the expected package identity, version, commit SHA, checksums, and resulting installed files so users can independently verify provenance.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
90% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

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

md
- **NEVER close a channel from the receiver** — Only the sender should close; receivers panic on closed channels
- **NEVER send on a closed channel** — Causes panic; design so sender controls close
- **NEVER use unbounded goroutine spawning** — Use worker pools or semaphores for bounded concurrency
- **NEVER ignore the `-race` flag in testing** — Data races are silent bugs that corrupt state
- **NEVER pass pointers to loop variables into goroutines** — Capture the value or use index closure pattern
- **NEVER use `time.Sleep` as synchronization** — Use channels, WaitGroups, or context

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The README instructs users to install the skill directly from a remote GitHub source via npx add without pinning to a specific immutable version, tag, or commit. That creates a supply-chain risk: if the upstream repository changes or is compromised, future installs may fetch different content than what was originally reviewed.

Content

No source excerpt is available for this finding.

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 39)May include surrounding context.

From your project root:

bash
mkdir -p .cursor/skills
cp -r ~/.ai-skills/skills/backend/go-concurrency .cursor/skills/go-concurrency

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

From your project root:

bash
mkdir -p .claude/skills
cp -r ~/.ai-skills/skills/backend/go-concurrency .claude/skills/go-concurrency

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

Claude Code (global)

bash
mkdir -p ~/.claude/skills
cp -r ~/.ai-skills/skills/backend/go-concurrency ~/.claude/skills/go-concurrency

External Model or Provider Selection

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

md
---
name: go-concurrency
model: standard
description: Production Go concurrency patterns — goroutines, channels, sync primitives, context, worker pools, pipelines, and graceful shutdown. Use when building concurrent Go applications or debugging race conditions.
---

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest frames this skill as guidance for Go concurrency constructs and debugging, but this section adds a concrete network-capable pattern using HTTP requests to arbitrary URLs. Network access is not an obvious requirement for teaching goroutines, channels, sync primitives, worker pools, pipelines, or graceful shutdown, so this capability is out of scope for the stated purpose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.