T09 · Insecure Skill Coding Practices
- Location
integration-test.js:11- Finding
Hardcoded Live-Looking Discord and GitHub Credentials
- Content
View full analysis
Vulnerability Details
File Location:
integration-test.js:11-12
Vulnerability Type: Hardcoded external-service credentials
Risk Level: Highjavascript // Configuration - obtained from environment variables const DISCORD_WEBHOOK = process.env.DISCORD_WEBHOOK_URL || 'https://discord.com/api/webhooks/1482573744688857109/tD4x8oDKD539koQEeBauFe12N-K2fI1Iydh2Sjvyl23_3JYO08qgXbpBcRFRemKsPUq6'; const GITHUB_TOKEN = process.env.GITHUB_TOKEN || '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';Technical Analysis
The integration test includes a Discord webhook credential and a GitHub personal access token as default fallback values. These credentials are available to anyone who can download or inspect the project, including package consumers and source repository visitors.
When the corresponding environment variables are absent,
npm run integration-testautomatically uses these embedded values and makes live network requests. The Discord credential is used to post a message, while the GitHub credential is used to create a private Gist.Even if the credentials have already expired or been revoked, committing secrets to source code is an insecure credential-management practice. Their historical exposure must be treated as a potential compromise.
Attack Path
- An attacker downloads or inspects the project source.
- The attacker extracts the Discord webhook URL and GitHub token from
integration-test.js. - The attacker tests whether either credential remains valid.
- If the webhook is active, the attacker submits arbitrary messages through it.
- If the GitHub token is active, the attacker performs any API operations allowed by its scopes.
- The attacker may continue using the credentials independently of this Skill until they are revoked.
Impact Assessment
The Discord credential may permit unauthorized posting, impersonation of the webhook identity, spam, phishing, or quota abuse in the as ...[truncated 429 chars]
- Remediation
View remediation
Remediation Suggestions
- Revoke and rotate the exposed Discord webhook and GitHub token immediately.
- Remove all fallback credential literals from the source.
- Require credentials to be supplied explicitly through protected environment variables or a secret manager.
- Fail closed and skip live integration tests when required credentials are absent.
- Purge the credentials from repository history where feasible; deleting them only from the latest revision is insufficient.
- Add automated secret scanning to pre-commit hooks and CI.
- Use dedicated, short-lived, least-privilege test credentials for integration testing.
- Isolate live integration tests from default test execution and require an explicit opt-in flag.
