Skip to content

Security: gwhthompson/grist-authn

Security

SECURITY.md

Security

Threat model

This extension protects against:

  • Password theft - Argon2id hashing with high memory cost
  • Brute force - Account lockout and rate limiting
  • User enumeration - Timing-safe verification, generic error messages
  • Token theft - Hashed storage, expiry limits
  • Replay attacks - Single-use reset tokens

Password security

Hashing

Passwords use Argon2id with OWASP-recommended parameters:

Parameter Value
Algorithm Argon2id
Memory 64 MiB
Iterations 3
Parallelism 1

These settings resist GPU and ASIC attacks while remaining usable on modest hardware.

Strength validation

zxcvbn checks password strength:

  • Minimum score: 2 (fair)
  • Minimum length: 8 characters
  • Checks for: dictionary words, keyboard patterns, personal info, common passwords

Rate limiting

Endpoint Limit Window
Login 10 attempts 15 minutes
2FA verify 3 attempts 5 minutes
Password reset request 3 requests 1 hour
Password setup 5 attempts 15 minutes

Limits apply per IP address combined with email (where applicable).

Account lockout

After 5 failed login attempts, the account locks for 15 minutes.

The lockout:

  • Applies per account, not per IP
  • Clears automatically after 15 minutes
  • Clears on successful login after lockout expires

Reset tokens

Password reset tokens:

Property Value
Entropy 256 bits
Storage SHA-256 hash (no plaintext)
Expiry 24 hours
Usage Single-use (cleared on password set)

Two-factor authentication

TOTP 2FA with RFC 6238 compliance:

  • Secret: 160-bit random
  • Time step: 30 seconds
  • Algorithm: SHA-1 (standard for TOTP)
  • Code length: 6 digits

Rate limited to 3 attempts per 5 minutes to prevent code exhaustion.

Session security

Sessions inherit grist-core's session handling:

  • Set GRIST_SECURE_COOKIES=true for HTTPS-only cookies
  • Set GRIST_COOKIE_SAMESITE=Lax for CSRF protection

Known limitations

  1. No password history - Users can reuse old passwords
  2. No per-user reset limit - Could generate many reset emails for one user
  3. OIDC UNPROTECTED mode - Available for development only

Reporting vulnerabilities

Report security issues privately via GitHub Security Advisory:

  1. Go to the repository Security tab
  2. Click "Report a vulnerability"
  3. Provide details and reproduction steps

We aim to respond within 48 hours and fix critical issues within 7 days.

There aren't any published security advisories