| Version | Supported |
|---|---|
| 1.x.x | ✅ |
Detcord is designed with security as a priority:
- Never stored: Your Discord token is never saved to disk or localStorage
- Never logged: Tokens are never written to console or log files
- Never transmitted: Tokens are only sent to Discord's official API endpoints
- Masked in UI: If displayed, tokens are masked (e.g.,
****...****) - Format validated: Token format is validated before use to catch extraction errors
- Local only: All operations run entirely in your browser
- No telemetry: We do not collect any usage data or analytics
- No external calls: The only network requests are to
discord.com - No debug API in production: The
window.Detcorddebug interface is only available in development builds
- HTML escaped: All user-visible text is escaped to prevent XSS
- Regex validated: Regex patterns are validated to prevent ReDoS attacks
- ID sanitized: Discord IDs (snowflakes) are validated before use in API requests
- Persistence validated: Saved progress data is schema-validated before restoration
User-provided regex patterns are validated for:
- Maximum length (100 characters)
- Dangerous constructs (nested quantifiers, overlapping alternations)
- Execution time (tested against problematic input)
All Discord IDs are validated to ensure they:
- Are numeric strings
- Have the correct length (17-19 digits)
- Match the expected snowflake format
Saved progress data is:
- Schema-validated on load
- Expired after 24 hours
- Cleared if corruption is detected
If you discover a security vulnerability, please report it responsibly:
- DO NOT open a public GitHub issue
- Report via GitHub Security Advisories (preferred)
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
We will acknowledge receipt within 48 hours and provide a detailed response within 7 days.
- Never share your Discord token with anyone
- Only install Detcord from official sources (GitHub releases)
- Review the code if you have concerns - it's open source
- Keep your browser and userscript manager updated
- Log out of Discord if you suspect your token was compromised
- Detcord cannot protect against malicious browser extensions
- Your token is accessible to any script running on discord.com
- Discord could theoretically detect automated deletion patterns
- The webpack token extraction method may persist a reference in Discord's module cache
The userscript runs with @grant none, meaning it executes in the page context without GM API isolation. This is necessary to access Discord's webpack modules and localStorage. The tradeoff is that other scripts on discord.com could potentially interact with Detcord.
Tokens are extracted using two methods:
- localStorage via iframe: Uses a fresh iframe context to bypass Discord's localStorage overrides
- Webpack introspection: Accesses Discord's token manager through webpack module cache
Both methods access data that is already available to any script running on discord.com.
| Date | Auditor | Findings | Status |
|---|---|---|---|
| 2026-01-02 | Internal | 8 issues identified (2 high, 3 medium, 3 low) | Resolved |
The following issues were identified and resolved before the v1.0 release:
-
ReDoS Vulnerability: User-provided regex patterns could cause catastrophic backtracking
- Fix: Added
validateRegex()with pattern analysis and execution time testing
- Fix: Added
-
Token Exposure via Debug Interface: The
window.Detcordobject exposed the UI instance- Fix: Debug interface now only available in development builds (
__DEV__flag)
- Fix: Debug interface now only available in development builds (
-
Insufficient Input Validation: Guild/channel IDs were not validated before URL construction
- Fix: Added
isValidSnowflake()andisValidGuildId()validators
- Fix: Added
-
Inconsistent XSS Escaping: Some UI code used
innerHTMLfor dynamic content- Fix: Audited all
innerHTMLusage; dynamic content usestextContentorescapeHtml()
- Fix: Audited all
-
Unsafe JSON.parse: Persistence data was parsed without schema validation
- Fix: Added
isValidProgressData()runtime type checker
- Fix: Added
-
No Token Format Validation: Extracted tokens were not validated for expected format
- Fix: Added
isValidTokenFormat()validation in API client constructor
- Fix: Added
-
Missing CSP Documentation: Security tradeoffs of
@grant nonewere undocumented- Fix: Added technical notes section explaining isolation model
-
Webpack Module Reference: Token extractor module persists in webpack cache
- Fix: Documented as known limitation