Back to skill

Security audit

golang-stretchr-testify

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Go testing guide, with a disclosed but unpinned helper-tool install that users should treat as a supply-chain risk.

Before installing, consider pinning gotests to a reviewed version or installing it yourself from a trusted source. Use the skill in a scoped project workspace, and review generated test edits before committing them.

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
SKILL.md:17
Finding

Unpinned External Tool Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 17-20
Vulnerability Type: Supply-chain exposure through a floating dependency version
Risk Level: Medium

Vulnerable code:

yaml
install:
  - kind: go
    package: github.com/cweill/gotests/...@latest
    bins: [gotests]

Technical Analysis

The Skill declares an installation of github.com/cweill/gotests/...@latest. The @latest selector does not identify an immutable, audited release. Consequently, the code retrieved and installed can change after this Skill has been reviewed.

Installing gotests is reasonably related to the declared Go testing functionality, so requesting this tool does not inherently exceed the Skill's functional scope. However, allowing the installation mechanism to select an arbitrary future release grants unnecessary trust to mutable upstream state. A compromised maintainer account, repository, release process, or dependency graph could cause attacker-controlled code to be compiled and executed during installation.

The Skill also permits network-capable tools such as WebFetch and documentation services. No instruction was found that directs the agent to transmit credentials, source files, environment variables, or other sensitive local information through those tools. The pre-scan warning concerning sensitive network transmission was therefore not confirmed as a separate vulnerability.

Attack Path

  1. An attacker compromises the upstream github.com/cweill/gotests repository, its maintainer credentials, release process, or a dependency selected by a future version.
  2. The attacker publishes a version that Go resolves as latest.
  3. A harness loads the Skill and processes its installation declaration.
  4. The harness downloads and compiles the mutable upstream source.
  5. Attacker-controlled initialization, build-time, installation-time, or subsequently invoked tool behavior executes with the permissions o ...[truncated 1072 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace @latest with a reviewed, explicit semantic version, for example:

    yaml
    install:
      - kind: go
        package: github.com/cweill/gotests/...@v1.6.0
        bins: [gotests]
    

    The exact version should be selected only after reviewing its source and release provenance.

  2. Where the installation framework supports it, verify downloaded source or artifacts using an expected checksum, signed release, or trusted provenance attestation.

  3. Disable automatic installation by default. Ask for user confirmation before downloading or installing the tool, especially in CI environments or repositories containing secrets.

  4. Perform installation and execution in a sandbox with access restricted to the target project, minimal environment variables, no credential stores, and network access disabled unless explicitly required.

  5. Maintain a controlled dependency-update process. Review new versions, regenerate checksums, run security scanning, and deliberately update the pinned version rather than resolving mutable upstream state at runtime.

  6. Consider removing gotests from the required binaries if the Skill can provide its core Testify guidance without test-generation tooling. This would further reduce privileges and supply-chain exposure.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (1)

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

md
## Common Mistakes

- **Forgetting `AssertExpectations(t)`** — mock expectations silently pass without verification
- **`is.Equal(ErrNotFound, err)`** — fails on wrapped errors. Use `is.ErrorIs` to walk the chain
- **Swapped argument order** — testify assumes `(expected, actual)`. Swapping produces backwards diffs
- **`assert` for guards** — test continues after failure and panics on nil dereference. Use `require`

Static analysis

No suspicious patterns detected.