Commit Graph

7909 Commits

Author SHA1 Message Date
Mike Dalessio a6cb569945 Merge pull request #1996 from basecamp/flavorjones/email-validation-in-signup-signin
Validate email before creating identity during sign-up and sign-in
2025-12-06 16:56:38 -05:00
Mike Dalessio 0160f215f2 Validate email before creating identity during sign-up and sign-in
Avoid Sentry exceptions when attackers try to stuff invalid emails. The
browser performs form field validation that should normally prevent this
from occurring, so we just return 422 without validation error messages.

Also:

- extract redirect_to_session_magic_link helper
- some controller refactoring and cleanup
2025-12-06 16:52:16 -05:00
Mike Dalessio 95ba2c01b8 Add email validation to Signup 2025-12-06 16:50:39 -05:00
Mike Dalessio 3ff45d77bb Ensure test coverage for invalid Signup#complete 2025-12-06 16:46:51 -05:00
Mike Dalessio b2250b6d35 Ensure test coverage for all branches of JoinCodesController#create 2025-12-06 16:40:51 -05:00
Mike Dalessio d747d1bfa3 Ensure we have good test coverage on Signup.create_identity
because we're relying on it returning a MagicLink
2025-12-06 16:40:17 -05:00
Mike Dalessio 0793400771 Merge pull request #1994 from basecamp/flavorjones/signup-dev-magic-link
Render verification code in dev for signups, too
2025-12-06 15:07:47 -05:00
Mike Dalessio c32685981f Merge pull request #1993 from basecamp/flavorjones/avatar-image-type-error-message
User profile edit form shows validation errors
2025-12-06 15:04:42 -05:00
Mike Dalessio b439a7695b Render verification code in dev for signups, too
Related to 5865d79e / #1991
2025-12-06 15:02:22 -05:00
Mike Dalessio 675600af72 Improve presentation of validation errors 2025-12-06 14:57:27 -05:00
Mike Dalessio c388f5ef20 Display validation errors for user profiles.
Specifically this will help people understand why their SVG avatar
uploads are being rejected, and will keep the RecordInvalid exception
out of Sentry logs.
2025-12-06 14:34:08 -05:00
Mike Dalessio 1883473de1 Remove duplication in the list of supported avatar file types 2025-12-06 14:34:08 -05:00
Mike Dalessio 8992a45c35 Merge pull request #1991 from basecamp/flavorjones/dev-mode-verification-code
Display the verification code in the development environment
2025-12-06 13:49:29 -05:00
Mike Dalessio 5865d79ed9 Display the verification code in the dev env
This seems better and easier than the console log.
2025-12-06 13:46:13 -05:00
Jeremy Daer 529f5af5f6 CSP adherence: fix magic links console logging (#1989)
* CSP: fix magic link console logging by including nonce in the script tag

* Remove unused back-nav controller

Unused since c0f842427d

Eliminates a potential CSP violation with javascript: URI
2025-12-06 10:08:22 -08:00
Jorge Manrubia e6e0048103 Merge pull request #1987 from basecamp/indented-list-alignment
Small visual tweak for indented list style
2025-12-06 18:58:01 +01:00
Zoltan Hosszu e562c72ec9 Small visual tweak for indented list style 2025-12-06 17:58:01 +01:00
Stanko Krtalić acedb76598 Merge pull request #1952 from luojiyin1987/chore/dockerfile-prod-exclude-test-gems
chore: exclude test gems from production bundle
2025-12-06 11:31:17 +01:00
Stanko Krtalić f3e47901ec Merge pull request #1980 from basecamp/reverv-ssrf-acronym
Rever to using Ssrf instead of SSRF
2025-12-06 11:10:24 +01:00
Stanko K.R. 73c2b00211 Rever to using Ssrf instead of SSRF
Ref: https://github.com/basecamp/fizzy/pull/1967#discussion_r2593750027
2025-12-06 11:04:55 +01:00
Jorge Manrubia ffb357becf Merge pull request #1742 from basecamp/latest-lexxy
Update lexxy to latest
2025-12-06 10:31:19 +01:00
Jeremy Daer af14feb8fc CSP gives env config precedence (#1976)
Bit clearer, and simpler config wrangling: presence of ENV → use it.
2025-12-05 20:49:41 -08:00
Jeremy Daer ab5964a375 Tune CSP: allow required external sources and user tools (#1977)
External sources:
- challenges.cloudflare.com for Turnstile (script-src, frame-src)
- storage.basecamp.com for Active Storage (connect-src)

User tools: loosen style/img/font/media/worker-src to avoid fighting
accessibility extensions, privacy tools, and custom fonts.
2025-12-05 20:45:48 -08:00
Mike Dalessio 7694ade843 Merge pull request #1975 from basecamp/flavorjones/fix-webhook-view
Pass correct params to webhook reactivation url helper.
2025-12-05 22:47:33 -05:00
Mike Dalessio 69f8216982 Pass correct params to webhook reactivation url helper.
ref: https://app.fizzy.do/5986089/cards/3219
2025-12-05 22:44:34 -05:00
Mike Dalessio 00db048f9e Merge pull request #1968 from basecamp/flavorjones/only-email-confirmed-users
Mark users as "verified" and only send notifications to verified users
2025-12-05 22:15:13 -05:00
Mike Dalessio fc8ef33332 Show unverified status on user profile page
Display "Unverified" with an explanation instead of the email address
for users who haven't confirmed their identity. Hide the card links
and activity timeline since unverified users won't have any activity.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:51:44 -05:00
Mike Dalessio 1ad52d2590 Only send notification emails to verified users
Adds verified? check to bundling_emails? to prevent notification emails
from being sent to users who have never authenticated. This closes the
spam vector where bad actors could create users for known email
addresses and trigger unwanted notifications by mentioning them.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:51:44 -05:00
Mike Dalessio e174206233 Add backfill script for verified_at timestamps
Identifies users who have demonstrated authentication by looking for
evidence of real activity: owners, content creators (cards, comments,
boards, events), action takers (assigners, closers, postponers,
reactors, pinners, filter creators), board accessors, export requesters,
push subscribers, setup completers, and users with active sessions.

Run this script after deploying the verified_at column to backfill
existing users before enabling the notification guard.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:51:44 -05:00
Mike Dalessio 4602cd3cdd Add verified_at timestamp to use for spam prevention
User are marked as verified after a join code is redeemed. The user is
redirected to Users::VerificationsController, either:

- after submitting a valid magic link code,
- or immediately after redeeming the join code (if they're already
  authenticated with the correct identity)

Account owners are automatically verified when the account is
created (because they have already provided a magic link code at that
point).

This sets up for later commits that will backfill existing users and
require verification before sending notification emails.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 21:51:44 -05:00
Mike Dalessio fa549a370b Add a system test for joining an account
Reworked the magic link stimulus controller, because the system test
was causing double-submission of the form (because the event was
bubbling up). I think that change simplifies the form and will still
work well for iOS devices.
2025-12-05 21:51:44 -05:00
Jeremy Daer 345f457513 Tune CSP for user extensions and close implicit-allow gaps (#1974)
Loosen font-src and add media-src to allow browser extensions like
accessibility fonts (OpenDyslexic) and user style managers to work
without CSP violations.

Add default-src and connect-src directives to close security gaps where
unspecified directives were implicitly allowing all sources.
2025-12-05 16:57:03 -08:00
Jeremy Daer 6006491ab4 Content Security Policy (#1964)
Default to a very narrow policy since there are no CDNs or third-party
resources to contend with.

Configurable via:
- config.x.content_security_policy.* for fizzy-saas gem overrides
- DISABLE_CSP to skip entirely
- CSP_REPORT_ONLY to enable report-only mode
- CSP_REPORT_URI for violation reporting
2025-12-05 14:57:50 -08:00
Stanko Krtalić 4c094107b6 Merge pull request #1969 from basecamp/fix-ipaddr-setter
Fix ipaddr setter
2025-12-05 20:46:34 +01:00
Stanko K.R. 1b3d7d4276 Fix ipaddr setter 2025-12-05 20:43:56 +01:00
Stanko Krtalić 3c72599381 Merge pull request #1967 from basecamp/fix-dns-resolution
Fix Resolv::DNS always returning no results
2025-12-05 20:13:44 +01:00
Stanko K.R. cd3751f4c1 Fix Resolv::DNS always returning no results 2025-12-05 20:09:39 +01:00
Kevin McConnell bc16f7582e Merge pull request #1963 from basecamp/update-readme-deploy-info
Document deployment
2025-12-05 17:21:37 +00:00
Andy Smith 2cf718835b Style updates for latest Lexxy version
Style nested lists, highlight dropdown, and link dropdown. Also organizes the CSS file a bit better.
2025-12-05 11:16:11 -06:00
Kevin McConnell 04153038f0 Document deployment
- Update the README with detailed information about how to deploy a
  Fizzy instance
- Reduce the example deploy config
- Add example SMTP configuration in production.rb
2025-12-05 17:03:07 +00:00
Jorge Manrubia 1ac5867d5c These are textareas now 2025-12-05 11:41:11 +01:00
Jorge Manrubia 80a0eb3a4d Fix system test 2025-12-05 11:30:58 +01:00
Jorge Manrubia 48ef7d0b98 Update Lexxy and hide the highlighter for now 2025-12-05 11:24:52 +01:00
Jorge Manrubia 67f36886a1 Update lexxy to latest
Color highlighter, more code languages...
2025-12-05 11:17:29 +01:00
Jorge Manrubia ed6c55adcd Merge pull request #1931 from basecamp/pin-card-refresh
Update pinned cards when the title changes
2025-12-05 10:14:39 +01:00
Jorge Manrubia 59ff50c1cb We can remove ad-hoc handling now that we rely on page refreshes in the card perma 2025-12-05 10:11:24 +01:00
Jorge Manrubia c89db89f2a Only broadcast when the preview changes, use the _later variant for the broadcast, add tests 2025-12-05 10:09:20 +01:00
Andy Smith bcad6b913c Update pinned cards when the title changes 2025-12-05 10:09:20 +01:00
Jorge Manrubia 046a42c4f6 Rename to be more consistent 2025-12-05 07:55:11 +01:00
luojiyin 437cc1e94f chore: exclude test gems from production bundle 2025-12-05 12:01:36 +08:00