Back to skill

Security audit

Noya Agent

Security checks for vulnerabilities and agentic risk

Overview

This is a Noya crypto-agent client, but its helper script can send the API key and financial prompts to an unvalidated override URL and has a default-domain mismatch that users should review before installing.

Review this before installing. Use a short-lived, low-privilege Noya API key, do not set NOYA_BASE_URL unless you fully trust the destination, and assume wallet, portfolio, market, and trading instructions sent through the skill are shared with the remote Noya service. Confirm every transaction manually and rotate the key if it may have been exposed.

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

T09 · Insecure Skill Coding Practices

Error
Location
noya-message.sh:18
Finding

Unvalidated API Base URL Override Can Exfiltrate Credentials and Sensitive Financial Messages

Content
View full analysis

Vulnerability Details

File Location: noya-message.sh, lines 18 and 35–39
Vulnerability Type: Unvalidated destination override causing credential and data disclosure
Risk Level: High

Vulnerable Code

bash
BASE_URL="${NOYA_BASE_URL:-https://safenet.one}"
bash
HTTP_CODE=$(curl -s -w '%{http_code}' -o "$TMPFILE" \
  -X POST "${BASE_URL}/api/messages/stream" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ${NOYA_API_KEY}" \
  -H "x-timezone-name: ${TIMEZONE}" \
  -d "$(jq -n --arg msg "$MESSAGE" --arg tid "$THREAD_ID" \
    '{message: $msg, threadId: $tid}')")

Technical Analysis

The script permits the NOYA_BASE_URL environment variable to replace the intended API origin, https://safenet.one, without validating the URL scheme or hostname. The resulting destination receives the NOYA_API_KEY header, the user-supplied message, and the thread identifier.

An attacker who can influence the process environment, a wrapper script, shell initialization, CI configuration, or Skill runtime configuration can redirect the request to an attacker-controlled server. This behavior exceeds the minimum privilege needed for the declared functionality because normal operation only requires communication with the documented Noya API.

The request data may include portfolio questions, wallet information, swap or bridge parameters, intended transfers, prediction-market orders, DCA instructions, and other sensitive financial intent. The remote response is also presented as trusted agent output, allowing an attacker-controlled endpoint to provide fabricated market information or deceptive transaction prompts.

Attack Path

  1. The attacker gains the ability to set or influence an environment variable used by the Skill.
  2. The attacker sets NOYA_BASE_URL to an endpoint they control, such as https://attacker.example.
  3. The user invokes noya-message.sh through the documented workflow.
  4. The script sends an HTTPS request to `h ...[truncated 1308 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the base URL override if custom API origins are not essential:
bash
readonly BASE_URL="https://safenet.one"
  1. If an override is operationally necessary, enforce HTTPS and an explicit hostname allowlist before sending credentials:
bash
BASE_URL="${NOYA_BASE_URL:-https://safenet.one}"

case "$BASE_URL" in
  "https://safenet.one")
    ;;
  *)
    echo "Error: untrusted NOYA_BASE_URL" >&2
    exit 1
    ;;
esac
  1. Reject URLs containing user information, fragments, query strings, unexpected ports, or path components. Prefer parsing and validating the URL with a robust URL parser rather than shell pattern matching if multiple trusted origins are supported.

  2. Keep redirects disabled when transmitting the API key. If redirects are later enabled, never forward authentication headers across origins.

  3. Document every approved API hostname and the data sent to it. Require explicit administrator configuration rather than accepting an ambient environment variable silently.

  4. Use short-lived, narrowly scoped API keys and rotate the key immediately if exposure is suspected. Server-side authorization should independently enforce transaction confirmation and least privilege.

  5. Clearly distinguish the trusted service origin in user-facing output so responses from development or alternate environments cannot be mistaken for production responses.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The skill claims to be a Noya interface but routes traffic to https://safenet.one, a different domain than the user-facing agent.noya.ai, while also delegating substantive behavior to a generic remote agent. This mismatch can mislead users and reviewers about where sensitive trading prompts, portfolio data, and confirmation flows are actually processed, increasing phishing, trust-boundary, and data-handling risk.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · reference.md (reported line 216)May include surrounding context.

md
---

## DELETE /api/threads/:threadId

Delete a conversation thread.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · reference.md (reported line 330)May include surrounding context.

md
---

## DELETE /api/chat/session/:sessionId

Clear all message history for a session.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · reference.md (reported line 407)May include surrounding context.

md
List all API keys for the authenticated user. Returns prefixes only, never full keys.

### DELETE /api/keys/:id

Revoke an API key (soft delete).

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill exposes shell-based execution patterns (bash, curl, python3, uuidgen, jq) but does not declare a restrictive tool scope such as permissions or allowed-tools. That increases the blast radius because an agent invoking this skill may be able to perform broader command execution than the skill description makes explicit, especially in a high-risk crypto-trading context.

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

md
## Setup

1. Create an account at [agent.noya.ai](https://agent.noya.ai)
2. Go to Settings > API Keys and generate a key
3. Store the key securely — it is only shown once
4. Set the environment variable:

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The skill sends user prompts, thread identifiers, and authenticated requests to an external service, which is expected behavior but still a real security/privacy risk because sensitive wallet, portfolio, and trading intent data leave the local environment. In a crypto context, external transmission of account-linked activity and transaction instructions is particularly sensitive and can lead to privacy loss, account targeting, or unauthorized action if the remote service is compromised or misused.

Content

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

bash {baseDir}/noya-message.sh "Yes" "SAME_THREAD_ID"

text

## API Reference (curl commands)

All endpoints require the `x-api-key` header. Base URL: `https://safenet.one`

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The OpenAI-compatible chat completion endpoint also transmits user messages and session identifiers to the external service, creating another data egress path outside the local system. Even without agent tools, this can expose sensitive financial queries, strategy information, or identifiers to a third party.

Content

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

Chat Completion (OpenAI-compatible, no agent tools)

bash
curl -s -X POST "https://safenet.one/api/chat/completions" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $NOYA_API_KEY" \
  -d '{"sessionId": "SESSION_ID", "message": "Hello, what can you do?"}'

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## Important Notes

### Transaction Confirmation
Noya always asks for user confirmation before executing on-chain transactions (swaps, bridges, transfers, orders). The response will include a `[REQUIRES INPUT]` section with details and options. Always relay this to the user and send their answer as a follow-up in the same thread. Never auto-confirm transactions.

### Wallet Delegation (Website Only)
If Noya responds with a **delegation request**, the user must complete this on the website:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script’s help text says the default service is agent.noya.ai, but the actual code silently sends requests and the x-api-key header to https://safenet.one. This mismatch can mislead users into disclosing sensitive prompts, thread identifiers, and API credentials to an unexpected third party, which is especially dangerous in a crypto-trading skill where downstream actions may affect assets.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sets TIMEZONE="America/New_York" and always sends it in the x-timezone-name header, which imposes a specific locale-related setting on all users. This is a natural-language/policy concern because the behavior is not optional, user-selectable, or documented as region-specific.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The script transmits user messages, thread IDs, timezone metadata, and the NOYA_API_KEY to an external endpoint, which is expected for this kind of integration but becomes dangerous here because the endpoint defaults to an unexpected domain. In a crypto and trading context, those transmitted contents can include portfolio details, trading intentions, or operational commands, making unauthorized external transmission materially risky.

Content

Scanner excerpt · noya-message.sh (reported line 35)May include surrounding context.

sh
TMPFILE=$(mktemp)
trap 'rm -f "$TMPFILE"' EXIT

HTTP_CODE=$(curl -s -w '%{http_code}' -o "$TMPFILE" \
  -X POST "${BASE_URL}/api/messages/stream" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ${NOYA_API_KEY}" \

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The example request sets x-timezone-name: America/New_York, which imposes a specific locale-related setting. The file does not indicate that this is optional, user-selected, or required for a region-specific purpose, so it can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.