Back to skill

Security audit

Dht11 Temp

Security checks for vulnerabilities and agentic risk

Overview

This DHT11 sensor skill is simple and not deceptive, but it asks users to run Python with sudo and includes a recurring privileged cron example without enough safeguards.

Review before installing. Prefer running this under least-privilege GPIO permissions instead of sudo, avoid the privileged cron example unless you harden the script path and scheduling, pin or otherwise trust the RPi.GPIO dependency, and be aware the current script may report temperature and humidity in the wrong order.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T06 · System Persistence

Error
Location
SKILL.md:60
Finding

Recurring Privileged Cron Execution Creates a Persistence and Privilege-Escalation Risk

Content
View full analysis
> /var/log/dht.log 2>&1 ``` ### Technical Analysis The documentation recommends configuring a cron entry that executes the sensor script every 30 minutes through `sudo`. This creates cross-session scheduled execution and exceeds the minimum privileges required for an on-demand temperature and humidity reading. The command executes a script located below a user's home directory. If the script or a parent directory is writable by a less-privileged user, replacing the script can turn the scheduled command into a privileged execution mechanism. Successful unattended execution depends on the host's `sudoers` configuration; if passwordless execution is not permitted, the task may fail instead. If passwordless execution is permitted, compromise of the referenced script can result in root-level command execution. The command also references `scripts/dht/main.py`, while the package contains `scripts/main.py`. This mismatch may lead users to create wrappers or copies at an unintended, insufficiently protected location. ### Attack Path 1. A user follows the documentation and installs the recurring cron entry. 2. The system permits unattended `sudo` execution for Python or the referenced command. 3. An attacker compromises the account, another process running as that account, or any writable component of the referenced path. 4. The attacker replaces `~/scripts/dht/main.py` with malicious Python code. 5. Cron reaches the next 30-minute interval and invokes the modified script through `sudo`. 6. The attacker's code executes with the privileges granted by the applicable `sudoers` rule, potentially including root. ### Impact Assessment If unattended `sudo` is available, exploitation may provide persisten ...[truncated 489 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:23
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/main.py:38
Finding

Unbounded GPIO Busy-Wait Loops Permit Local Denial of Service

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (9)

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.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
92% confidence
Finding

This specific command tells users to execute the Python script as root. Any compromise of the script, its dependencies, or its path would execute with full privileges, magnifying the blast radius beyond a normal sensor read operation.

Content

Scanner excerpt · SKILL.md (reported line 35)May include surrounding context.

Read Sensor (default pin 19)

bash
sudo python3 scripts/dht/main.py

Read Sensor (custom pin)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation repeatedly instructs users to run the script with sudo but provides no warning about the risks of executing Python code with elevated privileges. If the referenced script is modified, replaced, or contains bugs, running it as root can lead to full system compromise or unintended privileged changes.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
92% confidence
Finding

The custom-pin example also runs the script with sudo, exposing the same root-execution risk while additionally normalizing privileged use for parameterized invocations. Although the pin number itself is not dangerous here, the command pattern encourages unnecessary elevation for routine use.

Content

Scanner excerpt · SKILL.md (reported line 40)May include surrounding context.

Read Sensor (custom pin)

bash
sudo python3 scripts/dht/main.py 4     # Uses GPIO 4

Using Environment Variable

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
90% confidence
Finding

This example combines environment-variable configuration with root execution. While the shown variable is only a GPIO pin, running a Python program under sudo can interact unexpectedly with environment handling and still exposes users to root-level consequences if the script or environment is manipulated.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

Using Environment Variable

bash
export DHT_PIN=4
sudo python3 scripts/dht/main.py

Output

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
89% confidence
Finding

This cron command runs the script as root on a schedule, turning any script flaw or tampering into a persistent privileged execution path. The appended root-owned log file under /var/log can also create operational issues such as uncontrolled growth or permission complications.

Content

Scanner excerpt · SKILL.md (reported line 64)May include surrounding context.

bash
# Read every 30 minutes
*/30 * * * * sudo python3 ~/scripts/dht/main.py >> /var/log/dht.log 2>&1

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The function returns (temperature, humidity) at L76, but the caller assigns the result as h, t at L85 and then prints t before h at L87-L88. This contradicts the module/function intent expressed in the docstring and manifest that the script reads and reports temperature and humidity correctly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The wiring section contains German terms (oder, Widerstand) embedded in an otherwise English document. This imposes a language assumption without user opt-in or explanation, which is a natural-language locale inconsistency under the policy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The crontab example schedules privileged execution and appends logs to /var/log/dht.log without warning about root-owned files, log growth, or the risks of recurring root execution. This increases operational risk because any issue in the script becomes a persistent privileged task and may create filesystem or maintenance problems.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.