Back to skill

Security audit

Equipment Maintenance Log

Security checks for vulnerabilities and agentic risk

Overview

This is a local lab equipment maintenance log; its main risks are ordinary local record deletion or bad input corrupting the log.

Before installing, understand that this skill stores equipment records locally and can permanently delete them when asked. Use backups for audit-sensitive logs and avoid untrusted or extreme interval values until range validation is added.

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:205
Finding

Unbounded Calibration Interval Allows Persistent Schedule Corruption and Denial of Service

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py:105, scripts/main.py:151, and scripts/main.py:205-223
Vulnerability Type: Improper input validation and numeric range validation
Risk Level: Medium

Vulnerable Code

python
next_cal = last_cal + timedelta(days=data["interval_months"] * 30)
python
next_cal = last_cal + timedelta(days=data["interval_months"] * 30)
python
parser.add_argument("--interval", type=int, help="Calibration interval (months)")

args = parser.parse_args()

log = EquipmentLog()

if args.add:
    if not args.calibration_date:
        print("Error: --calibration-date is required when using --add")
        sys.exit(1)
    if not args.interval:
        print("Error: --interval is required when using --add")
        sys.exit(1)
    log.add(args.add, args.calibration_date, args.interval, args.location or "")
elif args.update:
    log.update(args.update, args.calibration_date, args.interval, args.location)

Technical Analysis

The --interval argument is converted to an integer but is not validated against an acceptable numeric range. The condition if not args.interval rejects only a missing value and zero. It permits negative integers and arbitrarily large positive integers.

The update path passes the supplied interval directly to EquipmentLog.update() without any positivity or upper-bound check. Both add and update operations therefore allow an invalid value to be persisted in ~/.openclaw/equipment_log.json.

Subsequent --check and --report operations multiply the stored interval by 30 and pass it to timedelta. A negative interval produces a maintenance due date before the calibration date and corrupts compliance results. A sufficiently large integer can cause an OverflowError when constructing the timedelta or adding it to the stored date, terminating the operation. Because the invalid value is persisted, later checks and reports continue to fail until the affected ...[truncated 1658 chars]

Remediation
View remediation

Remediation Suggestions

Enforce a bounded positive interval at every trust boundary:

  1. Reject values outside a documented operational range, such as 1 through 120 months, during both add and update operations.
  2. Use a dedicated argparse type validator so invalid values are rejected before application logic runs.
  3. Repeat validation inside EquipmentLog.add() and EquipmentLog.update() so callers cannot bypass CLI validation.
  4. Validate the type and range of every interval loaded from the JSON file because the file may be corrupted or manually modified.
  5. Catch OverflowError, TypeError, and KeyError during date calculations. Skip the malformed record with a clear warning rather than terminating the entire report.
  6. Write updates atomically only after the complete record has passed validation.

Example validator:

python
def positive_interval(value):
    try:
        interval = int(value)
    except ValueError:
        raise argparse.ArgumentTypeError("Interval must be an integer.")
    if not 1 <= interval <= 120:
        raise argparse.ArgumentTypeError(
            "Interval must be between 1 and 120 months."
        )
    return interval

parser.add_argument(
    "--interval",
    type=positive_interval,
    help="Calibration interval in months (1-120)"
)

Apply equivalent validation before storing or consuming loaded records.

Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (5)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file states that date validation was added and that update/delete support was added to the skill description, which implies those fixes were in place. However, the later Round 2 section explicitly says these behaviors were documented but 'not yet in script,' creating a direct contradiction in the file's own documentation about implementation status.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents executable commands and its functionality clearly involves persistent state changes, but it does not declare any explicit tool/permission scope such as allowed file-write access. That creates ambiguity about what filesystem locations may be modified and weakens policy enforcement, increasing the chance of unintended or overly broad writes if the script or wrapper is invoked by an agent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill exposes a delete operation for equipment records but provides no warning that deletion may be irreversible or remove compliance-relevant audit history. In a maintenance/compliance context, silent deletion can lead to accidental data loss, weakened traceability, and potential audit or regulatory issues.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The delete operation removes a record from the persisted equipment log and immediately saves the change, making it a destructive action. Although the code prints a message after deletion, there is no prior confirmation prompt or user-facing warning that the action is irreversible.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The Round 2 entry says the script implementation of date validation, update/delete, and report support is still an outstanding task. Round 3 later claims those exact features were implemented, both dated 2026-03-19, so the documentation presents conflicting statements about the same codebase status without clearly indicating sequencing or revision boundaries.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.