Back to skill

Security audit

LibreNMS

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent read-only LibreNMS monitoring helper, but it sends the API token with TLS certificate verification disabled by default.

Install only if you are comfortable editing or constraining it first: remove curl's -k/-sk default, use a trusted CA or --cacert for self-signed LibreNMS certificates, give the token minimum read-only server-side permissions, keep the config file private, and avoid saving reports to shared /tmp paths.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/librenms.sh:56
Finding

API Token Transmitted Without TLS Certificate Verification

Content
View full analysis
&1) || { ``` The insecure behavior is also explicitly documented in `SKILL.md:67,115-117` and `README.md:172,185`. ### Technical Analysis The `-k` option instructs curl to accept a server certificate without verifying its trust chain or hostname. Because this option is enabled for every API request, the client cannot authenticate that it is communicating with the configured LibreNMS server. The request transmits the LibreNMS API token in the `X-Auth-Token` header. An attacker capable of intercepting or redirecting network traffic can present an arbitrary certificate, terminate the TLS connection, and recover the token. The attacker can also modify responses to provide false device status, alert, health, or port information. Using a self-signed certificate does not require globally disabling certificate verification. A private certificate authority or a pinned server certificate can be explicitly trusted instead. ### Attack Path 1. A user configures the Skill with a valid LibreNMS URL and API token. 2. The attacker obtains a network interception position, compromises DNS, controls a proxy, or otherwise redirects the connection. 3. The attacker presents an untrusted or hostname-mismatched TLS certificate. 4. Curl accepts that certificate because the command uses `-k`. 5. The Skill sends the `X-Auth-Token` header to the attacker-controlled endpoint. 6. The attacker captures and reuses the token against the genuine LibreNMS API, subject to the privileges assigned to the associated LibreNMS account. 7. The attacker may additionally return fabricated API data to conceal outages or generate misleading monitoring results. ### Impact A ...[truncated 748 chars]
Remediation
View remediation
&1) ``` 2. Add an optional configuration value for a private CA certificate and pass it through `--cacert`: ```bash curl_args=(-sS -w "\n%{http_code}") if [[ -n "${LIBRENMS_CA_CERT:-}" ]]; then curl_args+=(--cacert "$LIBRENMS_CA_CERT") fi response=$(curl "${curl_args[@]}" \ -H "X-Auth-Token: $API_TOKEN" \ -H "Accept: application/json" \ "$url" 2>&1) ``` 3. If an insecure mode must be retained for troubleshooting, make it an explicit opt-in setting such as `LIBRENMS_INSECURE_TLS=1`, emit a prominent warning, and prohibit its use by default. 4. Update `README.md` and `SKILL.md` to recommend installing a private CA or supplying a CA bundle rather than using `curl -k`. 5. Validate that `LIBRENMS_URL` uses the `https` scheme before sending the token. 6. Rotate any API token that has previously been used over an untrusted network with TLS verification disabled. 7. Assign the LibreNMS token the minimum server-side permissions required for monitoring. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
README.md:151
Finding

Predictable Shared Temporary File for Infrastructure Reports

Content
View full analysis
/tmp/daily-infra.txt librenms down >> /tmp/daily-infra.txt librenms alerts >> /tmp/daily-infra.txt ``` ### Technical Analysis The documented daily-report integration writes monitoring data to a fixed path in the globally shared `/tmp` directory. It does not create the file atomically, restrict its permissions, verify its ownership, or protect against symbolic links. On systems where `/tmp` is writable by untrusted local users, an attacker can pre-create `/tmp/daily-infra.txt` as a symbolic link to another file writable by the user running the report. The shell follows that link when processing `>` and `>>`, potentially truncating or modifying the linked target. The generated file may also inherit a permissive process umask. This can make infrastructure details readable by other local users, including hostnames, IP addresses, outage information, and active alert details. This issue is present in documentation rather than the executable Skill script, but users are directly encouraged to copy the pattern into heartbeat or scheduled automation. ### Attack Path 1. An administrator copies the documented commands into a recurring report or heartbeat job. 2. A local attacker predicts the fixed path `/tmp/daily-infra.txt`. 3. The attacker either: - pre-creates a readable file at that path to collect report output, or - creates a symbolic link from that path to another file writable by the report user. 4. The scheduled job executes the first redirection with `>`. 5. The shell follows the attacker-controlled path, truncating the linked target or writing sensitive infrastructure data into an attacker-accessible file. 6. Subsequent `>>` operations append down-device and active-alert information. ### Impact Assessment A lo ...[truncated 603 chars]
Remediation
View remediation
"$report_file" # Consume or securely move the report here. ``` For reports that must persist, create a dedicated user-owned directory outside shared `/tmp`, set its mode to `0700`, create report files with mode `0600`, and use unique filenames. Documentation should explicitly warn that reports contain potentially sensitive infrastructure data. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The README explicitly states the script uses curl with the '-k' flag, which disables TLS certificate verification and makes HTTPS connections vulnerable to man-in-the-middle interception. Because the same channel carries the API token, an attacker on the network path could steal credentials and tamper with monitoring responses while appearing legitimate.

Content

Scanner excerpt · README.md (reported line 172)May include surrounding context.

md
- This skill is **read-only** — no device modifications are possible
- API token is stored locally in `~/.openclaw/credentials/`
- The script uses `-k` flag for curl to accept self-signed certificates (common in LibreNMS)
- Restrict file permissions on config.json: `chmod 600 config.json`

## Troubleshooting

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 26)May include surrounding context.

  1. Install dependencies:
    bash
    # Most systems already have these
    sudo apt install curl jq bc  # Debian/Ubuntu
    sudo yum install curl jq bc  # RHEL/CentOS
    brew install curl jq         # macOS
    

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · README.md (reported line 27)May include surrounding context.

  1. Install dependencies:
    bash
    # Most systems already have these
    sudo apt install curl jq bc  # Debian/Ubuntu
    sudo yum install curl jq bc  # RHEL/CentOS
    brew install curl jq         # macOS
    

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

