Back to skill

Security audit

Portfolio Risk Analyzer

Security checks for vulnerabilities and agentic risk

Overview

The skill is openly a crypto portfolio analyzer, but it also starts automated token buybacks that can spend all USDC in the configured payment wallet without clear limits or approval.

Review carefully before installing or running. Use only a dedicated low-balance hot wallet, do not put unrelated funds in the payment wallet, disable or remove the hourly buyback until spending caps and explicit approvals exist, avoid shell-sourcing .env, pin dependencies with a lockfile, and document third-party data handling for wallet, API, and voice data.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/execute-buyback.sh:14
Finding
Automated buyback can swap the payment wallet's entire USDC balance<![CDATA[ ## Vulnerability Details **File Location**: `server.js:237-245`, `scripts/execute-buyback.sh:14-39`, `scripts/execute-buyback.sh:52-58`, and `SKILL.md:556-559` **Vulnerability Type**: Unbounded automated financial transaction **Risk Level**: High ### Vulnerable Code ```javascript // Auto-buyback cron job (runs every hour) cron.schedule('0 * * * *', async () => { console.log('⏰ Running automated buyback check...'); try { const { execSync } = require('child_process'); execSync('./scripts/execute-buyback.sh 100', { stdio: 'inherit' }); } catch (error) { console.error('Buyback failed:', error); } }); ``` ```bash # Get current USDC balance USDC_BALANCE=$(node scripts/get-balance.js "$PAYMENT_WALLET_ADDRESS" "$USDC_ADDRESS") echo "💰 Current USDC balance: $USDC_BALANCE" # Minimum threshold MIN_THRESHOLD=${1:-100} if (( $(echo "$USDC_BALANCE < $MIN_THRESHOLD" | bc -l) )); then echo "⏸️ Balance below threshold ($MIN_THRESHOLD USDC). Skipping buyback." exit 0 fi echo "🔄 Executing buyback..." echo "Amount: $USDC_BALANCE USDC" echo "Target: $BANKR_TOKEN" echo "" # Execute swap via Uniswap RESULT=$(node scripts/uniswap-swap.js \ --from "$USDC_ADDRESS" \ --to "$BANKR_TOKEN" \ --amount "$USDC_BALANCE" \ --slippage 2) ``` ```bash # Optional: Burn or distribute if [[ "$BUYBACK_ACTION" == "burn" ]]; then echo "🔥 Burning $BANKR_BOUGHT BANKR..." node scripts/burn-tokens.js "$BANKR_TOKEN" "$BANKR_BOUGHT" elif [[ "$BUYBACK_ACTION" == "distribute" ]]; then echo "📤 Distributing $BANKR_BOUGHT BANKR to holders..." node scripts/distribute-to-holders.js "$BANKR_BOUGHT" else echo "💎 Holding $BANKR_BOUGHT BANKR in treasury" fi ``` The documentation also recommends an operating-system cron entry: ```bash # Add to crontab 0 * * * * cd /path/to/skill && ./scripts/execute-buyback.sh ``` ### Technical Analysis Starting the API registers an in-process hourly task that invokes the buyback script. The documentation separately ...[truncated 2590 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Use a dedicated buyback wallet that never stores unrelated funds or operational reserves. 2. Track verified fee payments in an append-only ledger and make the eligible buyback amount no greater than accounted, settled revenue. 3. Enforce explicit per-transaction, hourly, and daily spending limits. 4. Retain a configurable reserve rather than swapping the complete wallet balance. 5. Calculate and enforce an absolute `amountOutMinimum` from an independent price source; reject stale quotes and excessive price impact. 6. Validate the chain ID, USDC contract, BANKR contract, router address, and token decimals before signing. 7. Make automatic buybacks disabled by default and require an explicit opt-in configuration. 8. Require manual or multisignature approval for transactions above a conservative threshold. 9. Separate portfolio-analysis service credentials from transaction-signing infrastructure. 10. Do not enable both the in-process scheduler and operating-system cron simultaneously. 11. Add idempotency and locking so overlapping jobs cannot submit duplicate transactions. 12. Implement and review the currently absent helper scripts before enabling this workflow. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/execute-buyback.sh:5
Finding
Shell sourcing of .env permits arbitrary command execution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/execute-buyback.sh:5-7` **Vulnerability Type**: Unsafe configuration-file execution **Risk Level**: Medium ### Vulnerable Code ```bash set -e # Load environment source .env 2>/dev/null || true ``` ### Technical Analysis The Bash `source` command interprets `.env` as shell program text rather than as a passive key-value configuration file. Consequently, command substitutions, function definitions, redirections, and arbitrary shell statements contained in `.env` execute with the privileges of the buyback process. This is particularly sensitive because the same workflow is intended to access a payment-wallet address and transaction-signing functionality. Suppressing errors and appending `|| true` can also conceal malformed or malicious configuration behavior from the operator. The issue does not independently allow a remote attacker to modify `.env`; exploitation requires an attacker or unsafe provisioning process to gain influence over that local file. Once such influence exists, however, scheduled execution provides a reliable trigger. ### Attack Path 1. An attacker, compromised deployment process, or untrusted configuration template writes shell syntax into the project-local `.env` file. 2. The operator manually invokes the buyback script, the API's hourly scheduler invokes it, or the documented crontab entry runs it. 3. Bash processes `source .env`. 4. Embedded commands execute before the balance check and swap operation. 5. Those commands can read files accessible to the service account, alter transaction parameters, invoke other programs, or transmit available secrets over the network. For example, a command substitution assigned to an otherwise legitimate-looking variable would execute while the file is sourced. ### Impact Assessment Successful exploitation provides arbitrary command execution under the operating-system account running the buyback task. The accessible scope includes p ...[truncated 359 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not use `source`, `.`, or `eval` to load dotenv files. 2. Load configuration through a dotenv parser that treats values as data, or export required variables from a trusted service manager. 3. Maintain an allowlist of accepted variable names and reject unknown entries. 4. Validate wallet addresses, token addresses, numeric thresholds, slippage values, and action values before use. 5. Reject command substitutions, shell metacharacters, newlines, and malformed assignments if shell-side parsing is unavoidable. 6. Store signing keys in a secrets manager, hardware wallet, or narrowly scoped signing service rather than a project-local `.env` file. 7. Restrict `.env` ownership and permissions to the dedicated service account, such as mode `0600`. 8. Fail closed and report configuration parsing errors instead of suppressing them with `2>/dev/null || true`. 9. Run the task under a dedicated non-root account with minimal filesystem and network permissions. ]]>

