Back to skill

Security audit

jrj-fin-search-skill金融界资讯研报搜索

Security checks for vulnerabilities and agentic risk

Overview

The skill generally matches its financial-news search purpose, but it has an undocumented endpoint override that can send the API key and search terms to an arbitrary or unencrypted server.

Review this skill before installing. Use it only with a trusted runtime environment, keep JRJ_API_URL unset unless you fully control the endpoint, require HTTPS, and store JRJ_API_KEY as a secret. Rotate the key if it was ever used while JRJ_API_URL pointed at an untrusted or plaintext endpoint.

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
scripts/news.js:20
Finding

API key disclosure through an unrestricted and potentially plaintext endpoint override

Content
View full analysis
{ const protocol = url.protocol === 'https:' ? https : http; const req = protocol.request(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY, }, }, (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { try { const json = JSON.parse(data); if (json.code !== 0) { reject(new Error(`API错误 [${json.code}]: ${json.msg}`)); } else { resolve(json.data); } } catch (e) { reject(new Error(`响应解析失败: ${e.message}`)); } }); }); req.on('error', reject); req.write(bodyStr); req.end(); }); } ``` ### Technical Analysis The script obtains the sensitive `JRJ_API_KEY` credential from the environment and sends it in the `X-API-Key` header. Sending this key to the official service is necessary for the declared financial-news search functionality. However, the destination is controlled by the undocumented `JRJ_API_URL` environment variable. The implementation does not verify the destination hostname, port, or transport security before attaching the credential. It also explicitly selects Node.js's plaintext `http` module whenever the configured URL does not use HTTPS. Consequently, a process-environment value can redirect both the API k ...[truncated 2368 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

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.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation includes a live-style API key example (sk_live_xxx) and explains that every request must carry it, but it does not warn that keys are secrets that must not be embedded in client-side code, logs, or shared examples. In a skill intended for agent/tool use, this omission can normalize unsafe key handling and increase the chance of credential exposure or misuse if implementers copy the pattern directly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code sends user-provided keywords and other query parameters to a remote API, and includes the JRJ_API_KEY credential in the request headers. Although the script functionality implies remote querying, there is no explicit user-facing warning or disclosure at the network call site that input data and credentials are being transmitted off-host.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.