The skill instructs users to persist the LibreNMS API token in a local plaintext JSON file under the home directory. While common, persistent local credential storage increases the blast radius of workstation compromise, accidental backup leakage, or overly broad file access by other local processes.

Content

Scanner excerpt · README.md (reported line 31)May include surrounding context.

brew install curl jq # macOS

text

3. Create configuration file:
```bash
mkdir -p ~/.openclaw/credentials/librenms
cat > ~/.openclaw/credentials/librenms/config.json << EOF

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 · README.md (reported line 40)May include surrounding context.

"api_token": "your-api-token-here" } EOF chmod 600 ~/.openclaw/credentials/librenms/config.json

text

4. Get your API token:

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 · README.md (reported line 173)May include surrounding context.

md
- This skill is **read-only** — no device modifications are possible
- API token is stored locally in `~/.openclaw/credentials/`
- The script uses `-k` flag for curl to accept self-signed certificates (common in LibreNMS)
- Restrict file permissions on config.json: `chmod 600 config.json`

## Troubleshooting

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

Configuration

Create ~/.openclaw/credentials/librenms/config.json:

json
{
  "url": "https://librenms.example.com",

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

Configuration

Create ~/.openclaw/credentials/librenms/config.json:

json
{
  "url": "https://librenms.example.com",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation explicitly states that the script uses curl with certificate validation disabled (-sk/-k) for self-signed deployments, but it does not clearly warn users that this weakens transport security and can expose API tokens and infrastructure metadata to man-in-the-middle interception. Because this skill is used to query network inventory, health, and alert data, the data disclosed can be operationally sensitive even if the skill is read-only.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This is a real security issue because the script uses curl with the -k flag, which disables TLS certificate verification for all API requests. An attacker able to intercept traffic could impersonate the LibreNMS server, capture the API token, and return falsified monitoring data, undermining both confidentiality and integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This markdown file includes concrete internal infrastructure identifiers such as hostnames, private IPs, and alert/reporting examples, but it does not warn users that command output may contain sensitive network inventory data. For a monitoring skill that can surface environment details and send them via notifications or write them to files, a brief disclosure would help users handle that data safely.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.