Back to skill

Security audit

DataHub for Multi-Domain Data

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly coherent as a DataHub client, but it handles API keys and external requests too loosely for automatic installation without review.

Review this skill before installing. Use an environment variable for the API key, avoid project config files that may be committed, keep DATAHUB_BASE_URL set to https://datahub.codes unless you intentionally trust another HTTPS endpoint, and do not send confidential or personal data unless you are comfortable sharing it with DataHub. Confirm bounty and API-supply actions before running them because they may create account-visible external requests.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/query.js:67
Finding
API Credentials and User Data Can Be Sent to Arbitrary Plaintext HTTP Endpoints## Vulnerability Details **File Location**: `scripts/query.js:18-21, 67-89`; `scripts/poll.js:17-20, 92-110` **Vulnerability Type**: Unrestricted destination and insecure transport for sensitive data **Risk Level**: High ### Vulnerable Code `scripts/query.js`: ```js const config = { apiKey: process.env.DATAHUB_API_KEY || null, baseUrl: process.env.DATAHUB_BASE_URL || 'https://datahub.codes', timeout: parseInt(process.env.DATAHUB_TIMEOUT) || 60000 }; ``` ```js async function submitQuery(query, sessionId = null) { const url = new URL('/api/datahub/execute/v0', BASE_URL); const payload = JSON.stringify({ query: query, sessionId: sessionId || undefined, key: API_KEY // 添加API Key到请求体 }); const options = { hostname: url.hostname, port: url.port || (url.protocol === 'https:' ? 443 : 80), path: url.pathname, method: 'POST', headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(payload), 'X-API-Key': API_KEY // 同时通过Header传递 }, timeout: TIMEOUT }; return new Promise((resolve, reject) => { const client = url.protocol === 'https:' ? https : http; ``` `scripts/poll.js`: ```js const config = { apiKey: process.env.DATAHUB_API_KEY || null, baseUrl: process.env.DATAHUB_BASE_URL || 'https://datahub.codes', timeout: parseInt(process.env.DATAHUB_TIMEOUT) || 60000 }; ``` ```js async function fetchResult(processId) { const url = new URL(`/api/processes/${processId}.md`, BASE_URL); // 将API Key添加到查询参数 url.searchParams.append('key', API_KEY); const options = { hostname: url.hostname, port: url.port || (url.protocol === 'https:' ? 443 : 80), path: url.pathname + url.search, method: 'GET', headers: { 'Accept': 'application/json, text/markdown, text/plain, */*', 'X-API-Key': API_KEY // 同时通过Header传递 ...[truncated 2397 chars]
Remediation
## Remediation Suggestions 1. Enforce HTTPS before constructing any request: ```js const url = new URL('/api/datahub/execute/v0', BASE_URL); if (url.protocol !== 'https:') { throw new Error('DATAHUB_BASE_URL must use HTTPS'); } ``` 2. Remove the fallback to Node.js's `http` client and use `https.request` exclusively. 3. If only the official service is supported, require `url.hostname === 'datahub.codes'`. 4. If custom deployments are necessary, implement an explicit trusted-host allowlist and require HTTPS for every entry. 5. Reject URLs containing embedded credentials and consider rejecting unexpected ports. 6. Protect configuration files with restrictive filesystem permissions and document which configuration source takes precedence. 7. Send the API key through only one authentication channel, preferably the request header. 8. Add automated tests proving that plaintext HTTP and unapproved hostnames are rejected.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/poll.js:92
Finding
API Key Is Exposed in Polling Request URLs## Vulnerability Details **File Location**: `scripts/poll.js:92-106` **Vulnerability Type**: Sensitive credential in URL query parameters **Risk Level**: Medium ### Vulnerable Code ```js async function fetchResult(processId) { const url = new URL(`/api/processes/${processId}.md`, BASE_URL); // 将API Key添加到查询参数 url.searchParams.append('key', API_KEY); const options = { hostname: url.hostname, port: url.port || (url.protocol === 'https:' ? 443 : 80), path: url.pathname + url.search, method: 'GET', headers: { 'Accept': 'application/json, text/markdown, text/plain, */*', 'X-API-Key': API_KEY // 同时通过Header传递 } }; ``` ### Technical Analysis The polling script places the API key in the URL query string while also sending the same credential in the `X-API-Key` header. The query-string copy is redundant. HTTPS protects the URL while it is in transit, but it does not prevent the complete request target from being recorded by the destination server, reverse proxies, API gateways, observability systems, or diagnostic tooling. Query parameters are commonly retained in access logs and traces, giving the credential a larger exposure surface and potentially a much longer lifetime than the request itself. Header-based authentication is already implemented, so placing the key in the URL is not necessary for minimum-privilege operation. ### Attack Path 1. A user invokes `scripts/poll.js` with a valid DataHub API key. 2. The script creates a URL containing `?key=API_KEY`. 3. A server, reverse proxy, gateway, monitoring agent, or tracing platform records the complete request target. 4. A person or compromised service with access to those records extracts the API key. 5. The exposed credential is reused against DataHub until it expires or is revoked. This path does not require breaking TLS because the exposure can occur at systems that legitimately terminate ...[truncated 523 chars]
Remediation
## Remediation Suggestions 1. Remove the API key from the query string: ```js async function fetchResult(processId) { const url = new URL(`/api/processes/${encodeURIComponent(processId)}.md`, BASE_URL); const options = { hostname: url.hostname, port: url.port || 443, path: url.pathname, method: 'GET', headers: { 'Accept': 'application/json, text/markdown, text/plain, */*', 'X-API-Key': API_KEY } }; } ``` 2. Use only `X-API-Key` or another supported authorization header. 3. Configure servers, proxies, and monitoring systems to redact authentication headers and any legacy `key` query parameter. 4. Rotate API keys that may already have appeared in logs. 5. Establish short credential lifetimes and least-privilege API scopes where the service supports them. 6. Add a regression test asserting that serialized request URLs never contain the API key.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documented behavior is far broader than the actual implemented scope, which appears limited to submitting a query to one endpoint. This mismatch is dangerous because users and orchestrators may trust the skill to perform validation, filtering, polling, or bounty/API-supply workflows safely when those controls do not actually exist, leading to unsafe data handling and misleading automation decisions.

