Back to skill

Security audit

Embedded C Code Generator

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious with medium confidence because scanners report multiple consequential correctness and safety defects in its embedded C templates, while no malicious behavior was identified.

Consider the skill suspicious and review the generated code carefully before using it, especially its ring-buffer, DMA, and hardware communication templates. Skillspector inspected all 48 listed components but marked analysis partial because a referenced local path was missing; the findings describe software correctness and safety concerns, not evidence of malicious intent.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · templates/fsm_framework.c (reported line 121)May include surrounding context.

text
search_from = (uint16_t)(idx + 1u);
    }

    return rule_found ? FSM_ERR_GUARD : FSM_ERR_NO_TRANS;
}

FSM_State_t FSM_GetState(const FSM_Machine_t *m)

The claimed lock-free SPSC safety is contradicted by shared counter updates.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Producer and consumer both perform read-modify-write operations on count, so an ISR can interrupt an update and cause a lost increment or decrement even when individual loads are atomic. OVERWRITE mode also shares tail ownership, allowing concurrent operations to corrupt queue state; compiler barriers do not provide mutual exclusion.

Content

No source excerpt is available for this finding.

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

md
## Recommended Defaults (apply directly when user gives none)

Produce code with these defaults without asking; list actually-used defaults in the usage notes.

| # | Module | Defaults |
|---|--------|----------|

The documented full-lap overrun detection guarantee is not implemented.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The documented interface supplies only a modulo write position, which cannot distinguish no movement from one or more complete DMA laps without additional wrap information or a sampling constraint. Consequently, the unconditional full-lap detection guarantee is unsupportable, allowing silent loss or misinterpretation of received data.

Content

No source excerpt is available for this finding.

The documented ISR-safe record publication does not guarantee a consistent consumer snapshot.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

LA_GetLast copies multiple fields without excluding ISR writes, so an interrupt that overwrites the selected slot can produce a mixed record. Publishing the index after writing does not protect a consumer already reading an older slot, and nested writers can also interleave updates to shared state.

Content

No source excerpt is available for this finding.

The fault record is documented as storing values rather than pointers, but contains borrowed string pointers.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The record contains borrowed string pointers despite explicitly claiming value storage that remains safe after a function returns. The LA_Assert macro normally supplies static strings, but callers of the public LA_Fail API could reasonably pass temporary strings under this misleading contract, leading to dangling-pointer reads when records are displayed.

Content

No source excerpt is available for this finding.

Nyquist error handling contradicts the documented initialize-and-warn behavior.

Medium
Category
Excessive Agency
Confidence
100% confidence
Finding

L34-L35 promise return code -2 while still initializing the filter for an above-Nyquist cutoff. L37-L38 instead return -1 immediately, before any initialization, which can cause callers relying on the documented warning policy to use an uninitialized or previously configured filter.

Content

No source excerpt is available for this finding.

Blocking transmission bypasses the documented platform abstraction.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

RS485_SendBlocking bypasses the overridable platform hooks by casting the peripheral to a fixed register layout and directly polling and writing registers. On an incompatible platform this can access incorrect registers or hang indefinitely in the TXE loop, potentially leaving the RS485 driver asserted and disrupting the bus.

Content

No source excerpt is available for this finding.

The clock-stretching helper can continue without SCL actually becoming high, contrary to its documented guarantee.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The clock-stretch loop silently exits when its guard expires, even if SCL remains low, and its void return type prevents callers from detecting the failure. A stuck or excessively stretching slave can therefore cause invalid bus sequencing and fabricated read results that are reported as successful.

Content

No source excerpt is available for this finding.

SPI mode decoding swaps CPOL and CPHA, contradicting the documented support for standard modes 0–3.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

For standard numeric SPI modes, CPOL is bit 1 and CPHA is bit 0, but this implementation decodes them in reverse. Modes 1 and 2 therefore generate incorrect idle levels and sampling edges, potentially corrupting peripheral commands or sensor readings while still returning success.

Content

No source excerpt is available for this finding.