Back to skill

Security audit

Moria Skill

Security checks for vulnerabilities and agentic risk

Overview

This wallet skill needs review because it can sign real Web3 transactions while handling wallet secrets and local uploads in ways that are under-disclosed and unsafe.

Do not use this with a funded wallet in its current form. Before installing, require removal and rotation of hard-coded provider credentials, safer wallet signing or key storage, POST or protected input for wallet codes, explicit transaction previews for every asset-moving action, and no deletion of user-provided files unless the user approves it.

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

T01 · Skill Instruction Hijacking

Error
Location
BOOTSTRAP.md:18
Finding

Bootstrap Instructions Attempt to Override Agent Safety and Operational Autonomy

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/util/ipfs.ts:4
Finding

Reusable Pinata Bearer Credential Is Hard-Coded in Source Code

Content
View full analysis
"; ``` The committed value is a complete JWT bearer credential containing scoped Pinata key information. It is redacted here to avoid further credential disclosure. The credential is subsequently transmitted as follows: ```typescript const res = await fetch(PINATA_PIN_URL, { method: "POST", headers: { Authorization: `Bearer ${pinataJWT}` }, body: form, }); ``` ### Technical Analysis A reusable bearer token is embedded directly in the distributed source. Every recipient of the Skill can extract and reuse it outside the application. File permissions or documentation-level confidentiality rules do not protect a secret committed in source code. The token is used to authenticate uploads to Pinata. Bearer credentials provide access to any caller possessing the token, without an additional proof of identity. ### Attack Path 1. An attacker downloads or reads the Skill source. 2. The attacker extracts the JWT from `scripts/util/ipfs.ts`. 3. The attacker sends requests directly to Pinata with the token in the `Authorization` header. 4. The attacker performs any operation permitted by the credential's scope. 5. The associated account may incur quota consumption, unwanted content hosting, operational disruption, or suspension. ### Impact Assessment The attacker obtains the Pinata permissions assigned to the exposed scoped key. The exact server-side scope was not independently verified, but the code demonstrates authorization for IPFS pinning. Abuse may consume service quota, publish unwanted content under the account, and cause account or application disruption. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/config.ts:55
Finding

Wallet Private Key Encryption Uses a Decryption Key Stored Beside the Ciphertext

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/lib/wallet.ts:9
Finding

Wallet Retrieval Code Is Sent Through a URL Query Parameter

