Skip to main content

Security Overview

BugPin is a self-hosted bug reporting tool built with security-first defaults. Because all data is stored on your own server, its security posture is entirely under your control. This page describes the security measures built into BugPin, including API key protection, session management, input validation, and security headers.

Built-in Security Measures​

API Key Protection​

  • Hashed Storage: API keys are stored as SHA256 hashes in the database. The full key is only displayed once when a project is created or when the key is regenerated.
  • Prefix Display: After creation, only the key prefix (first 12 characters) is visible in the admin interface for identification purposes.
  • Header-Only Authentication: API keys must be sent via the x-api-key HTTP header. Query parameter authentication is not supported.

Session Security​

  • Secure Cookies: Session cookies are configured with:
    • httpOnly: Prevents JavaScript access to cookies
    • secure: Requires HTTPS in production (when HTTPS enforcement is enabled)
    • sameSite: lax: Protects against CSRF attacks
  • Configurable Duration: Session lifetime can be configured (default: 7 days)
  • Automatic Expiration: Sessions are automatically invalidated after the configured duration

Password Security​

  • bcrypt Hashing: All user passwords are hashed using bcrypt with a high cost factor
  • Password Policy: Administrators set a minimum length and required character types for new passwords
  • One-Time Initial Password: The initial admin password (ADMIN_PASSWORD, default changeme123) works for one login only. BugPin then requires a new password before the Admin Console or the API can be used
  • No Password Recovery: Passwords cannot be recovered, only reset by administrators

Two-Factor Authentication​

  • Authenticator Apps and Passkeys: Users can add an authenticator app (TOTP), passkeys, or both, plus single-use recovery codes
  • Passwordless Sign-In: A passkey can replace both the password and the second step
  • Enforceable: Administrators can require two-factor authentication for admins or for all users
  • Protected Secrets: Authenticator secrets are encrypted, recovery codes are hashed, and passkeys are stored as public keys only
  • Brute-Force Protection: After 10 failed second steps for one account within 15 minutes, the second step is blocked for that account for 15 minutes
  • Password Confirmation: Adding or removing a method and regenerating recovery codes require the current password

See Two-Factor Authentication and Passkeys.

Rate Limiting​

  • Configurable Limits: The widget submission limit (requests per minute) is configurable and counted per client address and project. Login attempts are limited to 5 per minute per client address
  • Separate Sign-In Limits: Each sign-in endpoint has its own count, so mistyped two-factor codes don't block the next password attempt
  • IPv6 Grouping: IPv6 clients are counted by their /64 network
  • Widget Protection: The widget submission endpoint is rate-limited to prevent abuse
  • Proxy-Aware Tracking: Behind a reverse proxy, the client address comes from x-forwarded-for, which is only trusted from proxies allowed by TRUST_PROXY. Forged headers from clients cannot choose the rate-limit bucket

CORS Protection​

  • Widget API Only: Cross-origin requests are allowed only for /widget.js and the public widget API (/api/widget/*), and never with cookies
  • Same-Origin Admin API: All other endpoints, including everything that uses the session cookie, accept same-origin requests only
  • Domain Whitelisting: Projects can be configured to only accept reports from specific domains

Input Validation​

  • Schema Validation: All API inputs are validated using Zod schemas
  • SQL Injection Prevention: All database queries use parameterized statements
  • XSS Prevention: User-generated content is sanitized before display

Security Headers​

BugPin automatically sets the following security headers:

  • X-Content-Type-Options: nosniff
  • X-Frame-Options: SAMEORIGIN
  • Referrer-Policy: no-referrer
  • Strict-Transport-Security
  • Permissions-Policy: display-capture=(self), which allows screen capture on BugPin's own pages only

These are Hono's secure-header defaults plus the permissions policy. /widget.js is served without them so host pages can load it.

Data Storage​

  • Local Storage: All data is stored locally on your server
  • No External Services: BugPin does not send data to external services (unless you configure integrations)
  • File Storage: Screenshots and attachments are stored in the local filesystem
  1. Use a TLS-Terminating Reverse Proxy: Always run BugPin behind a reverse proxy (nginx, Caddy, Traefik) that handles HTTPS
  2. Enable HTTPS Enforcement: Once your proxy is configured, enable HTTPS enforcement in settings
  3. Keep Software Updated: Regularly update BugPin to get security patches
  4. Use Strong Passwords: Set a password policy that fits your requirements
  5. Require Two-Factor Authentication: Require it at least for admins (see Two-Factor Authentication and Passkeys)
  6. Limit Admin Access: Only grant admin access to users who need it
  7. Configure Domain Whitelisting: Restrict which domains can submit bug reports
  8. Monitor Logs: Regularly review server logs for suspicious activity

Reporting Security Issues​

If you discover a security vulnerability in BugPin, please report it responsibly by contacting the maintainers directly. Do not create public issues for security vulnerabilities.

We use cookies for analytics to improve our website. More information in our Privacy Policy.