Back to skill

Security audit

Infra Wrapper

Security checks for vulnerabilities and agentic risk

Overview

This skill is presented as Terragrunt infrastructure tooling but mainly provides a local history logger that can store sensitive infrastructure text in plaintext.

Review before installing. Treat this as a local infrastructure notes/history logger, not as a Terragrunt orchestration tool. Do not enter secrets, tokens, credentials, backend URLs, or sensitive production details unless you are comfortable with them being stored in plaintext under ~/.local/share/infra-wrapper and possibly exported into additional files.

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/script.sh:5
Finding

Plaintext Infrastructure Inputs Stored Without Enforced Access Controls

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh:5-9; representative logging sink at scripts/script.sh:119-128, repeated for other core commands through line 300
Vulnerability Type: Plaintext storage of potentially sensitive data with permissions dependent on the caller's umask
Risk Level: Medium

Vulnerable Code

bash
DATA_DIR="${HOME}/.local/share/infra-wrapper"
mkdir -p "$DATA_DIR"

_log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; }

Representative command handler:

bash
run)
    shift
    if [ $# -eq 0 ]; then
        echo "Recent run entries:"
        tail -20 "$DATA_DIR/run.log" 2>/dev/null || echo "  No entries yet. Use: infra-wrapper run <input>"
    else
        local input="$*"
        local ts=$(date '+%Y-%m-%d %H:%M')
        echo "$ts|$input" >> "$DATA_DIR/run.log"
        local total=$(wc -l < "$DATA_DIR/run.log")

The handler subsequently invokes _log "run" "$input", resulting in the same input being stored in both the command-specific log and history.log. Equivalent behavior is repeated for the other core commands.

Technical Analysis

The script accepts arbitrary infrastructure-related text and persists it in plaintext. Such inputs can include cloud credentials, access tokens, backend secrets, sensitive resource identifiers, internal topology, or commands containing secrets.

The data directory is created with mkdir -p and no explicit mode, and the script does not set a restrictive umask. Log files are created through shell redirection without an explicit 0600 permission. Consequently, their effective permissions depend on the invoking environment. Under a permissive or common umask, files may be readable by other local users or processes that can traverse the user's home directory.

Sensitive inputs are duplicated in a command-specific log and history.log, increasing exposure. Export functionality, if cor ...[truncated 1524 chars]

Remediation
View remediation

Remediation Suggestions

  1. Set a restrictive umask before creating any persistent data:

    bash
    umask 077
    
  2. Create and verify the data directory with owner-only permissions:

    bash
    install -d -m 0700 "$DATA_DIR"
    chmod 0700 "$DATA_DIR"
    
  3. Create log and export files with mode 0600, and verify permissions before appending:

    bash
    touch "$DATA_DIR/history.log"
    chmod 0600 "$DATA_DIR/history.log"
    
  4. Avoid recording complete commands by default. Store only non-sensitive metadata, such as the operation type, timestamp, and a redacted summary.

  5. Redact common secret-bearing arguments and values before logging, including passwords, tokens, authorization headers, access keys, private keys, and Terraform variable assignments marked as sensitive.

  6. Add an explicit opt-in option when full command logging is required and warn users that inputs are persisted locally.

  7. Apply the same restrictive permissions and redaction controls to every export file.

  8. Provide a retention and secure-deletion mechanism so sensitive historical records do not remain indefinitely.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a Terragrunt/OpenTofu/Terraform orchestration tool, but the documented behavior is actually a generic local logging utility. This mismatch is dangerous because users may trust it with real infrastructure commands or sensitive operational context under false assumptions, causing unintended disclosure and misuse of data rather than performing the expected IaC workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script claims to be a Terragrunt/OpenTofu infrastructure wrapper, but it performs no infrastructure orchestration and instead persistently collects arbitrary user input across many commands. In a developer-tools skill context, this mismatch is dangerous because users may enter infrastructure details, secrets, or operational notes under false pretenses, causing covert local data collection and misleading trust in the tool’s purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest and branding describe an infrastructure orchestration capability, while the content only documents local text logging. In a security-sensitive IaC context, deceptive or inaccurate capability descriptions can cause operators to provide secrets, environment details, or commands to a tool that stores them locally without delivering the expected function.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill states that all entries are timestamped and logged locally, but it does not prominently warn users that whatever they type, including infrastructure commands, identifiers, or secrets, will be written to disk. In IaC workflows, inputs often contain sensitive environment names, state locations, account details, and occasionally credentials, so silent persistence creates a meaningful privacy and security risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documented design persistently logs all user-provided operation inputs and supports bulk export and search across that history. In the context of infrastructure operations, this can capture commands, environment topology, backend configuration, account identifiers, internal hostnames, and potentially secrets, creating a centralized local repository of sensitive operational intelligence that could be exposed or abused.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Command names like run, check, generate, preview, and config imply real operational infrastructure actions, but the text states they only record log entries. This can mislead users into entering production commands, environment names, backend URLs, or other sensitive data that becomes persistently stored, increasing confidentiality risk and operational confusion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The export feature writes accumulated logs to JSON, CSV, or TXT without any warning that exported content may include sensitive operational history. Exporting consolidated logs increases exposure because it packages all stored inputs into easily copied files, making accidental sharing or exfiltration more likely.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The header and help text present the script as an 'infrastructure wrapper' utility, but the visible behavior only stores and displays arbitrary text entries. This deceptive documentation increases the chance that operators will provide sensitive infrastructure data, believing the tool is performing legitimate Terragrunt-related actions rather than building a local history of their inputs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The export routine aggregates all prior logged history into new JSON, CSV, or TXT files, expanding the footprint of potentially sensitive user inputs and making accidental disclosure more likely. Because this is framed as infrastructure tooling, exported history may contain operationally sensitive content that users would not expect to be recopied into portable files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

User-supplied input is appended verbatim to persistent log files under the user’s home directory without any warning, consent flow, redaction, or retention control. In an infrastructure tooling context, these inputs may include stack names, environment details, credentials, tokens, or internal URLs, creating a local sensitive-data exposure risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.