Back to skill

Security audit

scholar-search-x49

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it embeds and automatically uses a shared Scholar API bearer token, which users should review before installing.

Review this before installing if you are uncomfortable with a shared built-in API key. Prefer setting your own SCHOLAR_API_KEY, avoid sending confidential or unpublished research queries, and expect search terms and filters to be transmitted to scholar.x49.ai.

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

Warning
Location
SKILL.md:31
Finding
Hard-Coded Shared Scholar API Bearer Credential<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 31–42; repeated at line 59 **Vulnerability Type**: Hard-coded credential and insecure secret handling **Risk Level**: Medium ### Vulnerable Code ```markdown Authentication uses a Bearer token. Resolve the key in this order: 1. Environment variable `SCHOLAR_API_KEY` 2. Built-in free key: `psk_tLzPCmJdUw5oAHGeXL2H_fMrDdSyiF_SBJfn2p5uCO4` Users can get their own higher-quota key at: https://scholar.x49.ai/docs?section=api-keys **Always construct API calls like this:** ```bash SCHOLAR_KEY="${SCHOLAR_API_KEY:-psk_tLzPCmJdUw5oAHGeXL2H_fMrDdSyiF_SBJfn2p5uCO4}" BASE="https://scholar.x49.ai/api/v1" ``` ``` The same credential is repeated in the paper-search example: ```bash SCHOLAR_KEY="${SCHOLAR_API_KEY:-psk_tLzPCmJdUw5oAHGeXL2H_fMrDdSyiF_SBJfn2p5uCO4}" curl -s "https://scholar.x49.ai/api/v1/papers/search" \ -H "Authorization: Bearer ${SCHOLAR_KEY}" \ ``` ### Technical Analysis A reusable bearer credential is embedded directly in the publicly readable Skill definition. The shell parameter expansion automatically selects this credential whenever `SCHOLAR_API_KEY` is unset. Consequently, merely obtaining the Skill package reveals everything required to authenticate as the shared API identity. Bearer tokens provide access based on possession. There is no additional proof binding the token to a particular installation or user. Although the document identifies this as a built-in free key, publishing and automatically using a shared credential prevents reliable attribution, rotation per installation, and effective per-user revocation. ### Attack Path 1. An attacker obtains or reads `SKILL.md`. 2. The attacker copies the plaintext token from line 34, 41, or 59. 3. The attacker submits requests directly to `https://scholar.x49.ai/api/v1` with: ```http Authorization: Bearer psk_tLzPCmJdUw5oAHGeXL2H_fMrDdSyiF_SBJfn2p5uCO4 ``` 4. Requests are processed under the shared API identity wit ...[truncated 1068 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the embedded bearer token from `SKILL.md` and all command examples. 2. Revoke or rotate the exposed token, because removing it from a later revision does not invalidate copies already obtained. 3. Require an explicitly configured environment variable and fail safely when it is missing: ```bash : "${SCHOLAR_API_KEY:?SCHOLAR_API_KEY must be configured}" SCHOLAR_KEY="$SCHOLAR_API_KEY" BASE="https://scholar.x49.ai/api/v1" ``` 4. Store credentials in a protected environment variable, operating-system credential store, or secret-management service rather than source-controlled documentation. 5. Issue separate, least-privilege credentials per user or installation. Apply narrow endpoint permissions, rate limits, quota limits, expiration, and revocation support. 6. Keep examples credential-free by using placeholders such as `${SCHOLAR_API_KEY}`. 7. Add automated secret scanning to the publication workflow to detect bearer tokens and similar credentials before release. 8. Monitor the exposed credential's historical usage for quota abuse or anomalous requests. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Ssd 3

High
Confidence
99% confidence
Finding
The skill hardcodes a reusable bearer token and instructs clients to use it as a fallback credential. Any user who can read the skill can extract and reuse the token, enabling unauthorized access, quota abuse, attribution confusion, and possible service misuse under the publisher's account.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The manifest says the skill triggers when the user mentions broad phrases like academic papers, scholarly articles, citation counts, or open access. These are common discussion topics and the file does not provide exclusion conditions or narrower activation constraints, which could cause unintended invocation.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill sends user-provided research queries to a third-party API but does not clearly disclose that user input will leave the local system. This creates a privacy and consent risk, especially when users may include sensitive research topics, unpublished ideas, institutional information, or personally identifying details in queries.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
SCHOLAR_KEY="${SCHOLAR_API_KEY:-psk_tLzPCmJdUw5oAHGeXL2H_fMrDdSyiF_SBJfn2p5uCO4}"
curl -s "https://scholar.x49.ai/api/v1/papers/search" \
  -H "Authorization: Bearer ${SCHOLAR_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
90% confidence
Finding
This example performs an external API call that transmits the user's query and associated filters to a third-party service. In this skill's context, external transmission is expected functionality, but it is still security-relevant because it can disclose sensitive user interests or research content if invoked without clear notice and data-minimization controls.

External Transmission

Medium
Category
Data Exfiltration
Content
Expand one or more `paper_ref` values into full metadata.

```bash
curl -s "${BASE}/papers/batch" \
  -H "Authorization: Bearer ${KEY}" \
  -H "Content-Type: application/json" \
  -d '{"paper_refs":["pap_ebcabae1be4244f3adba","pap_4748c234f5384d0eaee2"]}'
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.