0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-11 02:59:07 +08:00
discourse/config
Sérgio Saquetim 81497765aa SECURITY: Restrict group SMTP test to admins and block internal hosts [backport 2026.1]
Backport of #603 to release/2026.1.

---

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:50 +01:00
..
environments DEV: Add env var for local email port (#36900) 2025-12-31 14:25:02 +10:00
initializers FEATURE: Notify admins of upcoming changes and log events (#37003) 2026-01-21 12:45:54 +10:00
locales SECURITY: Restrict group SMTP test to admins and block internal hosts [backport 2026.1] 2026-03-31 15:12:50 +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
discourse_defaults.conf DEV: Remove IMAP support in Discourse (#37002) 2026-01-12 10:07:26 +10: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: Make changes for docker_manager Pitchfork compatibility (#36456) 2025-12-18 14:22:39 +01:00
projections.json DEV: Prepare for rename of app/assets/javascripts/ -> frontend/ 2025-10-22 16:24:11 +01:00
puma.rb
routes.rb FEATURE: Add native support for /llms.txt (#36939) 2026-01-20 08:53:20 +01:00
sidekiq.yml
site_settings.yml SECURITY: harden webooks endpoints 2026-02-26 12:24:37 +00:00
spring.rb
thin.yml.sample
unicorn.conf.rb DEV: Support per-unicorn-worker DB variable overrides (#35615) 2025-10-27 13:45:27 +08:00
unicorn_launcher DEV: Check RUN_PITCHFORK for explicit "1" value (#37264) 2026-01-23 09:30:28 +08:00