T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Broker API Key Exposure Through Chat and an Unconstrained Broker Origin
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:20,SKILL.md:58, andSKILL.md:168-183
Vulnerability Type: Credential exposure and insufficient destination validation
Risk Level: MediumVulnerable Code and Instructions
SKILL.md:20directs the user to disclose a sent-once API key through the agent conversation:text 2. Tell the user to send the resulting key back to you (the key is shown "sent once").SKILL.md:58permits the broker base URL and API key to be provided as runtime inputs:text - Ask for the minimum missing inputs (broker base URL + user API key) and then propose the exact upstream URL(s) you will request.SKILL.md:168-183sends the API key as a bearer credential to the supplied base URL:ts async function createBrokerRequest(params: { baseUrl: string; apiKey: string; upstreamUrl: string; method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; headers?: Record<string, string>; body?: unknown; consentHint?: string; idempotencyKey?: string; }): Promise<CreateRequestResponse> { const res = await fetch(`${params.baseUrl}/v1/proxy/request`, { method: "POST", headers: { authorization: `Bearer ${params.apiKey}`, "content-type": "application/json", },This behavior conflicts with the secret-handling guidance in
references/api_reference.md:149-152:text ## Safety / Secret Handling - Never paste API keys into chat logs or commit them. - Do not log full upstream responses if they may contain sensitive data.Technical Analysis
The Skill combines two unsafe design choices:
- It instructs the user to place a sensitive, sent-once bearer credential into the conversation. Conversation history, agent traces, telemetry, and error diagnostics may retain this value. This contradicts the project's own prohibition against pasting API keys into chat logs.
- It models
baseUrlas an unconstrained runtime parameter while attaching the bearer credential to req ...[truncated 2779 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove conversational secret collection
- Do not instruct users to paste API keys into chat.
- Require the key to be provisioned through a protected secret manager or environment-variable mechanism such as
PB_API_KEY. - If the runtime cannot accept secrets securely, stop and provide setup instructions rather than requesting the key in conversational text.
-
Pin and validate the broker origin
- Default to the documented origin
https://permissions-broker.steer.fun. - Before attaching authorization, parse the URL and require:
- The
https:scheme. - An exact hostname match.
- No embedded username or password.
- The expected port, or no explicit port.
- The
- Do not use suffix or substring hostname checks.
- If private broker deployments must be supported, require explicit out-of-band trusted configuration rather than a URL supplied during an ordinary task.
- Default to the documented origin
-
Separate credentials from general request parameters
- Build authenticated broker requests only through a dedicated client initialized with a validated origin and a secret-store reference.
- Prevent upstream URLs, user content, or model-generated data from influencing the destination receiving the broker authorization header.
- Disable automatic cross-origin redirects for authenticated calls, or strip authorization on every redirect and reject unexpected destinations.
-
Reconcile the documentation
- Replace
SKILL.md:20with secure secret-store provisioning instructions. - Replace the request for a “broker base URL + user API key” with a check for the pinned broker configuration and a protected
PB_API_KEYreference. - Preserve the rule in
references/api_reference.mdthat API keys must never be pasted into chat logs.
- Replace
-
Reduce the consequences of disclosure
- Use short-lived, narrowly scoped credentials if the broker supports them.
- Provide clear revocation and rotation instructions.
- A ...[truncated 207 chars]
-
