Back to skill

Security audit

Spec-Kit SDD

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly fits its Spec-Kit and Paperclip workflow purpose, but it includes state-changing issue operations and a credentialed fallback script that can send a Paperclip API key to any configured URL without clear safeguards.

Install only if you trust the publisher and intend the agent to run Spec-Kit workflows that create or modify project files. Treat Paperclip reassignment and comment commands as explicit user-approved actions. Do not run the included reassign script with PAPERCLIP_API_KEY unless PAPERCLIP_API_URL is verified as the intended Paperclip endpoint, preferably HTTPS or a loopback development URL.

Vulnerability Patterns
  • 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
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/speckit-reassign.sh:50
Finding

Bearer Credential Disclosure Through an Unrestricted API Destination

Content
View full analysis

Vulnerability Details

File Location: scripts/speckit-reassign.sh, lines 50–57
Vulnerability Type: Unvalidated credential destination and potential plaintext credential transmission
Risk Level: Medium

Vulnerable Code

bash
if [ -n "${PAPERCLIP_API_KEY:-}" ] && [ -n "${PAPERCLIP_API_URL:-}" ]; then
  HTTP_CODE=$(curl -sS -o /dev/null -w "%{http_code}" -X PATCH \
    -H "Authorization: Bearer $PAPERCLIP_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"assigneeAgentId\":\"$AGENT_ID\"}" \
    "$PAPERCLIP_API_URL/api/issues/$ISSUE_ID")

Technical Analysis

The fallback API request obtains both its bearer credential and destination URL from environment variables. Although the script checks that these variables are nonempty, it does not validate the URL scheme or destination host before attaching PAPERCLIP_API_KEY to the Authorization header.

Consequently, a malicious or mistakenly configured PAPERCLIP_API_URL can direct the credential to an attacker-controlled server. The absence of an HTTPS requirement also permits transmission over plaintext HTTP to a remote destination, exposing the API key to network interception. No redirect policy or protocol restriction is specified explicitly.

Exploitation requires the attacker to influence the script's environment or configuration, or otherwise convince an operator to execute it with an unsafe PAPERCLIP_API_URL while a valid PAPERCLIP_API_KEY is present.

Attack Path

  1. The attacker influences PAPERCLIP_API_URL, setting it to an attacker-controlled endpoint or a remote plaintext HTTP endpoint.
  2. A valid Paperclip API key is present in PAPERCLIP_API_KEY.
  3. The CLI path is unavailable or fails, causing execution to reach the curl fallback.
  4. The script sends a PATCH request carrying Authorization: Bearer $PAPERCLIP_API_KEY to the configured destination.
  5. The attacker receives the bearer credential directly, o ...[truncated 621 chars]
Remediation
View remediation

Remediation Suggestions

  1. Parse and validate PAPERCLIP_API_URL before using it. Reject malformed URLs, embedded user information, unexpected ports, and unapproved hosts.
  2. Require HTTPS for every non-loopback destination. Permit HTTP only for explicitly recognized loopback addresses if local development requires it.
  3. Maintain an explicit allowlist of trusted Paperclip API hostnames rather than accepting arbitrary destinations.
  4. Restrict curl protocols and redirect protocols for remote requests, for example with --proto '=https' --proto-redir '=https'. If redirects are unnecessary, disable or avoid following them.
  5. Separate trusted endpoint configuration from attacker-influenced process environments where possible, and protect the configuration file with appropriate ownership and permissions.
  6. Use a narrowly scoped, short-lived API credential and rotate it immediately if exposure is suspected.
  7. Fail closed when destination validation fails, without issuing any request containing the Authorization header.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code only implements one specific function: reassigning a Paperclip issue based on a role name. That aligns with one small part of the declared description ('reassigning Paperclip issues'), but the overall declared purpose presents this as a comprehensive GitHub Spec-Kit integration for many Spec-Driven Development tasks. Those capabilities are not reflected in the code chunk. There is also no evidence of GitHub interaction at all; instead, the script talks to a local Paperclip CLI or Paperclip API. Because the actual behavior is much narrower and targets different resources than the broad declared integration suggests, this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documents shell commands and operational workflows that can modify the local project and potentially invoke external tools, but it does not declare any explicit tool scope such as permissions or allowed-tools. In agent environments, missing scope boundaries increases the risk that the agent may execute commands more broadly than the user expects, especially because the skill includes installation, initialization, and API call examples.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger set includes broad terms like 'constitution', 'specification', 'feature spec', and 'implementation plan', which are common in ordinary engineering conversations. Over-broad triggers can cause the skill to activate unexpectedly, pulling the agent into shell-enabled or state-changing workflows in contexts where the user did not intend to use this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The markdown instructs how to reassign issues and post comments through an API, but it does not prominently warn that these actions modify external system state. In an agent setting, omission of an explicit confirmation requirement can lead to unintended issue changes, audit noise, or workflow disruption if the agent follows the instructions automatically.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The skill contains concrete curl commands that transmit data to a local HTTP API and perform PATCH/POST requests that change issue assignment and create comments. Even though the destination is localhost, this is still an external transmission and a state-changing side effect; if executed by an agent without strict approval, it could alter task routing or leak work details into another service.

Content

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

md
PAPERCLIP_API="http://localhost:3100/api"

# Reassign by agent ID
curl -s -X PATCH "$PAPERCLIP_API/issues/$ISSUE_ID" \
  -H "Content-Type: application/json" \
  -d "{\"assigneeAgentId\": \"$TARGET_AGENT_ID\"}"

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/speckit-reassign.sh (reported line 47)May include surrounding context.

sh
echo "⚠️ CLI failed, falling back to curl..."
fi

# Fallback to curl
if [ -n "${PAPERCLIP_API_KEY:-}" ] && [ -n "${PAPERCLIP_API_URL:-}" ]; then
  HTTP_CODE=$(curl -sS -o /dev/null -w "%{http_code}" -X PATCH \
    -H "Authorization: Bearer $PAPERCLIP_API_KEY" \