0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 18:47:00 +08:00
discourse/config
Sérgio Saquetim e75cf456e8 SECURITY: Restrict group SMTP test to admins and block internal hosts
The `test_email_settings` endpoint in `GroupsController` allowed non-staff
group owners to make the server open outbound SMTP connections to arbitrary
`host:port` combinations, creating an SSRF primitive.

On hosted Discourse instances, even site admins don't have infrastructure
access, so an unfiltered SMTP test endpoint lets them probe internal
networks, cloud metadata endpoints, and internal services.

This PR:
- Tightens authorization from `ensure_can_edit!` to
  `ensure_can_admin_group!` so only admins/moderators can access the endpoint
- Adds SSRF filtering using `FinalDestination::SSRFDetector` to block
  connections to private/internal IP addresses
- Adds tests for both the auth restriction and SSRF filtering

---

**Security Advisory:** https://github.com/discourse/discourse/security/advisories/GHSA-5976-77mj-m4h3
2026-03-31 15:12:45 +01:00
..
environments DEV: Move puma to test-only dependency (#38652) 2026-03-18 05:23:12 +08:00
initializers FIX: Improve MCP OAuth callback error handling (#38889) 2026-03-27 07:34:24 +11:00
locales SECURITY: Restrict group SMTP test to admins and block internal hosts 2026-03-31 15:12:45 +01:00
application.rb FIX: rack middleware dev warnings (#36460) 2025-12-10 16:15:53 -06:00
boot.rb DEV: Automatically turn on irb autocomplete with debugger (#37052) 2026-01-12 13:29:23 +10:00
cdn.yml.sample
database.yml DEV: Support per-unicorn-worker DB variable overrides (#35615) 2025-10-27 13:45:27 +08:00
deploy.rb.sample
dev_defaults.yml DEV: Convert admin-incoming-email modal to component-based API (#22701) 2023-07-20 16:31:20 -05:00
discourse.config.sample
discourse.pill.sample DEV: Move puma to test-only dependency (#38652) 2026-03-18 05:23:12 +08:00
discourse_defaults.conf PERF: Enable mini_racer_single_threaded by default (#38827) 2026-03-24 15:37:56 +00:00
environment.rb DEV: Add env var for local email port (#36900) 2025-12-31 14:25:02 +10:00
logrotate.conf
multisite.yml.production-sample
nginx.sample.conf PERF: Enable brotli in NGINX (#32333) 2025-04-24 15:45:13 +01:00
official_plugins.json DEV: Enforce deprecation-free tests for preinstalled plugins/themes (#36445) 2025-12-16 17:48:29 -03:00
pitchfork.conf.rb DEV: Enable rollup plugin compiler by default (#38658) 2026-03-19 11:44:54 +00:00
projections.json DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
routes.rb FEATURE: Add calendar subscription URLs to user preferences (#38598) 2026-03-17 10:28:20 -03:00
sidekiq.yml
site_settings.yml UX: new checkbox design (#38967) 2026-03-30 19:53:11 +02:00
spring.rb
thin.yml.sample
unicorn.conf.rb DEV: Fix random typos (#38303) 2026-03-05 23:25:58 +01:00
unicorn_launcher DEV: Enable Pitchfork by default (#37679) 2026-02-11 11:52:39 +01:00