Back to skill

Security audit

Aide

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent AIDE reference skill that prints deployment guidance, but users should review the privileged cron and database-protection examples before running them.

Installers can treat this as reference material. Before copying commands from the deploy section, confirm the target paths, replace placeholder email and backup hosts, avoid duplicate cron entries, and prefer a reviewed cron.d or systemd timer setup with a clear rollback path.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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)

T06 · System Persistence

Error
Location
scripts/script.sh:456
Finding

Deployment Guidance Creates a Persistent Root Cron Task

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 456–458
Vulnerability Type: Root-level scheduled-task persistence
Risk Level: High

Vulnerable Code

bash
# 4. Set up cron
echo '05 4 * * * root /usr/sbin/aide --check | mail -s "AIDE $(hostname)" admin@example.com' \
  >> /etc/crontab

Technical Analysis

The deploy command prints instructions that append a scheduled task directly to /etc/crontab. The script does not execute this command automatically because it is contained in a quoted heredoc; nevertheless, an operator or automated agent following the deployment workflow is instructed to make a persistent, system-wide configuration change.

The cron entry runs /usr/sbin/aide --check as root every day. Periodic integrity checking is consistent with the Skill's stated AIDE deployment purpose, but directly modifying the global crontab crosses a privileged and persistent system boundary. The operation is also not idempotent: executing it repeatedly appends duplicate entries, causing multiple privileged checks and emails to run at the same time.

No existence check, atomic installation procedure, rollback command, explicit user confirmation, or validation of the AIDE and mail executables is provided. Because /etc/crontab affects system-wide scheduled execution, a malformed modification could also damage existing scheduling configuration.

Attack Path

  1. A user or agent invokes the Skill's deploy command.
  2. The Skill presents the command as part of its recommended production deployment procedure.
  3. The user or agent executes the command with root privileges, which are required to modify /etc/crontab.
  4. A permanent root cron entry is appended without checking whether an equivalent task already exists.
  5. The task executes daily across future sessions and system restarts.
  6. Repeated deployment creates duplicate privileged jobs. If a privileged actor or separate c ...[truncated 1081 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not recommend appending directly to /etc/crontab.
  2. Make scheduling an optional deployment step and require explicit operator confirmation before any persistent system modification.
  3. Prefer a dedicated, package-managed /etc/cron.d/aide-check file or a hardened systemd service and timer. This isolates the configuration and makes auditing and removal easier.
  4. Install the scheduling configuration atomically with root ownership and restrictive permissions, for example mode 0644 for a cron definition or the appropriate systemd unit permissions.
  5. Check for an existing AIDE schedule before installation and update it deterministically rather than appending duplicate entries.
  6. Use absolute paths for every executable, including the mail utility, and verify that referenced executables are root-owned and not writable by less-privileged users.
  7. Validate the reporting recipient through deployment configuration rather than retaining a placeholder address.
  8. Provide explicit rollback instructions that remove or disable the timer or cron file.
  9. Where possible, use a least-privileged dedicated account for reporting operations. If AIDE requires root access to inspect protected files, narrowly constrain the scheduled command and prevent user-controlled arguments or environment variables from entering it.
  10. Clearly state that the displayed command is an example requiring administrative review and must not be executed automatically by an agent.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 145)May include surrounding context.

sh
f-----------: /tmp/oldfile

Changed entries:
  File: /etc/passwd
    Size     : 1842       | 1901
    Mtime    : 2026-03-20 | 2026-03-24
    SHA256   : abc123...  | def456...

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This shell script is a code file, and the embedded deploy guidance includes a file write to a sensitive system file by appending directly to /etc/crontab. While the snippet is instructional, these lines do not include any warning or user-facing disclosure that they alter persistent system configuration.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/script.sh (reported line 461)May include surrounding context.

sh
>> /etc/crontab

# 5. Protect database
chmod 600 /var/lib/aide/aide.db.gz
chattr +i /var/lib/aide/aide.db.gz  # immutable flag

# 6. Store offsite copy

Static analysis

No suspicious patterns detected.