T09 · Insecure Skill Coding Practices
- Location
scripts/post.mjs:22- Finding
Hard-Coded API Credential in Social Posting Script
- Content
View full analysis
Vulnerability Details
File Location:
scripts/post.mjs, line 22
Vulnerability Type: Hard-coded authentication credential
Risk Level: HighVulnerable Code
js const API_KEY = 'quack_5c6786fb7ac8f08c638d5db176d60b12b906b78ac63d21cf';The credential is subsequently transmitted as an authentication header:
js const res = await fetch(url, { method: 'POST', headers: { 'x-quack-api-key': API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ text: args.text, platform: args.platform, }), });Technical Analysis
A live-looking API credential is embedded directly in distributable source code. Anyone who can access the Skill package, a repository copy, build artifact, backup, or source history can recover this credential without authorization.
Because authentication depends on possession of this shared value, an attacker can call the VibePost endpoint outside the Skill. This bypasses the consent, content-review, local-file disclosure, and platform-scope guardrails documented in
SKILL.md. The remote service may be unable to distinguish legitimate Skill requests from requests made with a copied key.The outbound HTTPS request itself is consistent with the declared social-posting functionality. The security defect is the plaintext credential embedded in the client, not the documented transmission of user-approved post content.
Attack Path
- Obtain a copy of the Skill package, repository, source archive, or leaked source history.
- Read
scripts/post.mjsand extract the embeddedx-quack-api-keyvalue. - Construct an independent HTTP
POSTrequest to the documented endpoint:https://vibepost-jpaulgrayson.replit.app/api/quack/post. - Supply the extracted credential in the
x-quack-api-keyheader. - Submit attacker-selected
textandplatformvalues without invoking the Skill or following its consent guardrails. - Exercise any posting or API privileges assigned to the ...[truncated 810 chars]
- Remediation
View remediation
Remediation Suggestions
- Revoke the exposed credential immediately and issue a replacement. Removal from the current file is insufficient because the value may remain in repository history, caches, archives, and redistributed copies.
- Remove all authentication secrets from source code and documentation.
- Load a per-user or per-deployment credential from a protected environment variable or secret manager, and terminate safely when it is absent. For example:
js const API_KEY = process.env.VIBEPOST_API_KEY; if (!API_KEY) { console.error('VIBEPOST_API_KEY is required'); process.exit(1); }- Use distinct, narrowly scoped credentials for each user or deployment rather than one shared package-wide key.
- Restrict each credential to the minimum required operation, account, and supported platform.
- Add server-side rate limits, request auditing, revocation support, expiration, and regular key rotation. Do not rely exclusively on client-side consent guardrails.
- Ensure credentials and authentication headers are excluded from logs, errors, telemetry, and API responses.
- Scan repository history and released artifacts for the exposed value, then purge it where operationally feasible.
- Add automated secret scanning to development and release pipelines to prevent recurrence.
