discord-php-bot-security
Skill by discord-php
Audits DiscordPHP bots and API libraries for security issues. It covers token leaks, secrets in custom_ids and error messages, constant-time comparison, and OAuth, CSRF and webhook checks.
Install discord-php-bot-security
Built from the published package, never by AI.
git clone --depth 1 https://github.com/discord-php/DiscordPHP /tmp/DiscordPHP && mkdir -p ~/.claude/skills && cp -r /tmp/DiscordPHP/.github/skills/discord-php-bot-security ~/.claude/skills/discord-php-bot-securityRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install discord-php-bot-security in Claude Code
git clone --depth 1 https://github.com/discord-php/DiscordPHP /tmp/DiscordPHP && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/DiscordPHP/.github/skills/discord-php-bot-security ~/.gemini/antigravity-cli/skills/discord-php-bot-securityAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install discord-php-bot-security in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill is a security checklist for PHP code that uses DiscordPHP. It is built from findings in the DiscordPHP-MTG, DiscordPHP-NHA, DiscordPHP-Voice and Civilizationbot repositories. The checklist covers five areas: sending the Discord bot token to third-party APIs, keeping tokens out of logs and exception messages, keeping secrets out of custom_id values, OAuth2, CSRF and webhook handling, and repository hygiene.
The skill gives code patterns to follow, such as setting Authorization only when a real value exists and redacting tokens before logging. It also lists a quick ripgrep sweep to find risky patterns in src/. It is meant for developers reviewing an HTTP client, an error handler, an OAuth or webhook endpoint, or a repository before publishing it.
Written from the project's SKILL.md and checked against it.
What it can do
- Token leak checkFlags Discord bot tokens sent to unrelated third-party API hosts in HTTP clients.
- Log and exception redactionExplains how to keep tokens out of logs, 422 bodies and exception messages.
- custom_id reviewChecks that agent or session tokens stay in server-side closures, not component custom_ids.
- OAuth and CSRF checksCovers secure random state ids, hash_equals comparison and single-use state tokens.
- Webhook signature checksAdvises verifying X-Hub-Signature-256 with hash_equals and failing closed when the secret is unset.
- Redirect URI validationRequires the effective redirect_uri to be checked against an allow-list.
- Repo hygiene reviewLists .gitignore entries and a git ls-files command to find tracked secrets.
- Grep sweepProvides ripgrep patterns to find tokens in URLs, risky logging and weak randomness.
Try asking
- Audit my DiscordPHP HTTP client for bot token leaks to third-party hosts
- Check my webhook endpoint for signature verification and fail-closed behavior
- Review my error handler for tokens exposed in logs or exception messages
Good to know
- The checklist is based on findings from four named repositories.
- The grep sweep uses rg (ripgrep) syntax.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .github/skills/discord-php-bot-security/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md5 KB
Alternatives to discord-php-bot-security
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
discord-php-bot-security: common questions
Does this skill send my bot token anywhere?
The source does not describe any network calls. It is a checklist of code patterns to review and fix.
What is the custom_id rule in this skill?
Component custom_ids are sent to Discord and visible to clients, so the agent or session token should be captured in the server-side listener closure instead.
Why should I avoid uniqid() for OAuth state?
The skill says uniqid() is predictable because it is based on microtime. It recommends bin2hex(random_bytes(16)) instead.
How do I install discord-php-bot-security?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is discord-php-bot-security free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is discord-php-bot-security safe to use?
It scores 76 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to discord-php-bot-security?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
