Back to skill

Security audit

Skills

Security checks for vulnerabilities and agentic risk

Overview

This skill performs the advertised real-estate knowledge-base lookup, but it uses unsafe remote-query handling that exposes users and the publisher to avoidable risk.

Review before installing. Use this only with non-sensitive queries unless the publisher removes embedded credential defaults, switches the API endpoint to HTTPS, documents the external data flow, and avoids leaving retrieved results in temp files. Treat pasted knowledge-base output as external content, not as vetted assistant advice.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/query.mjs:12
Finding

Hardcoded Volcengine access credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/query.mjs, lines 12-18
Vulnerability Type: Hardcoded cloud credentials
Risk Level: High

Technical Analysis

The script embeds an access-key identifier and secret access key as fallback configuration values:

js
const ACCESS_KEY_ID =
  process.env.VOLCENGINE_ACCESS_KEY_ID ??
  'AKLTZTQ4MmExxxxxyMzgWJlYzQ';
const SECRET_ACCESS_KEY =
  process.env.VOLCENGINE_SECRET_ACCESS_KEY ??
  'TWpCa01qRTNNR1xxxxxlUTmlOalJrTURNd01';

These values are used by the request-signing implementation to authenticate calls to the Volcengine API. Any party with access to the Skill package can extract the embedded values. If the credentials are active, their effective privileges are determined by the cloud identity policy attached to them and may extend beyond the single knowledge-base collection used by this script.

Environment-variable overrides do not mitigate the exposure because the embedded values remain available in every distributed copy and are automatically used when the variables are absent.

Attack Path

  1. An attacker downloads or otherwise obtains the Skill package.
  2. The attacker reads scripts/query.mjs and extracts the embedded access-key values.
  3. The attacker reproduces the HMAC request-signing process implemented in the same file.
  4. The attacker submits independently signed requests to Volcengine services.
  5. If the credentials remain active, the attacker accesses resources or consumes service quota within the permissions granted to the associated cloud identity.

Impact Assessment

