Back to skill

Security audit

Asset Management

Security checks for vulnerabilities and agentic risk

Overview

This crypto portfolio skill is mostly purpose-aligned, but it handles sensitive financial data with unsafe local/cloud APIs, persistent browser-stored credentials, and under-disclosed third-party AI processing.

Review this skill carefully before installing. Use only data you are comfortable storing in local files, browser storage, and optionally Cloudflare KV; avoid configuring real AI keys or cloud sync until the local API is authenticated and loopback-only, XSS-safe rendering is fixed, Worker secrets replace hardcoded tokens, and the UI clearly warns before sending financial documents or portfolio context to third parties. Rotate any Cloudflare token or AI key already used with this version.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/serve.mjs:65
Finding

Unauthenticated Local Portfolio API Exposes Sensitive Financial Data

Content
View full analysis
{ const url = new URL(req.url, `http://localhost:${PORT}`); // CORS res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type'); if (req.method === 'OPTIONS') { res.writeHead(204); res.end(); return; } // API: 获取数据 if (url.pathname === '/api/data' && req.method === 'GET') { res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ ok: true, data: loadData() })); return; } // API: 保存数据 if (url.pathname === '/api/data' && req.method === 'POST') { let body = ''; req.on('data', chunk => body += chunk); req.on('end', () => { try { const data = JSON.parse(body); saveData(data); res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ ok: true })); } catch (e) { res.writeHead(400, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ ok: false, error: e.message })); } }); return; } ``` ```javascript server.listen(PORT, () => { console.log(`\n🚀 CryptoFolio 可视化界面已启动`); console.log(`📊 打开浏览器访问: http://localhost:${PORT}`); console.log(`📁 数据文件: ${DATA_FILE}`); console.log(`\n按 Ctrl+C 停止服务器\n`); }); ``` ### Technical Analysis The local HTTP API permits both reading and replacing the complete portfolio without authentication. It also returns `Access-Control-Allow-Origin: *`, authorizes cross-origin `GET`, `POST`, and `OPTIONS` requests, and accepts JSON writes after an unrestricted preflight request. Calling `server.listen(PORT)` without a hostname does not explicit ...[truncated 2127 chars]
Remediation
View remediation
{ // ... }); ``` 2. Remove wildcard CORS. If cross-origin access is not necessary, do not return CORS headers. Otherwise, validate `Origin` against a strict allowlist. 3. Generate an unpredictable session token when the server starts and require it on every API request. 4. Validate `Host`, `Origin`, and `Sec-Fetch-Site` headers as defense in depth against DNS rebinding and cross-site requests. 5. Validate incoming data against a strict schema. Reject unknown properties, invalid identifiers, unsafe colors, unexpected types, and excessively long strings. 6. Enforce a conservative request-body size limit and terminate oversized requests before parsing. 7. Add safe-write behavior, including temporary-file replacement and backups, to reduce corruption risk. 8. Return appropriate security headers, including a restrictive Content Security Policy, `X-Content-Type-Options: nosniff`, and `Cache-Control: no-store` for API responses. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
index.html:574
Finding

Stored Cross-Site Scripting Through Unvalidated Portfolio Records

Content
View full analysis
/g,'>'); } ``` Generated content is assigned directly to `innerHTML`: ```javascript function renderTab(tab){ const m = document.getElementById('main'); if(tab==='overview') m.innerHTML = renderOverview(); if(tab==='positions') m.innerHTML = renderPositions(); if(tab==='trades') m.innerHTML = renderTrades(); if(tab==='finance') m.innerHTML = renderFinance(); if(tab==='transfers') m.innerHTML = renderTransfers(); if(tab==='accounts') m.innerHTML = renderAccounts(); } ``` Persisted IDs and colors are embedded directly into inline JavaScript and CSS contexts: ```javascript function renderAccounts(){ const cards = state.accounts.map(a=>{ const positions = state.positions.filter(p=>p.accountId===a.id); const trades = state.trades.filter(t=>t.accountId===a.id); const totalVal = positions.reduce((s,p)=>{ const v = p.currentValue!=null&&p.currentValue!==''?+p.currentValue:(+p.amount||0)*(+p.currentPrice||0); return s+v; },0); return `
${esc(a.name)}
${tag(TYPE_LABEL[a.type],a.color)}
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
index.html:387
Finding

Long-Lived Cloud and AI Credentials Stored in Script-Readable localStorage

Content
View full analysis
API Key
显示
``` ### Technical Analysis `localStorage` is not a protected credential store. Every script executing under the same origin can read it, and values remain available across browser restarts until explicitly cleared. The use of `type="password"` only masks the visual presentation of a value; it does not encrypt the stored credential or prevent JavaScript access. The dashboard stores both: - The Cloudflare Worker URL and bearer token used to read and replace th ...[truncated 1547 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
cloudflare-worker/worker.js:4
Finding

Cloudflare Worker Uses a Hardcoded Shared Secret and Permissive Cross-Origin Policy

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (43)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · index.html (reported line 491)May include surrounding context.

html
placeholder="https://cryptofolio-api.你的用户名.workers.dev"
        style="font-family:var(--mono);font-size:12px"/>
    </div>
    <div class="field"><label>Access Token</label>
      <input id="cf-token" type="password" value="${esc(cfg.token||'')}"
        placeholder="你在 Cloudflare 设置的密码"
        style="font-family:var(--mono);font-size:12px"/>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · index.html (reported line 1705)May include surrounding context.

html
<div style="display:flex;gap:6px;margin-bottom:16px">${catBtns}</div>
    <input type="hidden" id="f-fincat" value="${cat}"/>

    <!-- 币本位理财 -->
    <div id="fin-fields-COIN_STAKE" style="display:${cat==='COIN_STAKE'?'block':'none'}">
      <div class="grid2">
        <div class="field"><label>账户</label><select id="fcs-acc">${accOpts(f?.accountId||'')}</select></div>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · index.html (reported line 2286)May include surrounding context.

html
</div>
    </div>

    <!-- 出金 -->
    <div id="txn-withdraw" style="display:${d.type==='WITHDRAW'?'block':'none'}">
      <div class="grid2">
        <div class="field"><label>来源账户</label>

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Uploaded screenshots/PDFs and account context are sent to external AI providers, potentially exposing balances, trades, account names, and embedded personal data. Because the feature handles financial documents, this transmission can leak highly sensitive information to multiple third parties and create compliance/privacy issues.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The UI claims API keys are kept only locally and never uploaded to any server, but the application necessarily transmits the key in Authorization/x-api-key headers to provider servers when making API calls. This is a materially false security statement that can cause users to make trust decisions based on incorrect information.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The upload-and-send flow transmits screenshots/PDFs to external AI services without a strong, immediate warning at the point of transmission. Users may unknowingly send full trading screenshots or documents containing balances, names, IDs, or other sensitive data to third-party processors.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

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 · cloudflare-worker/README.md (reported line 21)May include surrounding context.

bash
cd cloudflare-worker
wrangler kv:namespace create "KV"

记下输出的 id,例如:{ binding = "KV", id = "xxxx-xxxx-xxxx" }

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 · cloudflare-worker/README.md (reported line 21)May include surrounding context.

bash
cd cloudflare-worker
wrangler kv:namespace create "KV"

记下输出的 id,例如:{ binding = "KV", id = "xxxx-xxxx-xxxx" }

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README instructs users to hardcode a secret token in worker.js and store the same token in local configuration, which encourages unsafe secret handling and increases the chance of accidental disclosure through source control, screenshots, backups, or shared config files. In this skill context, the token protects access to portfolio and transaction data, so exposure could allow unauthorized reads or modification of sensitive financial records.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code performs a persistent write operation by storing request JSON into Cloudflare KV, but there is no confirmation prompt, user-facing log/print, or explanatory comment warning users that submitted data will be saved. Under the code-file criteria, file writes or other persistent data modifications should include some visible disclosure unless clearly documented as expected behaviour.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document sets lang="zh" and the interface text throughout the file is Chinese-only, with no apparent language selector or opt-in. Under the stated policy, forcing a specific language without user choice is a natural-language locale policy violation unless the restriction is clearly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill metadata presents the app as a local conversational asset recorder/exporter, but the code adds remote persistence via Cloudflare sync and localhost API storage. This materially changes the trust boundary for highly sensitive financial portfolio data and can mislead users into disclosing data they believed would remain local.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The app automatically pushes sensitive portfolio data to configured cloud endpoints during save operations without a strong user-facing warning at the moment of upload. Silent or background transmission of financial data increases the risk of accidental disclosure and undermines informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The application sends portfolio data to a localhost API endpoint without clearly informing the user in the visible interface. Even though localhost is local, it crosses the browser boundary into another service and may expose data to unexpected software listening on that port.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes portfolio recording/export, but the code also performs third-party AI processing and file analysis for screenshots/PDFs. This expands data collection and external transmission beyond the declared scope, increasing privacy and supply-chain risk for sensitive financial records.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

This endpoint definition is part of the app's direct integration with Anthropic, enabling outbound transmission of user prompts, account context, and optionally uploaded files. In this skill's context, portfolio and document data are sensitive, so external transmission materially affects privacy and trust assumptions.

Content

Scanner excerpt · index.html (reported line 2820)May include surrounding context.

html
claude: {
    name: 'Claude (Anthropic)',
    placeholder: 'sk-ant-api03-...',
    url: 'https://api.anthropic.com/v1/messages',
    docs: 'console.anthropic.com',
    badge: '🤖',
    supportsImage: true,

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The OpenAI endpoint represents another third-party transmission target for sensitive user data. Even if browser CORS often blocks direct use, the code is designed to send account context and possibly uploaded content there when configured.

Content

Scanner excerpt · index.html (reported line 2829)May include surrounding context.

html
openai: {
    name: 'OpenAI / ChatGPT',
    placeholder: 'sk-...',
    url: 'https://api.openai.com/v1/chat/completions',
    docs: 'platform.openai.com/api-keys',
    badge: '🟢',
    supportsImage: true,

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The MiniMax endpoint adds another external processor for sensitive financial text. Multiple provider options broaden the external attack and privacy surface, especially when users may not understand where their data is going.

Content

Scanner excerpt · index.html (reported line 2838)May include surrounding context.

html
minimax: {
    name: 'MiniMax',
    placeholder: 'sk-xxxxxxxxxxxxxxxx',
    url: 'https://api.minimax.io/v1/chat/completions',
    docs: 'platform.minimax.io',
    badge: '🇨🇳',
    supportsImage: false,

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The DeepSeek endpoint is an additional third-party data recipient for parsed portfolio content. In a crypto portfolio skill, sending holdings and trade history to external services is security-relevant because it exposes valuable financial intelligence.

Content

Scanner excerpt · index.html (reported line 2847)May include surrounding context.

html
deepseek: {
    name: 'DeepSeek',
    placeholder: 'sk-...',
    url: 'https://api.deepseek.com/v1/chat/completions',
    docs: 'platform.deepseek.com',
    badge: '🔵',
    supportsImage: false,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

API keys are stored in localStorage, which is persistent and accessible to any script running in the page origin. In a single-file app that also handles dynamic HTML and external integrations, this increases the blast radius of any future XSS or malicious script injection.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The stated purpose promises exporting data to CSV/Excel. In this file, the implemented data-transfer feature is a Notion CSV importer, and there is no corresponding CSV or Excel export logic present.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · index.html (reported line 3477)May include surrounding context.

html
if(cryptoAssets.length>0){
      const ids = [...new Set(cryptoAssets.map(a=>GECKO_IDS[a]))].join(',');
      try{
        const res = await fetch(`https://api.coingecko.com/api/v3/simple/price?ids=${ids}&vs_currencies=usd`);
        if(res.ok){
          const data = await res.json();
          cryptoAssets.forEach(a=>{

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

Using allorigins as a proxy for Yahoo Finance exposes requested stock symbols to an unrelated third-party proxy and adds a supply-chain dependency. In aggregate, requested symbols can reveal parts of a user's holdings and investment behavior.

Content

Scanner excerpt · index.html (reported line 3493)May include surrounding context.

html
for(const sym of stockAssets){
        try{
          const url = `https://query1.finance.yahoo.com/v8/finance/chart/${encodeURIComponent(sym)}?interval=1d&range=1d`;
          const proxy = `https://api.allorigins.win/get?url=${encodeURIComponent(url)}`;
          const res = await fetch(proxy);
          if(res.ok){
            const wrapper = await res.json();

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README promotes cloud synchronization of sensitive cryptocurrency portfolio data but does not clearly warn users that the data may reveal holdings, trading history, counterparties, and other financial information. In a crypto asset management context, this omission is security-relevant because users may enable remote storage without understanding the privacy and targeting risks if the endpoint, token, or hosting account is compromised.

Content

No source excerpt is available for this finding.