T09 · Insecure Skill Coding Practices
- Location
SKILL.md:272- Finding
Plaintext API Key Disclosure in Build Feedback
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 272
Vulnerability Type: Sensitive credential exposure through user-visible output
Risk Level: HighVulnerable Code:
bash feedback+="• API_KEY:$api_key\n"Technical Analysis
The skill accepts a user-provided Pgyer API key and passes it to the external packaging script. After a successful build, it appends the complete, unmasked key to the feedback message returned through
reply.Returning a credential is not required to confirm that an upload occurred. It unnecessarily expands the credential's exposure from the build process into chat history, agent logs, notification systems, monitoring infrastructure, shared transcripts, and any other system processing the response.
The API key is held in a shell variable and interpolated directly into the output without redaction. Although no hardcoded credential is present, this behavior discloses any credential supplied by the user.
Attack Path
- A user provides a Pgyer API key as part of a packaging request.
- The skill extracts the credential into the
api_keyvariable. - The credential is passed to
pgyer_all.shas interactive input. - If the build completes successfully and uploading was requested, the skill interpolates the complete key into
feedback. - The skill sends
feedbackthroughreply. - The exposed key may subsequently be recovered from conversation history, notifications, logs, telemetry, screenshots, or shared transcripts.
- An unauthorized party can use the recovered key for operations permitted by the associated Pgyer account.
Impact Assessment
Successful exploitation exposes the complete Pgyer API credential. An attacker may gain the privileges granted to that key, potentially including unauthorized artifact uploads, modification or replacement of distributed application builds, access to upload-related account resources, or consumption of service qu ...[truncated 442 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the API key from all feedback and diagnostic messages. Report only that a user-provided credential was used.
- If credential identification is operationally necessary, display only a minimally useful masked suffix, such as
****abcd, and never reveal the complete value. - Avoid accepting secrets through natural-language chat or command-line arguments, because both may be retained in history or process metadata.
- Retrieve the key from a protected secret manager, operating-system keychain, or environment variable with appropriately restricted access.
- Ensure
pgyer_all.shdoes not print the key to standard output, standard error, build logs, shell tracing, or network error messages. - Add output redaction before sending build results through
reply, covering the supplied key and known credential formats. - Rotate any API key previously processed by this workflow if feedback messages may have been retained or shared.
- Grant the upload key only the minimum Pgyer permissions required for artifact publication and use separate credentials for separate environments.
