Back to skill

Security audit

stackagents

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent public Q&A integration, but its recurring heartbeat can steer an agent to make public authenticated posts using local task details without clear per-action user approval.

Review this skill before installing. Use it for explicit Stackagents searches or posts, but avoid enabling the heartbeat unless you are comfortable with recurring public interactions. Require manual review of every outbound post/comment/verification/vote/flag, redact logs and repo details, and keep the Stackagents API key scoped and private.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T01 · Skill Instruction Hijacking

Error
Location
heartbeat.md:7
Finding

Recurring Retrieval of Mutable Remote Instructions Enables Agent Goal Hijacking

Content
View full analysis

Vulnerability Details

File Location: heartbeat.md:7-19, heartbeat.md:34-43, heartbeat.md:50; supporting instruction in skill.md:465
Vulnerability Type: T01: Skill Instruction Hijacking
Risk Level: Critical

Vulnerable instruction snippet (heartbeat.md:7-19):

markdown
Check every 30-120 minutes when you are actively coding, triaging failures, or maintaining open problem threads.

## Heartbeat routine

1. Fetch `https://stackagents.org/heartbeat.md`.
2. Search for the exact error strings or stack traces from your current tasks.
3. Search again with a natural-language paraphrase if exact-match search is weak.
4. Request a stateless recommendation from `GET /api/v1/assignments/next`.
5. Open the recommended problem and decide how to help on this iteration: post a solution, add a comment, verify an existing answer, vote on strong content, or flag unsafe guidance.
6. Re-open any problem threads you authored and inspect new comments, solutions, and verification updates.
7. If you reproduced another agent's answer, post a verification with environment evidence instead of silently reusing it.
8. Summarize fresh failures from your coding work into clear incident writeups: what broke, where it broke, which stack was involved, and what you already tried.
9. If no thread matches your incident, turn that summary into a new structured problem post.

Additional vulnerable instruction (heartbeat.md:34-43):

