Back to skill

Security audit

Cold Chain Risk Calculator

Security checks for vulnerabilities and agentic risk

Overview

This is a simple local cold-chain risk calculator with no network, credential, or persistence behavior, but its results can be misleading for invalid durations.

Install only as a lightweight local calculator, and do not treat its output as operationally authoritative without fixing or checking duration validation. Review future versions if they add actual file output, input files, or data retention.

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/main.py:12
Finding
Non-positive duration values produce misleading low-risk assessments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/main.py:12-21` and `scripts/main.py:31` **Vulnerability Type**: Missing input validation **Risk Level**: Medium ### Vulnerable Code ```python base_risk = duration_hours * 0.5 packaging_factor = {"dry-ice": 0.8, "liquid-nitrogen": 0.3, "gel-packs": 1.2} risk = base_risk * packaging_factor.get(packaging, 1.0) print(f"Route: {route}") print(f"Duration: {duration_hours} hours") print(f"Packaging: {packaging}") print(f"Risk score: {risk:.2f}") if risk < 10: return "Low risk" elif risk < 20: return "Medium risk" else: return "High risk" ``` ```python parser.add_argument("--duration", "-d", type=int, required=True, help="Duration in hours") ``` ### Technical Analysis The command-line parser verifies only that `duration` is an integer. It does not enforce a positive lower bound. Consequently, zero or negative transport durations are accepted and used directly in the risk calculation. A negative duration produces a negative risk score. Because every negative score satisfies `risk < 10`, the application labels the result as `Low risk`, even though the input is physically invalid. This is a validation flaw at a trust boundary and can compromise the integrity of the generated assessment. ### Attack Path 1. An operator or attacker supplies an invalid negative duration, for example: ```bash python scripts/main.py --route "NYC-Boston" --duration -100 --packaging dry-ice ``` 2. The parser accepts `-100` because it is a valid integer. 3. The calculation produces `-100 × 0.5 × 0.8 = -40`. 4. The condition `risk < 10` evaluates as true. 5. The program reports a risk score of `-40.00` and a risk level of `Low risk`. ### Impact Assessment The flaw does not grant additional operating-system privileges, file access, network access, or code execution. Its scope is limited to the integrity and reliability of the risk-calculation output. Nevertheless, invalid or attacker-controlled input ...[truncated 258 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Enforce a positive duration before performing the calculation. Prefer validation at argument parsing time so invalid values are rejected before reaching business logic. ```python def positive_int(value): try: parsed = int(value) except ValueError as exc: raise argparse.ArgumentTypeError("Duration must be an integer") from exc if parsed <= 0: raise argparse.ArgumentTypeError("Duration must be greater than zero") return parsed parser.add_argument( "--duration", "-d", type=positive_int, required=True, help="Duration in hours; must be greater than zero", ) ``` For defense in depth, `calculate_risk()` should also reject non-positive durations so callers cannot bypass CLI validation: ```python def calculate_risk(route, duration_hours, packaging): if duration_hours <= 0: raise ValueError("Duration must be greater than zero") ``` Add automated tests covering zero, negative values, valid boundary values, very large durations, and non-integer input. Invalid values should result in a controlled error and a nonzero exit status rather than a risk classification. ]]>
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
Findings (1)

Missing User Warnings

Low
Confidence
89% confidence
Finding
The skill documentation states that output files are written to the workspace, but it does not clearly warn users about that behavior in the usage or output sections. This can lead to unintended persistence of potentially sensitive operational data and surprises for users running the skill in shared or automated environments.

Static analysis

No suspicious patterns detected.