Skip to content

Security

Report a problem. Know what you are running.

EmailFlare runs in your own Cloudflare account, so security is shared: the code is ours, the platform is Cloudflare's and the configuration is yours. This page says what each side does.

Report a vulnerability

Use GitHub private vulnerability reporting. Only the maintainers can see what you submit.

What to include

  1. A clear description of the vulnerability.
  2. The affected files, routes or endpoints.
  3. Steps or a proof of concept to reproduce it.
  4. The impact you expect, such as unauthorized access, data exposure or cross-site scripting.
  5. A suggested fix or mitigation, if you have one.

What to expect

The security policy says maintainers review each report promptly, validate it, prepare a fix and coordinate public disclosure once a patch is released. It does not set fixed response times, so none are promised here.

What the app does

Each row below was checked against the source in apps/dashboard.

Security controls in EmailFlare
AreaWhat it does
PasswordsHashed with PBKDF2-SHA256, 100,000 iterations and a random 16-byte salt, through Web Crypto. Sign-in and password-reset requests are limited to 10 attempts per minute per IP address, counted in KV.
SessionsA token signed with HS256 using SESSION_SECRET, in an HttpOnly, SameSite=Lax cookie that is Secure outside local development. It lasts 7 days. A user's role and access are read from the database on every request, so a demotion applies immediately.
Two-factor sign-inOptional TOTP with 6-digit codes and 30 second steps, plus one-time backup codes stored as hashes. Turning it on or off is written to the audit log.
Roles and accessAdministrators and members. Members get any of inbox, api and tester, and only see mailboxes assigned to them. Each API router sits behind one guard, with regression tests. The last administrator cannot be demoted.
API keysEach key is 20 random bytes with an eflive_ or eftest_ prefix. Only a SHA-256 hash is stored, and the full key is shown once, when you create it. Keys can be limited to specific domains and revoked. Test keys capture mail in the sandbox mailbox instead of delivering it.
Per-key rate limit100 requests per 60 seconds for each API key, through the Workers Rate Limiting binding. The binding needs a Workers Paid plan. Without it, keys are not rate limited.
Unsubscribe linksEach link carries a random, single-use token stored in D1. Using it adds a suppression and deletes the token. One-click POST unsubscribe (RFC 8058) is supported.
WebhooksEach delivery is signed with HMAC-SHA256 over the request body, using that webhook's own secret. The signature is in the X-EmailFlare-Signature header.
Inbound HTML mailRendered in an iframe with sandbox="allow-popups allow-same-origin". It does not set allow-scripts, so scripts in a message do not run. Remote images and CSS background images are blocked until the reader chooses to load them. Links open in a new tab.
Audit logRecords who did what for invites, password changes, two-factor changes, webhook changes and suppression edits.
Project hygieneDependabot opens weekly dependency updates, and pre-commit hooks check staged files for secrets.

Shared responsibility

Who is responsible for what
WhoResponsible for
EmailFlare (the code)Authentication, access control and input handling in the app. Keeping dependencies current. Fixing reported vulnerabilities and publishing releases.
CloudflareRunning Workers, D1, R2, KV, Queues and Durable Objects, the network in front of them, and the Email Routing and Email Sending services.
YouYour secrets, your API token, who can access your Cloudflare account, who you invite, and deploying updates. The checklist below covers the details.

Your checklist

  • Set SESSION_SECRET to at least 32 random characters, for example with openssl rand -hex 32, and keep it out of Git. Anyone who has it can sign session tokens.
  • Give the Cloudflare API token only the listed permissions and only the zones you use. Roll it if it leaks.
  • Serve the dashboard over HTTPS and set PUBLIC_URL to your real origin.
  • Turn on two-factor sign-in for administrators. Give members the narrowest access types and mailboxes that let them work.
  • Create one API key per application, scope it to a domain where you can, and revoke keys you no longer use.
  • Limit who can open your Cloudflare account, D1 database and R2 bucket. They hold your mail and contacts, and two-factor secrets are stored in D1 as they are.
  • Add the Workers Rate Limiting binding if you want per-key API limits. It needs a Workers Paid plan.
  • Pull new releases into your repository and deploy them. A fix only protects you once it is deployed.

Known limits

No security feature is absolute. These are the limits to know about.

  • EmailFlare has no published third-party security audit.
  • The HTML mail viewer sets allow-same-origin so the dashboard can measure the frame's height. Scripts still cannot run, but the frame is less isolated than one with an empty sandbox.
  • Remote content blocking covers <img>, srcset and CSS background images. It does not block every kind of remote resource.
  • Sign-in rate limiting reads and writes a KV counter without a lock, so a fast burst can slightly exceed the limit.
  • Two-factor secrets are stored in D1 without a second layer of encryption.
  • There is no service-level agreement.

Advisories

Fixed vulnerabilities are disclosed as GitHub security advisories. Read the published advisories and the changelog, which lists security fixes under their own heading.