Content
View full analysis
{ const res = await fetch(`${HOST}/api/agent/wallet?code=${code}`, { headers: { 'accept': 'application/json' } }); ``` The documented invocation also passes the code as a process argument: ```bash npm run config:set ``` ### Technical Analysis The account code is used to retrieve a wallet object containing `private_key`, yet it is transmitted in a GET query string. Query parameters may be retained in HTTP access logs, reverse-proxy logs, monitoring products, browser or tooling histories, and diagnostic output. The code is also passed through `process.argv`, which can expose it through shell history and process inspection on some systems. The code is not URL-encoded before interpolation, creating additional request-integrity problems when it contains reserved characters. TLS protects the request in transit but does not prevent endpoint, proxy, process, or logging layers from recording the URL. ### Attack Path 1. A user provides the Moria account code. 2. The agent invokes `config:set` with the code as a command-line argument. 3. The script places the code into the wallet endpoint's query string. 4. The code is retained in shell history, process telemetry, server logs, or proxy logs. 5. An attacker with access to one of those records extracts the code. 6. If the code is reusable, the attacker calls the wallet endpoint and retrieves wallet data, potentially including private-key material. ### Impact Assessment Depending on server-side expiration and authorization controls, the exposed code may permit retrieval of the user's wallet object and compromise of the associated signing key. Even if one-time use is enforced, the code le ...[truncated 97 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/lib/tokens.ts:15
Finding

Privy Device Identifier Is Repeatedly Transmitted in Query Strings

Content
View full analysis
{ const res = await fetch(`${HOST}/api/agent/my_tokens?privy_device_id=${encodeURIComponent(privy_device_id)}`, { headers: { 'accept': 'application/json' } }); } export async function getMyMinttoTokens(privy_device_id: string): Promise { const res = await fetch(`${HOST}/api/agent/my_mintto_tokens?privy_device_id=${encodeURIComponent(privy_device_id)}`, { headers: { 'accept': 'application/json' } }); } export async function getMintToTokens(privy_device_id: string): Promise { const res = await fetch(`${HOST}/api/agent/mintto_tokens?privy_device_id=${encodeURIComponent(privy_device_id)}`, { headers: { 'accept': 'application/json' } }); } export async function getDammV2Tokens(privy_device_id: string): Promise { const res = await fetch(`${HOST}/api/agent/dammv2_tokens?privy_device_id=${encodeURIComponent(privy_device_id)}`, { headers: { 'accept': 'application/json' } }); } ``` ### Technical Analysis The device identifier is placed in URL query strings for both user-specific and general token-list operations. URLs are commonly retained in infrastructure logs and telemetry, allowing persistent correlation of the user's account activity. No separate authorization header, signed request, or session credential is visible in these calls. If the server treats `privy_device_id` as authorization rather than only as an identifier, anyone who learns it may query user-specific data. Server-side behavior was not available for confirmation, so unauthorized access is conditional; query-string exposure itself is confirmed. The identifier is function ...[truncated 945 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.ts:22
Finding

Shared Helius RPC API Key Is Embedded in Source and URL Query Strings

Content
View full analysis
', prod: 'https://mainnet.helius-rpc.com/?api-key=', }; const rpcEndpoint = RPC_ENDPOINTS.prod; ``` The actual source contains a complete shared API key. It is redacted here to prevent further disclosure. ### Technical Analysis The same Helius API key is embedded in every distributed copy of the Skill and included in all RPC endpoint URLs. Any user can extract and reuse it. Query-string placement also increases the chance that the key will be recorded by URL-oriented logs or telemetry. Although RPC keys commonly do not directly grant wallet signing authority, they can carry quotas, billing exposure, endpoint access, or service-level privileges. ### Attack Path 1. An attacker reads `scripts/config.ts`. 2. The attacker extracts the Helius API key. 3. The attacker sends arbitrary RPC traffic using the shared key. 4. The attacker consumes quota or triggers provider rate limits. 5. Legitimate Skill users experience degraded service or account-level billing and operational consequences. ### Impact Assessment The likely impact is unauthorized use of the Helius project, quota exhaustion, rate limiting, cost exposure, and service disruption. The key does not itself expose the locally loaded Solana private key. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/pool.ts:54
Finding

Token Creation Deletes Uploaded Local Files Without Explicit Consent

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (164)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the underlying code performs third-party file upload, local file reads, IPFS URL generation, and uses hardcoded credentials while claiming to be a wallet skill, that is a serious hidden-behavior issue. This can expose local files, leak secrets to external services, and expand the attack surface far beyond user-expected blockchain operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill advertises multiple chain-affecting asset operations but does not provide a prominent overall risk warning about irreversible transactions, slippage, fraud, wallet compromise, or smart-contract risk. Users may authorize actions without understanding that mistakes can permanently lose funds.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instructions tell the agent to execute commands directly after intent confirmation and to avoid follow-up questions for missing optional parameters. For financial operations, this weakens consent and increases the likelihood of unintended defaults, wrong assets, wrong amounts, or poor execution settings being used on irreversible transactions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The buy/sell workflow examples use commands that contradict the documented commands, which can cause the agent to invoke the wrong operation or a non-existent script during financial transactions. In a DeFi context, command confusion can lead to failed safeguards, accidental trades, or execution of unintended scripts if similarly named handlers exist.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The sell workflow contradicts the earlier documented sell command, which is particularly dangerous because selling is irreversible and affects user holdings. A misdocumented command can produce unintended trades or invoke an alternate script with different semantics or protections.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The refund workflow contradicts the earlier documented refund command, creating ambiguity around which script actually performs the asset movement. When funds are involved, such ambiguity can result in no-op failures, invocation of the wrong script, or abuse if a typoed command resolves to a different executable path.

Content

No source excerpt is available for this finding.

Memory Manipulation

High
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · lib/@moria/moria-sdk/dist/index.d.ts (reported line 8116)May include surrounding context.

ts
{
            code: 6049;
            name: 'failToValidateSingleSwapInstruction';
            msg: 'Fail to validate single swap instruction in rate limiter';
        },
        {
            code: 6050;

Memory Manipulation

High
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · lib/@moria/moria-sdk/dist/index.js (reported line 9068)May include surrounding context.

js
{
            code: 6049;
            name: 'failToValidateSingleSwapInstruction';
            msg: 'Fail to validate single swap instruction in rate limiter';
        },
        {
            code: 6050;

Memory Manipulation

High
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · lib/@moria/moria-sdk/dist/index.mjs (reported line 9062)May include surrounding context.

js
{
            code: 6049;
            name: 'failToValidateSingleSwapInstruction';
            msg: 'Fail to validate single swap instruction in rate limiter';
        },
        {
            code: 6050;

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file exposes operator/admin primitives such as config creation, operator account management, pool status changes, and fee updates that are not justified by the stated end-user skill purpose. In an agent setting, undocumented administrative transaction constructors significantly raise the risk of privilege misuse, accidental signing prompts, or covert control-plane actions against external protocols.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The SDK also exposes advanced liquidity-position, reward, vesting, split-position, and farming controls that are unrelated to simple token management as described in the manifest. In the context of a wallet-managing agent, these extra capabilities expand the action space to complex DeFi operations that can lock funds, alter positions, or incur losses well beyond what a user would reasonably expect.

Content

No source excerpt is available for this finding.