T09 · Insecure Skill Coding Practices
- Location
SKILL.md:38- Finding
Hard-Coded Shared API Bearer Token
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 38–45 and repeated at line 105
Vulnerability Type: Hard-coded reusable credential
Risk Level: MediumVulnerable Code
bash SCHOLAR_KEY="${SCHOLAR_API_KEY:-psk_tLzPCmJdUw5oAHGeXL2H_fMrDdSyiF_SBJfn2p5uCO4}" BASE="https://scholar.x49.ai/api/v1"The same fallback credential is used again in the polling example:
bash SCHOLAR_KEY="${SCHOLAR_API_KEY:-psk_tLzPCmJdUw5oAHGeXL2H_fMrDdSyiF_SBJfn2p5uCO4}"Technical Analysis
SKILL.mdembeds a reusable Scholar API Bearer token and automatically uses it wheneverSCHOLAR_API_KEYis unset. Because Skill files are distributed as readable text, every recipient can extract this token and use it outside the intended Skill workflow.Bearer tokens grant access based solely on possession. Embedding one in a distributed file prevents effective confidentiality, individual attribution, and secure lifecycle management. Although transmitting a credential to the declared HTTPS API is necessary for authenticated operation, distributing the credential itself is not necessary for the Skill’s report-generation functionality and exceeds secure minimum-privilege design.
The audit did not confirm the pre-scan’s suspected
curl | bashbehavior. The documentedcurlcommands make ordinary HTTPS API requests and do not pipe downloaded content into a shell or execute a remote script.Attack Path
- An attacker obtains or views the publicly distributed
SKILL.md. - The attacker copies the embedded token from the
SCHOLAR_KEYfallback expression. - The attacker supplies it as
Authorization: Bearer ...in direct requests tohttps://scholar.x49.ai/api/v1. - The attacker submits arbitrary report jobs or invokes any other endpoint authorized for that token.
- Those requests consume shared quota and are attributed to the shared credential rather than an individual authorized user.
- Continued misuse may exhaust service limits, disrupt legi ...[truncated 849 chars]
- An attacker obtains or views the publicly distributed
- Remediation
View remediation
Remediation Suggestions
- Immediately revoke and rotate the exposed Bearer token.
- Remove the built-in fallback credential from every example and instruction.
- Require users to provide their own credential through
SCHOLAR_API_KEY:
bash : "${SCHOLAR_API_KEY:?Set SCHOLAR_API_KEY before using Scholar Report}" SCHOLAR_KEY="$SCHOLAR_API_KEY" BASE="https://scholar.x49.ai/api/v1"- Store credentials in an approved secret manager or protected environment configuration rather than source-controlled or distributed documentation.
- Ensure logs, command traces, error output, and generated files do not expose Authorization headers.
- Grant each credential only the API scopes and quotas required to create, poll, and download reports.
- Prefer per-user credentials to preserve attribution and allow targeted revocation.
- If free access is required, implement a server-side unauthenticated or short-lived-token flow with strict rate limits instead of publishing a reusable secret.
- Add automated secret scanning to the publication pipeline to prevent future credential exposure.
- Warn users that research queries are transmitted to a third-party service and should not contain confidential, regulated, or unpublished information unless that transfer is authorized.
