Back to skill

Security audit

Phy Log Smell Auditor

Security checks for vulnerabilities and agentic risk

Overview

This is a mostly read-only logging audit skill, but its optional fix guidance includes a broad command that can directly delete source-code lines.

Review before installing if you expect the skill to offer fixes. Its audit guidance is largely source-reading and purpose-aligned, but do not run the one-command removal blindly; prefer reviewable patches, backups, and language-aware edits. There is no evidence of network exfiltration, persistence, privilege escalation, or hidden execution in the inspected artifact.

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

Unsafe Bulk Source Modification Through Whitespace-Unsafe Shell Pipeline

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 387–393
Vulnerability Type: Unsafe destructive command generation
Risk Level: Medium

Complete Code Snippet

bash
# Preview (does not modify):
grep -rn "console\.log" src/ --include="*.ts" --include="*.js"

# Remove (careful — review first):
find src/ -name "*.ts" -o -name "*.js" | xargs sed -i '/console\.log/d'

Technical Analysis

The Skill recommends a destructive shell command that passes newline-delimited find output to xargs. Because xargs splits input on whitespace, source paths containing spaces, tabs, quotes, backslashes, or newlines will not be passed to sed as intact filenames. A split path component may consequently be interpreted as a separate file located outside the intended src/ tree.

The command also deletes entire lines based on a textual pattern rather than parsing JavaScript or TypeScript syntax. A line containing console.log may include additional expressions, control flow, callbacks, or security-relevant side effects. Deleting that entire line can therefore alter application behavior rather than merely remove diagnostic output.

The find predicates are not grouped, no -type f restriction is used, no backup is created, and there is no transactional rollback or mandatory review stage. These characteristics exceed the minimum privilege necessary for a static logging auditor, whose core function only requires read access. The optional fix guidance introduces broad write access over project source files.

Attack Path

  1. An attacker or untrusted project contributor creates a matching source path containing whitespace, such as src/placeholder target.js.
  2. A separate file named target.js exists in the command's working directory and contains a line matching console.log.
  3. A user invokes the Skill's fix workflow and executes the recommended command.
  4. xargs splits src/placeholder target.js into ...[truncated 1033 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not generate automatic line-deletion commands for JavaScript or TypeScript. Use a language-aware parser or formatter to remove only the logging call while preserving surrounding expressions and control flow.

  2. Generate a reviewable patch instead of modifying files directly. Require the user to inspect and approve the patch before application.

  3. If a shell-based fallback is retained, use null-delimited paths and grouped predicates:

    bash
    find src/ -type f \( -name '*.ts' -o -name '*.js' \) -print0 |
      xargs -0 grep -nH 'console\.log'
    

    This should remain preview-only; it should not be converted directly into a destructive sed operation.

  4. If automated edits are essential, restrict changes to explicitly selected files, create backups or use version-control patches, validate that resolved paths remain under the intended source directory, and provide a rollback mechanism.

  5. Keep the default audit workflow read-only so that its filesystem privileges remain aligned with the declared static-analysis functionality.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest description promises detection of 'log level mismatches' and 'noisy debug flooding in tight loops' as core capabilities. In the provided implementation sections, there are only detectors for debug/print leaks, PII exposure, and missing structured context; no code is shown that analyzes semantic log level correctness or loop-based log flooding.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The description presents fix generation as a capability of the skill itself. In the file, the only fix material is static example output and hand-written shell snippets, with no implementation that derives a one-command fix from scan results.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Overly broad trigger phrases like 'bad logs' and 'log noise' can cause the skill to activate in unrelated contexts, leading to unintended scanning or intrusive behavior. In an agent environment, ambiguous activation increases the chance of prompt/skill hijacking, unexpected file analysis, or accidental disclosure of repository content to workflows that did not explicitly request this skill.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill-level documentation states support for Java and Ruby logging audits. However, the structured-context detector explicitly limits scanning to TypeScript, JavaScript, Python, and Go, contradicting the broader support claim for this check.

Content

No source excerpt is available for this finding.