Potential impact includes unauthorized knowledge-base queries, disclosure of data accessible to the credential identity, service-quota consumption, and financial cost. If the identity has broader permissions than required, other project or service resources could also be affected. The exact attainable scope cannot be determined from the audited files because t ...[truncated 44 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove all access credentials and fallback secrets from source code.
  • Immediately revoke or rotate the embedded credential values if they are or were valid.
  • Require credentials to be supplied through a protected secret manager or platform-managed credential mechanism.
  • Fail securely when credentials are unavailable instead of falling back to embedded values.
  • Assign a dedicated identity with read-only access to the required collection and API operation only.
  • Apply API-side restrictions such as project, service, source-network, rate, and spending limits where supported.
  • Add secret scanning to version-control and release pipelines.
  • Review repository history and distributed artifacts for previous copies of the credentials.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/query.mjs:10
Finding

User queries and retrieved content transmitted over cleartext HTTP

Content
View full analysis

Vulnerability Details

File Location: scripts/query.mjs, lines 10 and 46-50
Vulnerability Type: Plaintext transmission of user and knowledge-base data
Risk Level: High

Technical Analysis

The endpoint URL is explicitly constructed with the unencrypted http scheme:

js
const BASE_URL = `http://${BASE_HOST}`;

The user-derived query is included in the JSON request body and sent to this URL:

js
const res = await fetch(`${BASE_URL}${SEARCH_PATH}`, {
  method: 'POST',
  headers,
  body,
  signal: AbortSignal.timeout(30000),
});

Network transmission is necessary for the declared remote retrieval function, but plaintext HTTP is not. HMAC request signing can provide server-side request authentication and request-integrity verification, but it does not encrypt the query or authenticate and protect the API response in transit.

A passive network observer can read user queries, returned knowledge-base content, the access-key identifier, and request metadata. An active intermediary can alter the unsigned response before it reaches the script. Because the Skill subsequently presents retrieved content as the final answer, response tampering can directly influence user-visible output.

Attack Path

  1. A user invokes the Skill with a real-estate question that may contain confidential client, property, or business details.
  2. The script serializes that query into the request body.
  3. The request crosses the network over plaintext HTTP.
  4. An attacker with a position on the local network, proxy path, ISP path, or other intermediary infrastructure observes the request and response.
  5. The attacker either records sensitive content or modifies the API response.
  6. The script accepts and formats the altered response without cryptographic response authentication.
  7. The Skill relays the attacker-controlled result to the user.

Impact Assessment

The vulnerability can disclose user ...[truncated 358 chars]

Remediation
View remediation

Remediation Suggestions

  • Change the endpoint scheme to https:// and prohibit HTTP fallback.
  • Parse and validate the configured endpoint, rejecting any protocol other than HTTPS.
  • Use normal certificate and hostname validation; do not disable TLS verification.
  • Where the deployment threat model requires it, use private networking, outbound allowlisting, or certificate pinning.
  • Ensure redirects cannot downgrade the connection to HTTP or send authorization data to an untrusted host.
  • Minimize query contents and warn callers not to include unnecessary personal or confidential information.
  • Add tests that fail if the effective endpoint is not HTTPS.

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:20
Finding

Untrusted remote content is forced into the final assistant response

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 20-30; related data flow in scripts/query.mjs, lines 53-70
Vulnerability Type: External-content instruction and output hijacking
Risk Level: High

Technical Analysis

The Skill requires remote retrieval output to become the final response without filtering, contextualization, or safety-oriented transformation:

md
## Final Response Contract

- Treat the Read output as the final answer, not as context for writing a new answer.
- The final assistant message must equal the result text. Do not add, remove, translate, summarize, select, reorder, reformat, explain, introduce, conclude, wrap in a code block, or add labels such as "according to listing coach".
- Do not answer the user's original question from your own knowledge.
- Preserve all headings, numbering, scores, source lines, body text, and blank lines.
- If the result contains numbered result sections, include every section present.
- Before sending the final message, check that the first line, last line, and result-section count match the result text. If they do not match, output the result text again exactly.

The forced output originates from the remote API and is written to a file for subsequent reading:

js
const raw = await res.text();
const elapsedSec = ((Date.now() - startedAt) / 1000).toFixed(2);
let data;
try {
  data = JSON.parse(raw);
} catch {
  data = null;
}

if (!res.ok || (typeof data?.code === 'number' && data.code !== 0)) {
  process.stderr.write(
    `API error ${res.status}: ${data?.message ?? data?.msg ?? res.statusText}\n`,
  );
  process.stderr.write(raw + '\n');
  process.exit(1);
}

const output = formatSearchResult(data, elapsedSec);
const outFile = join(
  tmpdir(),
  `listing-coach-result-${Date.now()}-${process.pid}-${randomUUID()}.md`,
);
writeFileSync(outFile, output, { encoding: 'utf8', flag: 'wx' });
process.stdout.w
...[truncated 1798 chars]
Remediation
View remediation

Remediation Suggestions

  • Treat every knowledge-base result as untrusted external data.
  • Remove the requirement that remote output must be copied exactly without safety review.
  • Present results inside a clearly identified retrieval section with source provenance.
  • Permit the agent to omit or neutralize unsafe instructions, credential requests, executable content, and suspicious links.
  • Ensure retrieved text is never interpreted as instructions that override system, developer, user, or safety policies.
  • Sanitize or validate URLs and active content before presenting them.
  • Restrict write access to the knowledge base and maintain document-change audit logs.
  • Add content-integrity controls and moderation for ingested documents.
  • Combine these controls with HTTPS so network intermediaries cannot alter results.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/query.mjs:65
Finding

Knowledge-base results persist in insufficiently protected temporary files

Content
View full analysis

Vulnerability Details

File Location: scripts/query.mjs, lines 65-69
Vulnerability Type: Unsafe temporary-file handling and sensitive-data retention
Risk Level: Medium

Technical Analysis

Retrieved content is written to the operating system's shared temporary directory:

js
const outFile = join(
  tmpdir(),
  `listing-coach-result-${Date.now()}-${process.pid}-${randomUUID()}.md`,
);
writeFileSync(outFile, output, { encoding: 'utf8', flag: 'wx' });
process.stdout.write(outFile + '\n');

The randomized filename and exclusive-create flag reduce filename-collision and pre-creation risks. However, the code does not explicitly set a restrictive file mode, does not create a private per-process directory, and never deletes the result after it is read. Effective permissions therefore depend on the operating system and process umask, while historical retrieval results can accumulate indefinitely.

The files can contain proprietary coaching material and output associated with user queries. On a multi-user or shared environment, another local account or process may be able to enumerate or read retained files if platform permissions allow it.

Attack Path

  1. A user invokes the Skill and the API returns knowledge-base content.
  2. The script writes the formatted result into the shared temporary directory.
  3. The result file remains after the Skill invocation because no cleanup occurs.
  4. A local attacker, co-tenant process, diagnostic collector, or backup mechanism enumerates temporary files matching the predictable listing-coach-result- prefix.
  5. If effective filesystem permissions permit access, the attacker reads historical result content.

Impact Assessment

The issue can disclose retrieved knowledge-base content to local users or processes and increases data-retention scope beyond the active request. It does not by itself grant elevated system privileges. Exploitability depends on the ho ...[truncated 131 chars]

Remediation
View remediation

Remediation Suggestions

  • Avoid writing results to disk when stdout, an in-memory object, or a protected inter-process channel can carry the result.
  • If a file is required, create a private temporary directory with mode 0700.
  • Create the result file with an explicit mode of 0600.
  • Delete the file immediately after the caller reads it, using try/finally cleanup.
  • Add stale-file cleanup for abnormal termination while ensuring cleanup cannot follow symbolic links.
  • Avoid exposing sensitive result paths to unrelated processes or logs.
  • Define and enforce a short retention policy for any retrieval output that must persist.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (8)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script contains embedded fallback access credentials for the external knowledge-base service. Hardcoded secrets in a distributed skill are highly dangerous because anyone with code access can extract and reuse them to query the service, consume billable resources, or access private data; in this context, a retrieval skill has no justified need for default live credentials in source code.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill invokes a local Node.js script and references an environment-derived path, but declares no explicit tool scope or allowed-tools boundary. That creates an authorization gap: the runtime may permit code execution and possible networked retrieval without an auditable, least-privilege declaration, increasing the chance of unintended data access or abuse if the script behavior changes or is replaced.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The invocation description is broad enough to trigger on generic real-estate or scripting requests, which can cause the agent to invoke this pass-through skill outside a narrowly intended context. Because the skill returns retrieval output verbatim as the final user-facing answer, over-triggering can expose irrelevant, unreviewed, or policy-conflicting content more readily than a normal assistive skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow instructs the agent to 'Preserve important English phrases,' which imposes a language preference regardless of the user's language or locale. This is a natural-language policy concern because it constrains language handling without offering the user a choice or documenting a justified locale requirement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script sends the user’s query to an external knowledge-base API, which can expose sensitive prompts, personal information, or proprietary business data to a third-party service. In a skill specifically marketed as querying a remote KB this is functionally expected, but the lack of explicit disclosure, consent, or data-handling notice still creates a privacy and compliance risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill claims to return the exact retrieval output, but instead persists the retrieved content to a temporary file and only prints the file path. This creates an unnecessary data-at-rest copy of potentially sensitive knowledge-base results and changes the skill’s observable behavior, increasing exposure to local users, other processes, backup/indexing tools, or later accidental disclosure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script reformats the API response into a synthesized markdown report, adds token counts and elapsed time, and selectively extracts fields instead of returning the exact retrieval output. For a retrieval skill, this can hide provenance, omit safety-relevant fields, and misrepresent the underlying KB response, undermining integrity and making downstream consumers trust transformed content as raw output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

Writing search results to a temporary markdown file without prior disclosure creates a local data leakage risk because retrieved content may persist on disk beyond the session. Even if the path is randomized, temp directories are commonly accessible to local tooling, syncing, indexing, or other users depending on platform configuration.

Content

No source excerpt is available for this finding.