T09 · Insecure Skill Coding Practices
- Location
billing.py:11- Finding
Hard-Coded Billing API Credential
- Content
View full analysis
Vulnerability Details
File Location:
billing.py, lines 11-17
Vulnerability Type: Hard-coded secret in distributed source code
Risk Level: HighVulnerable Code
python BILLING_URL = "https://skillpay.me/api/v1/billing" API_KEY = "sk_[REDACTED_EXPOSED_CREDENTIAL]" SKILL_ID = "quant-orchestrator" HEADERS = { "X-API-Key": API_KEY, "Content-Type": "application/json" }The credential value is redacted in this report to avoid further disclosure. The audited source contains the complete plaintext value.
Technical Analysis
The billing API credential is embedded directly in source code distributed with the Skill. Every user who downloads or installs the package can read and reuse it independently of the intended billing workflow. The same shared credential is attached to requests for charging users, retrieving balances, and generating payment links.
A source-embedded secret cannot enforce a meaningful trust boundary because possession of the package grants possession of the credential. It may also be copied into source mirrors, logs, caches, backups, and package archives, making complete revocation difficult.
Attack Path
- An attacker downloads or otherwise obtains the Skill package.
- The attacker opens
billing.pyand extracts the plaintextAPI_KEY. - The attacker submits independent HTTPS requests to the billing endpoints using the extracted
X-API-Keyheader. - The attacker attempts operations permitted by the credential, such as balance queries, payment-link creation, or billing calls using attacker-selected user identifiers.
- The activity is attributed to the shared Skill credential rather than a distinct installation or trusted server.
The exact operations available ultimately depend on server-side authorization controls, which are not present in the audited repository.
Impact Assessment
Exploitation does not directly grant operating-system privi ...[truncated 534 chars]
- Remediation
View remediation
Remediation Suggestions
- Revoke and rotate the exposed credential immediately.
- Remove all credentials from source code and repository history.
- Move privileged billing operations to a trusted server controlled by the publisher; clients should not receive the server credential.
- If local authentication is unavoidable, load credentials from a secret manager or protected environment variable and fail closed when no credential is configured.
- Issue narrowly scoped, short-lived, per-installation tokens rather than one shared static key.
- Enforce server-side authorization so callers cannot operate on arbitrary
user_idvalues. - Add rate limits, replay protection, transaction identifiers, and audit logging to billing operations.
- Add secret-scanning checks to pre-commit hooks and CI pipelines.
- Review billing logs for use of the exposed credential and investigate anomalous transactions.