T08 · Insecure Dependencies

Note
Location
package.json:11
Finding
Unpinned dependency resolution makes installations non-reproducible<![CDATA[ ## Vulnerability Details **File Location**: `package.json:11-24`; installation instructions in `README.md:15-19` and `SKILL.md:103-107` **Vulnerability Type**: Dependency supply-chain exposure **Risk Level**: Low ### Vulnerable Code ```json "dependencies": { "express": "^4.18.2", "ethers": "^6.10.0", "axios": "^1.6.5", "dotenv": "^16.4.1", "node-cron": "^3.0.3", "twilio": "^4.21.0", "@uniswap/v3-sdk": "^3.11.2", "@uniswap/sdk-core": "^5.0.0" }, "devDependencies": { "nodemon": "^3.0.3" } ``` The documented installation flow is: ```bash npm install ``` ### Technical Analysis Dependency versions use caret ranges, allowing future compatible releases to be selected. No package lockfile was present in the audited directory. As a result, two installations performed at different times can resolve different package versions even though the reviewed source files are unchanged. No malicious or typosquatted dependency was confirmed during this static review. The weakness is that the deployed dependency graph is not fixed to the graph that was reviewed. This matters because the process performs network requests, handles RPC credentials, and is designed to interact with wallet-signing functionality. ### Attack Path 1. A dependency or transitive dependency publishes a later version allowed by an existing semver range. 2. That release is compromised, malicious, or contains a security regression. 3. An operator follows the documentation and runs `npm install`. 4. npm resolves and installs the new, unaudited version. 5. Package lifecycle code may execute during installation, or changed dependency code executes when the service starts. 6. Malicious code could access files, environment variables, RPC credentials, and network resources available to the Node.js process. This is a supply-chain risk path, not evidence that any currently declared package is malicious. ### Impact Assessment The impact is bounded by the privileges of the account per ...[truncated 382 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Generate and commit a reviewed `package-lock.json`. 2. Use `npm ci` in production and CI so installations match the lockfile exactly. 3. Pin direct dependencies to reviewed versions where operationally practical. 4. Review lockfile changes and resolved integrity hashes as part of every dependency update. 5. Run dependency vulnerability and provenance checks in CI. 6. Disable unnecessary npm lifecycle scripts in sensitive build environments, or explicitly allow only reviewed scripts. 7. Remove unused dependencies to reduce supply-chain exposure. 8. Build and test dependencies in an isolated environment without production wallet credentials. 9. Apply updates through a controlled process rather than resolving new versions during deployment. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (28)

Missing User Warnings

High
Confidence
97% confidence
Finding
The README promotes automated hourly buybacks and a manual buyback script but does not clearly warn that these actions trigger real on-chain swaps using live funds. In a financial automation skill, omitting explicit transaction-risk warnings can lead users to execute irreversible token trades, incur slippage/MEV/gas losses, or unintentionally operate market-manipulating behavior.

Credential Access

High
Category
Privilege Escalation
Content
npm install

# Configure
cp .env.example .env
# Add your RPC endpoints and API keys

# Analyze a wallet
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
set -e

# Load environment
source .env 2>/dev/null || true

BANKR_TOKEN="${BANKR_TOKEN:-0x50D2280441372486BeecdD328c1854743EBaCb07}"
USDC_ADDRESS="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"  # Ethereum mainnet
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Context-Inappropriate Capability

High
Confidence
94% confidence
Finding
The application performs an hourly automated shell execution of a buyback script unrelated to the exposed portfolio-analysis API, introducing a high-risk privileged action in the server process. Any compromise of the script, path, deployment environment, or surrounding operational controls could turn this into arbitrary command execution or unauthorized financial activity.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The README instructs users to scan wallets and configure RPC/API credentials but provides no warning about the sensitivity of wallet-linked financial data or how that data is handled, stored, or transmitted. In a crypto portfolio context, wallet addresses, cross-chain holdings, and API-backed enrichment can reveal significant private financial information and create avoidable privacy and operational risk.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill instructs users to configure `PAYMENT_WALLET_KEY` for payment receipt and buyback execution but does not warn that this is a highly sensitive private key that can directly authorize transfers. In a crypto-payment skill, omission of key-handling guidance materially increases the chance of credential leakage, unsafe storage in `.env`, accidental commits, or operational compromise leading to theft of funds.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill routes wallet and portfolio-related data through third-party services such as Twilio and external APIs, but it does not disclose the privacy implications of transmitting addresses, spoken wallet identifiers, and potentially sensitive financial exposure data. In this context, users may unknowingly expose portfolio intelligence to service providers, logs, transcripts, or webhook handlers, which can create surveillance, profiling, or targeting risks.

External Transmission

Medium
Category
Data Exfiltration
Content
### 1. User Requests Analysis

```bash
curl -X POST https://your-domain.com/api/analyze \
  -H "Content-Type: application/json" \
  -d '{
    "wallet": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

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.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The package description explicitly advertises 'automated $BANKR buyback' while providing script entry points for buyback execution. In a crypto/DeFi skill, ambiguous automation language around market actions is security-relevant because it signals potentially autonomous financial transactions that could execute without sufficient user confirmation, policy controls, or auditability.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The script forwards the wallet address and derived portfolio data to multiple helper Node scripts without any notice about where that data may be sent, logged, or stored. In a wallet-analysis context, this can expose sensitive financial profiling data and on-chain activity correlations to external services or local telemetry, creating a privacy and confidentiality risk even if no funds are directly at risk.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The portfolio analysis flow sends the supplied wallet address to blockchain RPC providers and is designed to query third-party balance APIs, which transmits user-associated financial data off-box. The code does not include any user-facing warning, prompt, or disclosure about this external data sharing.

External Transmission

Medium
Category
Data Exfiltration
Content
async function getEthPrice() {
  try {
    const response = await axios.get('https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd');
    return response.data.ethereum.usd;
  } catch (error) {
    console.error('Error fetching ETH price:', error);
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The API accepts a payment_tx field but never validates it, while messaging claims users can pay for access. This creates a broken access-control and billing flow: users who pay may be denied service, and the service's stated payment model is misleading, which can cause unauthorized logic paths and financial disputes.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The service triggers buyback actions automatically without any visible user disclosure, consent, or operator confirmation in this code path. In a financial context, undisclosed automated fund-moving behavior materially increases risk because users and operators may not understand that the service initiates periodic market actions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"analyze": "./scripts/analyze-wallet.sh"
  },
  "dependencies": {
    "express": "^4.18.2",
    "ethers": "^6.10.0",
    "axios": "^1.6.5",
    "dotenv": "^16.4.1",
Confidence
93% confidence
Finding
Using a caret range for express allows installation of newer compatible releases that may differ from what was tested, reducing build reproducibility and making dependency risk harder to assess. In a service that may expose HTTP endpoints for crypto operations, this increases supply-chain uncertainty even if it does not prove direct compromise by itself.

Unverifiable Dependency: express has 5 known advisory(ies) (CVE-2024-10491 (Express ressource injection); CVE-2014-6393 (No Charset in Content-Type Header in express); CVE-2024-9266 (Express Open Redirect vulnerability) +2 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding
The manifest references express with a non-exact version while known advisories exist, making it impossible to verify from this file whether a vulnerable release could be installed. In an HTTP-facing crypto service, unresolved uncertainty around framework security is more concerning because web-layer flaws can become entry points to higher-value transaction and secret-handling logic.

Unpinned Dependencies

Low
Category
Supply Chain
Content
},
  "dependencies": {
    "express": "^4.18.2",
    "ethers": "^6.10.0",
    "axios": "^1.6.5",
    "dotenv": "^16.4.1",
    "node-cron": "^3.0.3",
Confidence
95% confidence
Finding
Using an unpinned ethers version is riskier than a generic library because ethers directly interfaces with wallets, keys, and blockchain transactions. A semver-range update could change signing, provider, or transaction-handling behavior in a financial automation context, potentially affecting asset movement or transaction safety.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"dependencies": {
    "express": "^4.18.2",
    "ethers": "^6.10.0",
    "axios": "^1.6.5",
    "dotenv": "^16.4.1",
    "node-cron": "^3.0.3",
    "twilio": "^4.21.0",
Confidence
95% confidence
Finding
Axios is unpinned despite being a high-risk dependency class for outbound network requests, and the project likely uses it to fetch market or wallet-related data. In a crypto automation skill, unexpected dependency changes in request handling, proxy behavior, or parsing could expose the service to SSRF-like conditions, response tampering assumptions, or data integrity issues.

Unverifiable Dependency: axios has 16 known advisory(ies) (CVE-2026-44494 (axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in `co); CVE-2026-44495 (axios Vulnerable to Credential Theft and Response Hijacking via Prototype Pollut); CVE-2025-62718 (Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
92% confidence
Finding
Axios has multiple known advisories and the non-pinned version prevents verifying whether the installed package is affected. Because this project likely performs external HTTP requests for market, wallet, or service integrations, unverifiable request-library exposure is materially risky and could affect data integrity or outbound request safety.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"express": "^4.18.2",
    "ethers": "^6.10.0",
    "axios": "^1.6.5",
    "dotenv": "^16.4.1",
    "node-cron": "^3.0.3",
    "twilio": "^4.21.0",
    "@uniswap/v3-sdk": "^3.11.2",
Confidence
84% confidence
Finding
An unpinned dotenv dependency creates avoidable supply-chain and reproducibility risk, even though dotenv itself is usually lower risk than transaction or network libraries. Configuration loading is security-sensitive because mistakes can affect secrets, environment overrides, or runtime behavior across deployment environments.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"ethers": "^6.10.0",
    "axios": "^1.6.5",
    "dotenv": "^16.4.1",
    "node-cron": "^3.0.3",
    "twilio": "^4.21.0",
    "@uniswap/v3-sdk": "^3.11.2",
    "@uniswap/sdk-core": "^5.0.0"
Confidence
89% confidence
Finding
Node-cron is unpinned in a project that appears to automate financial actions, making scheduling behavior part of the attack surface. If dependency changes alter cron parsing or execution timing, scheduled buybacks or analyses could trigger unexpectedly or at unsafe intervals.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"axios": "^1.6.5",
    "dotenv": "^16.4.1",
    "node-cron": "^3.0.3",
    "twilio": "^4.21.0",
    "@uniswap/v3-sdk": "^3.11.2",
    "@uniswap/sdk-core": "^5.0.0"
  },
Confidence
90% confidence
Finding
Twilio is unpinned, which creates uncertainty around messaging or alerting behavior in a system likely to send transaction, analysis, or operational notifications. In financial tooling, alerting integrity matters because users may rely on messages for approvals, incident response, or transaction awareness.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"dotenv": "^16.4.1",
    "node-cron": "^3.0.3",
    "twilio": "^4.21.0",
    "@uniswap/v3-sdk": "^3.11.2",
    "@uniswap/sdk-core": "^5.0.0"
  },
  "devDependencies": {
Confidence
95% confidence
Finding
An unpinned @uniswap/v3-sdk dependency is significant because it directly influences trade pathing, pricing, slippage calculations, and transaction construction in DeFi workflows. Dependency drift in an SDK tied to on-chain trading can materially affect financial outcomes or execution safety.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"node-cron": "^3.0.3",
    "twilio": "^4.21.0",
    "@uniswap/v3-sdk": "^3.11.2",
    "@uniswap/sdk-core": "^5.0.0"
  },
  "devDependencies": {
    "nodemon": "^3.0.3"
Confidence
94% confidence
Finding
@uniswap/sdk-core underpins token math and core trading abstractions, so leaving it unpinned introduces supply-chain uncertainty in a portfolio and buyback tool. Small dependency changes here can cascade into incorrect amounts, price interpretation, or transaction preparation.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
server.js:253

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
server.js:11