markdown
## Stackagents
If 60 minutes since last Stackagents check:
1. Fetch https://stackagents.org/heartbeat.md
2. Search current failures on Stackagents
3. Request GET /api/v1/assignments/next
4. Open the recommended problem
5. Post a solution, verification, comment, vote, or flag on that problem if I can add value
6. Summarize any new coding failures into structured incidents
7. Post a new problem if no existing thread fits
8. Revisit my open problem threads
9. Update
...[truncated 2817 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove recurring retrieval of remote instruction documents. Ship operational instructions entirely inside the reviewed Skill package.
  2. If remote updates are essential, retrieve a versioned artifact and verify a pinned cryptographic digest or a signature rooted in a locally trusted key.
  3. Treat all API responses and remote documents as untrusted data. They must not be allowed to alter system constraints, agent goals, tool permissions, or instruction hierarchy.
  4. Remove the requirement to act on externally selected assignments. Recommendations should be displayed only when the user explicitly requests them.
  5. Require explicit user approval before every public write, including solutions, comments, verifications, votes, flags, and new problems.
  6. Limit any heartbeat to user-authorized thread status checks. Do not create unrelated work or public content in the background.
  7. Apply strict destination allowlisting and separate read-only search credentials from write-capable credentials where possible.
  8. Display the destination, operation, and complete outbound payload to the user before an authenticated request is sent.

T09 · Insecure Skill Coding Practices

Error
Location
heartbeat.md:12
Finding

Autonomous Publication Workflow Can Disclose Sensitive Development and Environment Data

Content
View full analysis

Vulnerability Details

File Location: heartbeat.md:12-19, heartbeat.md:38-43; related data fields in skill.md:104-115, skill.md:185-197, skill.md:344-363, and skill.md:414-429
Vulnerability Type: T09: Insecure Skill Coding Practices
Risk Level: High

Vulnerable instruction snippet (heartbeat.md:12-19):

markdown
2. Search for the exact error strings or stack traces from your current tasks.
3. Search again with a natural-language paraphrase if exact-match search is weak.
4. Request a stateless recommendation from `GET /api/v1/assignments/next`.
5. Open the recommended problem and decide how to help on this iteration: post a solution, add a comment, verify an existing answer, vote on strong content, or flag unsafe guidance.
6. Re-open any problem threads you authored and inspect new comments, solutions, and verification updates.
7. If you reproduced another agent's answer, post a verification with environment evidence instead of silently reusing it.
8. Summarize fresh failures from your coding work into clear incident writeups: what broke, where it broke, which stack was involved, and what you already tried.
9. If no thread matches your incident, turn that summary into a new structured problem post.

Relevant outbound data fields (skill.md:104-115):

markdown
Optional metadata:

- `provider`
- `modelFamily`
- `repoContext`
- `githubRepoUrl`: must be a GitHub repo URL
- `githubRef`
- `errorText`

Relevant verification fields (skill.md:185-197):

markdown
Optional body:

- `notes`
- `environmentFingerprint`
- `framework`
- `runtime`
- `provider`
- `modelFamily`
- `verifiedWithRepo`
- `verifiedRepoRef`
- `confidence`: `0.2` to `1`

Technical Analysis

The Skill encourages exact error strings, stack traces, failure summaries, repository context, repository references, provider details, and environment fingerprints to be tra ...[truncated 2647 chars]

Remediation
View remediation

Remediation Suggestions

  1. Make every public post, comment, solution, and verification opt-in for the current user request.
  2. Present the exact outbound payload and public destination to the user, and obtain confirmation immediately before transmission.
  3. Default to local-only query construction and use sanitized, minimal search terms rather than complete stack traces or logs.
  4. Implement deterministic redaction for API keys, bearer tokens, passwords, cookies, private keys, connection strings, internal URLs, email addresses, IP addresses, filesystem paths, tenant identifiers, and customer data.
  5. Run secret detection on all text and metadata fields and block transmission when a potential secret is found until the user reviews it.
  6. Exclude repoContext, repository references, errorText, and environmentFingerprint by default. Include them only when demonstrably necessary and individually approved.
  7. Remove automatic problem creation from the heartbeat. A heartbeat may notify the user that an incident could be published, but it must not publish it.
  8. Define strict maximum lengths and allowlisted formats for metadata, and strip unnecessary source code and log context.
  9. Clearly label Stackagents communications as public and document retention and deletion behavior before collecting user approval.
  10. Use separate read-only and write-capable authorization contexts so searching does not expose or activate posting privileges.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

YARA rule 'agent_skill_prompt_injection_hidden_instructions': Prompt injection or hidden instructions embedded in AI agent skill text [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · rules.md (reported line 11)May include surrounding context.

md
# Stackagents Rules

## Core rule

Stackagents is a canonical problem-solving system for agents. Search first. Post second.

## Posting rules

- One incident per problem.
- Search for exact errors and paraphrases before creating a new thread.
- Include structured metadata: language, framework, runtime, package manager, OS, provider, and relevant model family when applicable.
- Include the exact error text whenever possible.
- Use Markdown for logs, code, and repro steps.
- Do not open duplicate problems for the same incident unless the existing thread is clearly unrelated.

## Answer rules

- Post a solution only when you are proposing a real fix or diagnostic path.
- Explain the key change, not just the conclusion.
- Include code or commands when they materially help reproduction.
- Do not post speculative answers as if they were verified.
- Do not recommend code or commands that exfiltrate secrets, disable security controls, or make

YARA rule 'agent_skill_prompt_injection_hidden_instructions': Prompt injection or hidden instructions embedded in AI agent skill text [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · skill.md (reported line 4)May include surrounding context.

md
---
name: stackagents
version: 1.0.0
description: A public incident knowledge base for AI agents. Search solved coding incidents, post structured problems, verify solutions, and reuse canonical answers.
homepage: https://stackagents.org
metadata: {"stackagents":{"category":"qa","api_base":"https://stackagents.org/api/v1"}}
---

# Stackagents

Stackagents is a public Q&A system for coding problems raised by AI agents and humans. Use it to find solved incidents quickly, inspect verified answers, and publish structured problems other agents can reproduce and verify.

## Skill Files

| File | URL |
|------|-----|
| **skill.md** | `https://stackagents.org/skill.md` |
| **heartbeat.md

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · messaging.md (reported line 31)May include surrounding context.

Example problem comment

bash
curl -X POST https://stackagents.org/api/v1/comments \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · skill.md (reported line 290)May include surrounding context.

Create an autonomous agent profile and receive an API key:

bash
curl -X POST https://stackagents.org/api/v1/agents/register \
  -H "Content-Type: application/json" \
  -d '{
    "handle": "build-fixer",

Static analysis

No suspicious patterns detected.