Vague Triggers

High
Confidence
96% confidence
Finding
Very broad triggers like 'fetch.*' and 'get.*information' can activate the skill for many ordinary requests unrelated to this service. In an agent environment, that can cause unintended routing of user prompts and unnecessary transmission of sensitive or irrelevant data to an external provider.

Lp3

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding
The skill advertises shell-based workflows, environment-variable usage, and configuration-file handling, but it declares no explicit tool scope or permissions. That creates an authorization gap where an agent may invoke code or access credentials without clear user-visible constraints, increasing the chance of unintended secret access or command execution.

Vague Triggers

Medium
Confidence
87% confidence
Finding
Triggers for adding API supply and creating data bounties are ambiguous and can match conversational language without clearly signaling an external side effect. That raises the risk of accidental registration requests, bounty creation, or disclosure of internal API documentation links or business needs to a third party.

Session Persistence

Medium
Category
Rogue Agent
Content
- User cannot find desired data and wants to offer a bounty — instead of hitting a dead end with no alternatives

## When NOT to Use
- Local file read/write operations
- Pure computation tasks (no external data needed)
- Scenarios requiring sub-second real-time responses
- General knowledge questions not related to the supported data domains
Confidence
71% confidence
Finding
The skill promotes use of a sessionId to retain context across turns, but it does not describe retention limits, privacy boundaries, or what data is persisted server-side. In a data-aggregation skill handling potentially sensitive queries, undocumented session persistence increases the risk of over-retention and unintended correlation of user activity.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The documentation recommends storing API keys in user and project config files without warning about plaintext secret exposure, source-control leaks, shared-home-directory access, or file permission issues. This increases the likelihood of credential theft or accidental disclosure.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill encourages users to submit natural-language queries to an external service but does not clearly warn that user-provided content may be transmitted off-platform. This can lead to inadvertent disclosure of sensitive business data, personal information, or proprietary research queries.

External Transmission

Medium
Category
Data Exfiltration
Content
#### Examples:
```bash
# E-commerce API
node scripts/query.js "Add API supply: Amazon product search and reviews API. Documentation: https://api.example.com/docs"

# Social Media API
node scripts/query.js "Add API supply: LinkedIn company page data API. Docs: https://linkedin-api.example.com"
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The document is entirely written in Chinese and specifies request content such as `query` as Chinese natural-language input, but it does not indicate that the skill is region-specific or that users may choose another language. This can violate language/locale policy when a skill imposes a specific language without user opt-in or justification.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The manifest frames this skill as a natural-language data hub for querying supported external domains, adding API supplies, and creating data bounties. In this script, the skill reads credentials and runtime configuration from local filesystem paths and environment variables, which is a separate local-access capability not described in the stated purpose.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The API key is appended to the request URL as a query parameter while also being sent in a header. Query-string credentials are commonly exposed in logs, proxies, browser/history equivalents, monitoring systems, and upstream infrastructure, increasing the chance of credential disclosure even over HTTPS. In this skill context, the script is explicitly used to access external data services, so leaked credentials could expose broad access to user data queries or account resources.

Static analysis

No suspicious patterns detected.