Back to skill

Security audit

Agentnotes

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent external logging integration, but it needs review because it can send broad agent activity summaries and API-authenticated requests to a configurable endpoint without strong privacy or HTTPS safeguards.

Install only if you are comfortable sending operational summaries to AgentNotes. Configure a trusted HTTPS AGENTNOTES_BASE_URL for any remote service, avoid logging secrets or private message contents, keep summaries high level, and avoid running the verify command in shared logs until key-prefix printing is fixed.

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/config.mjs:7
Finding

Bearer API Key and Operational Data Can Be Transmitted over Plaintext HTTP

Content
View full analysis

Vulnerability Details

File Location: scripts/config.mjs:7-22
Vulnerability Type: Insufficient transport security for credentials and sensitive operational data
Risk Level: High

Vulnerable Code

js
const baseUrl = (process.env.AGENTNOTES_BASE_URL || "http://localhost:3000").replace(
  /\/$/,
  ""
);
const logPath = process.env.AGENTNOTES_LOG_PATH || DEFAULT_LOG_PATH;
const completePath =
  process.env.AGENTNOTES_COMPLETE_PATH || DEFAULT_COMPLETE_PATH;

return {
  apiKey,
  agentId,
  baseUrl,
  logUrl: `${baseUrl}${logPath.startsWith("/") ? logPath : `/${logPath}`}`,
  completeUrl: `${baseUrl}${
    completePath.startsWith("/") ? completePath : `/${completePath}`
  }`,
};

The resulting URLs are used with bearer authentication, for example in scripts/log.mjs:37-55:

js
const res = await fetch(logUrl, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    agent_id: agentId,
    run_id: runId,
    logs: [
      {
        step_name: stepName,
        event_type: isError ? "error" : "log",
        message: message || (isError ? "Error" : "log"),
        data,
      },
    ],
  }),
});

Equivalent authenticated requests are made in scripts/start-run.mjs:13-23, scripts/task.mjs:42-108, scripts/complete-run.mjs:36-49, and scripts/verify.mjs:25-42.

Technical Analysis

AGENTNOTES_BASE_URL is accepted without validating its protocol or host. Although the default HTTP endpoint points to localhost and may be appropriate for local development, the same code permits a remote URL such as http://agentnotes.example. Requests to such an endpoint include the API key in an Authorization: Bearer header.

The request bodies may also contain the agent identifier, run identifier, task summaries, step messages, structured data, and error details. W ...[truncated 1437 chars]

Remediation
View remediation

Remediation Suggestions

  • Parse the configured endpoint with new URL() and reject malformed URLs.
  • Require the https: protocol for every non-loopback destination.
  • If local development requires plaintext HTTP, permit it only for explicitly recognized loopback hosts such as localhost, 127.0.0.1, and [::1].
  • Reject unsupported protocols and URLs containing embedded user information.
  • Consider restricting production deployments to an explicit allowlist of trusted AgentNotes hosts.
  • Document that remote endpoints must use HTTPS with valid certificate verification.
  • Apply least privilege and rotation to AgentNotes API keys so interception has limited impact.
  • Avoid including unnecessary sensitive content in task summaries, log messages, structured data, and error details.
  • Add automated tests confirming that remote HTTP URLs are rejected while trusted HTTPS and loopback development URLs are accepted.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/verify.mjs:13
Finding

Verification Command Exposes the First Twelve Characters of the API Key

Content
View full analysis

Vulnerability Details

File Location: scripts/verify.mjs:13-16
Vulnerability Type: Partial secret disclosure through process output
Risk Level: Low

Vulnerable Code

js
console.log("AgentNotes verify");
console.log("  base:", baseUrl);
console.log("  agent:", agentId);
console.log("  key:", apiKey.slice(0, 12) + "…");

Technical Analysis

The documented verification command prints the first twelve characters of AGENTNOTES_API_KEY to standard output. Standard output may be retained in terminal history, CI logs, agent transcripts, monitoring systems, or shared diagnostic records.

Printing a substantial key prefix is unnecessary to confirm that the environment variable exists. Even if the prefix alone is insufficient for immediate authentication, it discloses secret material, reduces the unknown key space, and may expose identifying information about a credential.

Attack Path

  1. A user or automated agent runs the documented scripts/verify.mjs command.
  2. The script prints the first twelve characters of the API key.
  3. The execution environment captures standard output in a transcript, CI artifact, support bundle, or centralized log.
  4. Another party with access to that retained output obtains the key prefix.
  5. The disclosed prefix can assist credential identification, correlation, or attacks against weak or otherwise partially exposed keys.

Impact Assessment

This issue provides partial rather than complete credential disclosure, so it does not normally enable direct authentication on its own. Its practical impact depends on the key's length, entropy, format, and whether other portions are exposed elsewhere. It nevertheless violates secret-handling best practices and increases the consequences of other information leaks. No local privileges are gained directly.

Remediation
View remediation

Remediation Suggestions

  • Never print any portion of the API key. Replace the output with a fixed message such as key: configured.
  • If operators require credential identification, display a short fingerprint derived from a cryptographic hash rather than raw key characters.
  • Ensure diagnostic and error paths do not serialize environment variables or authorization headers.
  • Review existing CI logs, agent transcripts, and support artifacts for previously exposed prefixes and remove them where feasible.
  • Rotate affected keys if the exposed prefix is considered sensitive or if other portions of the same key may have been disclosed.
  • Add a test that captures verification output and asserts that it contains no substring of the configured API key.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill explicitly relies on environment variables and makes outbound requests to an external service, but it does not declare any tool scope or permissions boundary. That makes the skill's capabilities less transparent to operators and increases the chance it will be enabled or invoked without informed approval of secret access and network egress.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The description says to use the skill after cron jobs, channel replies, or multi-step sessions, which is broad enough to trigger logging across many workflows. In a skill that sends data to an external service, ambiguous invocation guidance can cause overuse and unintended disclosure of sensitive operational or user-derived information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs users to send job summaries to an external service but does not prominently warn that these summaries leave the local environment and may contain sensitive business or user information. Because the feature is framed as routine operational logging, users may disclose confidential content without realizing the privacy, compliance, or retention implications.

Content

No source excerpt is available for this finding.

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 13)May include surrounding context.

md
## Setup (once)

1. AgentNotes dashboard → create agent (note the **slug**) → copy **env vars** from **Connect**.
2. Install this skill (see dashboard Connect → OpenClaw tab, or run `install-skill.ps1` / `install-skill.sh` from the repo).
3. Add env to `~/.openclaw/openclaw.json`:

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The 'When to log' section instructs use after any user message, cron completion, or skill/tool chain finish, which is an overly broad trigger for a networked logging skill. Without constraints, this can normalize sending externally visible summaries for nearly all activity, including sensitive conversations, incident details, or regulated data contexts.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This script transmits arbitrary message and JSON data to a remote logging service without any validation, redaction, or consent boundary. In an agent skill context, logs often contain task outputs, errors, prompts, tokens, or user content, so this can unintentionally exfiltrate sensitive information to an external service whenever callers pass rich data into --data or message fields.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code reads an API key and agent identifier from environment variables, which is a sensitive operation under the warning criteria for code files. There is no confirmation prompt, logging, comment, or docstring in this file disclosing that credentials are being consumed.

Content

No source excerpt is available for this finding.