Back to skill

Security audit

Harness Writing

Security checks for vulnerabilities and agentic risk

Overview

This skill is a documentation-only fuzzing-harness guide with some imperfect sample code, but no hidden execution, persistence, or data access behavior.

Reasonable to install as a fuzzing reference. Before copying the C++ examples into production fuzz targets, replace raw typed-pointer casts with memcpy or explicit decoding, and prefer vector::data() plus clear zero-length handling for vector-backed inputs.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:120
Finding

Undefined Behavior from Unaligned and Aliasing-Violating Integer Reads

Content
View full analysis
Remediation
View remediation
(data[0]) | (static_cast(data[1]) << 8) | (static_cast(data[2]) << 16) | (static_cast(data[3]) << 24); ``` Update the quick-reference entry and every repeated example so agents are not encouraged to reproduce the unsafe form. Compile sample harnesses with AddressSanitizer and UndefinedBehaviorSanitizer to validate the corrected guidance. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:139
Finding

Potential Empty-Vector Dereference in FuzzedDataProvider Examples

Content
View full analysis
str1 = fuzzed_data.ConsumeBytesWithTerminator(32, 0xFF); std::vector str2 = fuzzed_data.ConsumeBytesWithTerminator(32, 0xFF); ``` ### Technical Analysis The examples use `&str1[0]` and `&str2[0]` without first proving that the vectors are nonempty. Calling `operator[]` with index zero on an empty `std::vector` is outside its valid element range and results in undefined behavior. Fuzzing naturally exercises empty and truncated inputs, so an empty-vector state must be treated as an expected condition. A harness-originated invalid access undermines the document's stated requirement that the harness handle malformed and small inputs gracefully. Using `vector::data()` avoids invoking `operator[]` on an empty vector. The target API must still define how it handles a zero-length input and the pointer value associated with it. ### Attack Path 1. A developer or agent copies the documented `FuzzedDataProvider` harness. 2. The fuzzer supplies data from which one of the vectors is empty. 3. The harness evaluates `str1[0]` or `str2[0]` while preparing arguments for `concat`. 4. The out-of-range access invokes undefined behavior before or during the target call. 5. The campaign records a misleading crash, repeatedly explores a harness defect, or fails to reach the intended system-under-test logic. This is an indirect risk in harnesses created from the guidance; the Markdo ...[truncated 421 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.