Back to skill

Security audit

Phy Iac Sec Audit

Security checks for vulnerabilities and agentic risk

Overview

The skill is a read-only IaC scanner, but it can print detected credential values into terminal or CI logs and overstates parts of its security coverage.

Review before installing or using in CI. The scanner appears read-only and does not send data out, but do not run it on repositories containing real secrets unless output is controlled, because findings may reveal credential values in logs. Treat its CloudFormation, Pulumi, and Lambda role coverage as limited rather than comprehensive.

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

Error
Location
SKILL.md:435
Finding

Credential Values Are Exposed in Audit Output and CI Logs

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 435–466
Vulnerability Type: Sensitive information exposure through diagnostic output
Risk Level: High

Vulnerable Code

python
if AWS_KEY_RE.search(line):
    findings.append(Finding(
        check_id="IC003",
        severity="CRITICAL",
        location=f"{filepath}:{i + 1}",
        resource="<credentials>",
        message=f"AWS access key hardcoded: {line.strip()[:60]}",
        fix="Use aws_secretsmanager_secret_version, AWS SSM Parameter Store, or environment variables. Never commit keys.",
    ))
    continue

m = HARDCODED_CRED_RE.search(line)
if m:
    # Skip lines that reference variables or data sources
    if re.search(r'(var\.|data\.|local\.|aws_secretsmanager|aws_ssm_parameter|\$\{)', line):
        continue
    # Skip obvious non-secret patterns
    val_match = re.search(r'=\s*"([^"]+)"', line[m.start():])
    if val_match:
        val = val_match.group(1)
        # Skip: ARNs, region names, account IDs (12-digit), resource names, hostnames
        if re.match(r"(arn:|[a-z]+-[a-z]+-[12]$|\d{12}$|[a-z0-9-]+\.[a-z]+$)", val, re.IGNORECASE):
            continue
        if len(val) < 6:  # Too short to be a real credential
            continue
    findings.append(Finding(
        check_id="IC003",
        severity="CRITICAL",
        location=f"{filepath}:{i + 1}",
        resource="<credentials>",
        message=f"Possible hardcoded credential: {line.strip()[:70]}",
        fix="Use var.db_password from terraform.tfvars (gitignored) or aws_secretsmanager_secret_version data source.",
    ))

Technical Analysis

The credential scanner copies up to 60 or 70 characters from the source line into each finding rather than redacting the detected value. The report formatter subsequently prints the finding message. Because the documented workflow includes CI execution, these mess ...[truncated 2073 chars]

Remediation
View remediation

Remediation Suggestions

  1. Never include the original source line or matched credential value in a finding.

  2. Report only non-sensitive metadata, such as the file, line number, detected credential type, and configuration key name.

  3. Replace values with a fixed marker rather than length-preserving partial masking. For example:

    python
    message="Possible hardcoded credential detected in assignment; value redacted."
    
  4. If the configuration key is needed, extract and strictly validate only the key name:

    python
    key_match = re.search(
        r'^\s*(password|secret|access_key|secret_key|token|api_key|private_key)\s*=',
        line,
        re.IGNORECASE,
    )
    key_name = key_match.group(1) if key_match else "credential"
    message=f"Possible hardcoded {key_name} detected; value redacted."
    
  5. Apply redaction before constructing Finding objects so secrets cannot leak through alternative formatters or future output modes.

  6. Add automated tests using synthetic AWS keys, passwords, tokens, multiline private keys, and long secrets. Assert that neither complete values nor prefixes appear in formatted output.

  7. Configure CI systems to restrict access to historical logs and shorten retention. Treat existing logs produced by affected versions as potentially sensitive.

  8. Rotate any real credential previously processed and printed by the scanner, then invalidate the old credential and review its service audit logs for unauthorized use.

Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation claims IC011 detects wildcard trust principals in Lambda execution roles, but the code only searches for broad managed policies like AdministratorAccess and does not evaluate assume-role trust policies. This mismatch can cause users to believe a high-risk privilege boundary is being checked when it is not, allowing dangerously permissive trust policies to pass undetected.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises CloudFormation and Pulumi coverage, but the implementation is overwhelmingly Terraform-specific, relying on Terraform resource syntax and regexes. In a security auditing tool, overstated coverage is dangerous because users may rely on it as a control and miss serious misconfigurations in unsupported formats, creating a false sense of security.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:117