| title |
|---|
Security Model (Legacy) |
!!! warning "Legacy Documentation" This page has been superseded by the new documentation structure. See Security Model for the current version.
This document describes the security model, assumptions, and limitations of bugsafe.
bugsafe is designed to create safe-to-share crash bundles by automatically redacting sensitive information from command output. The goal is to enable developers to share debugging information without exposing secrets.
- Prevent secret leakage - Remove API keys, tokens, passwords, and other sensitive data
- Preserve debugging utility - Keep enough information to diagnose issues
- Deterministic correlation - Same secret → same token for traceability
- Non-reversible - Cannot recover original secrets from tokens
| Threat | Mitigation |
|---|---|
| API keys in output | Pattern matching for 25+ secret formats |
| Database credentials | Connection string patterns |
| Private keys | PEM header/footer detection |
| Email addresses | Email pattern matching (configurable) |
| IP addresses | IPv4/IPv6 patterns (configurable) |
| File paths | Path anonymization (home, user, temp dirs) |
| Environment variables | Blocklist of sensitive variables |
| Threat | Reason |
|---|---|
| Custom secret formats | Users must add custom patterns |
| Secrets in binary data | Only text is processed |
| Side-channel attacks | Not designed for adversarial use |
| Encrypted secrets | Cannot detect encrypted data |
Input Text
│
▼
┌─────────────────┐
│ Pattern Matching│ ← 25+ regex patterns
└────────┬────────┘
│
▼
┌─────────────────┐
│ Tokenization │ ← Deterministic, salted
└────────┬────────┘
│
▼
┌─────────────────┐
│ Path Anonymizer │ ← Replace sensitive paths
└────────┬────────┘
│
▼
┌─────────────────┐
│ Verification │ ← Check for remaining secrets
└────────┬────────┘
│
▼
Redacted Output
- Each redaction session uses a cryptographically random salt
- Only the SHA-256 hash of the salt is stored in the bundle
- The salt itself is never persisted
- Same salt = same tokens (for correlation within a bundle)
| Priority | Category | Examples |
|---|---|---|
| CRITICAL | Private keys, credentials | PEM keys, passwords |
| HIGH | API keys, tokens | AWS, GitHub, Slack tokens |
| MEDIUM | Generic secrets | api_key=, password= patterns |
| LOW | Network info | IP addresses |
| OPTIONAL | Personal info | Email addresses |
| DISABLED | High false-positive | UUIDs |
- Command arguments passed directly (no shell interpretation)
- Bundle paths validated for traversal attacks
- ZIP entries checked for path traversal (
../) - Maximum file sizes enforced
- All text output passes through redaction engine
- Environment variables filtered through blocklist
- File paths anonymized to remove usernames
- Regex patterns have configurable timeout (default: 100ms)
- Prevents catastrophic backtracking DoS
- Timed-out patterns logged as warnings
bugsafe may miss secrets in these cases:
- Custom formats - Proprietary token formats not in pattern list
- Obfuscated secrets - Base64-encoded or encrypted secrets
- Context-dependent - Secrets only identifiable by context
- New patterns - Recently introduced token formats
Mitigation: Always review bundles before sharing. Use bugsafe inspect to check redaction summary.
bugsafe may incorrectly redact:
- UUID-like IDs - Disabled by default
- Email-like strings - Configurable
- IP-like numbers - Configurable
- Long alphanumeric strings - May match generic patterns
Mitigation: Use --no-redact for trusted environments or adjust pattern configuration.
Before sharing a bundle, verify:
- Run
bugsafe inspect <bundle>to review redaction summary - Check that expected secret categories were detected
- Review redacted output for any remaining sensitive data
- Consider audience before sharing (internal vs public)
If you discover a secret was not redacted:
- Delete the shared bundle immediately
- Rotate the exposed credential
- Report the pattern gap (see Contributing)
- Update your bugsafe version
Please report security vulnerabilities via:
- GitHub Security Advisories (preferred)
- Email to maintainers (for critical issues)
Do NOT open public issues for security vulnerabilities.
- bugsafe processes data locally; no external services
- No telemetry or data collection
- Bundles are self-contained files you control
- Salt hashes cannot be used to recover secrets
| Version | Security Changes |
|---|---|
| 0.1.0 | Initial security model |