chatwoot/config/initializers
Sojan Jose ffbf40c720
fix: harden Active Storage direct uploads and proxy streaming (#14440)
Hardens Active Storage handling on Rails 7.1 by filtering internal
direct-upload metadata keys and limiting proxy range requests, while
keeping audio playback on redirect URLs so large recordings are not
routed through the proxy limiter.

Closes
- CVE-2026-33173
- CVE-2026-33174
- CVE-2026-33658

Why
Rails 7.1 does not currently have patched releases for these Active
Storage advisories, and Chatwoot exposes Active Storage direct-upload
endpoints and media URLs. This keeps the Rails dependency unchanged
while adding small local mitigations until Rails can be upgraded to
7.2.3.1+.

What changed
- Filters `identified`, `analyzed`, and `composed` from direct-upload
blob metadata.
- Limits Active Storage proxy range requests to one range under 100 MB.
- Uses redirect URLs for inline audio attachments so normal playback of
large recordings avoids the proxy streaming path.
- Adds scoped bundle-audit ignores for the locally mitigated Active
Storage advisories and the remaining Rails advisories that are not
reachable through current Chatwoot usage.

How to test
- Upload an attachment from the dashboard reply composer and confirm it
sends successfully.
- Upload an attachment from the website widget and confirm it appears in
the conversation.
- POST a direct-upload request with `blob.metadata.identified`,
`blob.metadata.analyzed`, and `blob.metadata.composed`; confirm those
keys are not persisted while custom metadata remains.
- Play an audio/call-recording attachment and confirm the audio URL
loads through Active Storage redirect rather than proxy.
- Run `bundle exec bundle audit check -v`.

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2026-05-14 14:50:29 +05:30
..
monkey_patches feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
00_init.rb Chore: Fix failing sidekiq events for contact create (#966) 2020-06-16 19:39:57 +05:30
01_inject_enterprise_edition_module.rb chore: Introduce enterprise edition license (#3209) 2021-12-09 12:07:48 +05:30
01_redis.rb fix: velma connection limit (#13395) 2026-01-29 20:53:41 +05:30
actioncable.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
active_record_query_trace.rb chore: Upgrade rails and ruby versions (#2400) 2021-08-03 20:11:52 +05:30
active_storage.rb fix: harden Active Storage direct uploads and proxy streaming (#14440) 2026-05-14 14:50:29 +05:30
acts_as_taggable_on.rb fix(perf): disable tags counter cache to prevent label deadlocks (#14021) 2026-04-10 17:32:13 +05:30
ai_agents.rb feat: legacy features to ruby llm (#12994) 2025-12-11 14:17:28 +05:30
application_controller_renderer.rb Upgrade to rails 6 💎 (#11) 2019-08-19 13:49:57 +05:30
assets.rb chore: Upgrade rails and ruby versions (#2400) 2021-08-03 20:11:52 +05:30
audited.rb feat: Audit log APIs (#6434) 2023-03-01 20:02:58 +05:30
backtrace_silencers.rb Upgrade to rails 6 💎 (#11) 2019-08-19 13:49:57 +05:30
content_security_policy.rb feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
cookies_serializer.rb Initial Commit 2019-08-14 15:18:44 +05:30
cors.rb feat: Allow CORS api access (#11546) 2025-05-22 10:13:15 +05:30
custom_error_codes.rb Chore: Fix failing sidekiq events for contact create (#966) 2020-06-16 19:39:57 +05:30
datadog.rb chore: Handle APM variables being empty (#6594) 2023-03-02 16:00:16 +05:30
devise_token_auth.rb chore: Increase the max concurrent number of devices (#6121) 2022-12-30 13:54:37 -08:00
devise.rb chore: Fix user email re-confirmation flow (#3581) 2021-12-16 19:32:49 +05:30
event_handlers.rb Refactor Conversation model (#134) 2019-10-12 23:38:41 +05:30
facebook_messenger.rb fix: added HMAC validation for Whatsapp and Instagram webhooks (#14280) 2026-05-05 15:01:11 +05:30
feature_policy.rb Upgrade to rails 6 💎 (#11) 2019-08-19 13:49:57 +05:30
filter_parameter_logging.rb feat: MFA (#12290) 2025-09-18 20:19:24 +05:30
geocoder.rb fix: ip-lookup database lazy loading for all environments (#8052) 2024-10-22 23:18:30 -07:00
git_sha.rb chore: fix git_sha in instance health (#8893) 2024-02-12 14:33:15 +05:30
i18n_pluralization.rb fix(i18n): align pluralization with locale rules (#14266) 2026-04-27 15:40:00 +05:30
inflections.rb Initial Commit 2019-08-14 15:18:44 +05:30
languages.rb fix: Add Estonian to settings language options (#13936) 2026-03-29 09:44:34 +05:30
liquid_handler.rb feat: Improved password security policy (#2345) 2021-06-07 17:26:08 +05:30
lograge.rb fix: Lograge issue on non api pages (#10193) 2024-10-01 16:53:27 -07:00
mailer.rb feat: Add Amazon SES inbound email support (#12893) 2025-11-18 15:33:08 +05:30
mime_types.rb Initial Commit 2019-08-14 15:18:44 +05:30
omniauth.rb feat: SAML authentication controllers [CW-2958] (#12319) 2025-09-10 20:02:27 +05:30
permissions_policy.rb chore: Upgrade to Rails 7 (#6719) 2023-05-06 10:44:52 +05:30
rack_attack.rb feat: ensure signup verification [UPM-14] (#13858) 2026-04-07 13:45:17 +05:30
rack_profiler.rb chore: Improvements for codespace (#11667) 2025-06-04 00:21:23 -05:00
rack_timeout.rb chore: Set rack-timeout to log at ERROR level (#10400) 2024-11-11 12:35:05 -08:00
searchkick.rb feat(ee): Setup advanced, performant message search (#12193) 2025-08-28 10:10:28 +05:30
secure_password.rb feat: Improved password security policy (#2345) 2021-06-07 17:26:08 +05:30
sentry.rb fix: exclude MutexApplicationJob::LockAcquisitionError from Sentry (#13965) 2026-04-01 18:02:19 +05:30
session_store.rb chore: Use 'Lax' instead of 'None' (#1129) 2020-08-09 18:13:17 +05:30
sidekiq.rb fix: captain auto sync scheduler config (#14336) 2026-05-04 13:37:25 +05:30
stripe.rb chore: Add ee helper, custom_attributes to account (#5058) 2022-07-19 00:33:06 +05:30
warden_hooks.rb 🚨Fix Rubocop lint errors 2019-10-20 14:17:26 +05:30
wrap_parameters.rb Initial Commit 2019-08-14 15:18:44 +05:30