Research/chatwoot-slack-oauth-state
0-dayNo CVEHighPublic

Chatwoot, a Slack connect link that binds someone else

Chatwoot v4.19.1 builds its Slack authorize URL without an OAuth state and redeems any code into the account in the request. An attacker who starts the flow against their own Slack workspace can hand the callback to a victim administrator and bind that tenant's inbox to the attacker's Slack. The Slack exchange is stubbed in the lab; the Chatwoot behaviour is real. No CVE yet.

Name
Chatwoot, a Slack connect link that binds someone else
Type
0-day analysis
CVE
n/a
CVE Risk
high
Disclosure Status
public
Vendor
Chatwoot
Affected
Chatwoot v4.19.1 caab07a8f00032d5205b5a5d7e2eb0ba2f3d2d82. Needs Slack configured and a logged-in administrator to open the link.
Published
13 Nov 2026
Updated
13 Nov 2026
Tags
0-day, chatwoot, rails, slack, oauth, cwe-352, authenticated

One click, and the inbox answers to a stranger

I am @abraxas_null. The proof of concept is on GitHub: abraxas/chatwoot-slack-oauth-state (loopback client). The lab stack is lab/: Dockerfile, docker-compose.yml, run.sh, poc.py. Authorized lab only. It talks to loopback.

When a support team connects Slack, Chatwoot sends the administrator to Slack, Slack sends them back with a one-time code, and Chatwoot swaps that code for a token. OAuth has a parameter for this round trip, called state. It ties the code coming back to the browser that started the flow. Chatwoot does not send one, and it does not check for one. So a code from anyone's Slack can be redeemed into anyone's Chatwoot tenant.

The practical version: I start a Slack install against my own workspace, stop at the callback, and send a victim administrator a link containing my code. Their browser posts it with their session. Their tenant now holds my workspace's token. New-conversation notifications go to my Slack.

This is Chatwoot v4.19.1 (caab07a8f00032d5205b5a5d7e2eb0ba2f3d2d82, 24 October 2026). No CVE yet. CWE-352. 7.1 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:H/A:N).

What is real in the proof. A genuine exchange needs a registered Slack app, so the lab replaces Slack::Web::Client#oauth_v2_access with a fixed attacker-workspace response. Everything Chatwoot does runs over real HTTP against the pinned build: the authorize URL, the redemption, the stored hook, the account it lands in. The vendor round trip is simulated, and I will say so in any report I send. The consequence for the victim tenant is read from the stored hook, not observed in Slack.

Why this one

Integrations are where a tenant identity gets encoded into a URL and then forgotten. Chatwoot has twelve integration apps in one YAML file, and each one decides for itself how it comes back. Linear is in the same file as Slack and does it correctly: it signs a token carrying the account id and decodes it on the callback. Slack, six lines further down, does not.

That contrast is the finding. It is not that OAuth is hard. It is that one implementation in the file already solved it and the other one did not.

The skip list

Already public on this pin, and not refiled: the WhatsApp and Twilio signature work, the help-centre preview HMAC, the platform-user token scope, associated_article_id, the automation team-email check, the Dyte IDOR, the widget contact merge, and the draft-article visibility gap.

Surfaces that returned nothing

The other ten integrations either use a signed reference or take no callback at all. Shopify gates on a feature flag and a shop-domain normaliser. Notion and OpenAI are key-entry, no redirect. Google Translate is a server-side key. Stripe is excluded from the hooks controller on purpose. Linear has encode_state. The webhook app is a URL the tenant supplies.

Slack was the one that takes a redirect, stores a token, and has no state.

The leftover

The catalog builds the button the administrator clicks:

Plain text
# app/models/integrations/app.rb
when 'slack'
  client_id = GlobalConfigService.load('SLACK_CLIENT_ID', nil)
  "#{params[:action]}&client_id=#{client_id}&redirect_uri=#{self.class.slack_integration_url}"

params[:action] is the Slack authorize URL from config/integration/apps.yml. The string gets client_id and redirect_uri appended. No state. And the redirect URI contains the account:

Plain text
def self.slack_integration_url
  "#{ENV['FRONTEND_URL']}/app/accounts/#{Current.account.id}/settings/integrations/slack"
end

The account id in the path is the only thing that says which tenant the callback belongs to, and the client controls it.

The redemption:

Plain text
def create
  hook_builder = Integrations::Slack::HookBuilder.new(
    account: Current.account,
    code: params[:code],
    inbox_id: params[:inbox_id]
  )
  @hook = hook_builder.perform
end

HookBuilder calls oauth_v2_access with the code and writes the returned token onto Current.account. On the frontend, Slack.vue reads props.code on mount and dispatches connectSlack. So the attack is a URL a logged-in administrator opens.

Wrong turns

The Slack app did not appear at all on the first run. db:chatwoot_prepare seeds installation_configs.yml, which creates blank rows for SLACK_CLIENT_ID and SLACK_CLIENT_SECRET, and GlobalConfigService.load returns that blank row instead of falling back to ENV. The seed now writes the rows and clears the cache. That is a lab bug, not a product bug, but it cost an hour and it is worth writing down for anyone else building Chatwoot labs.

The second was the stub. slack-ruby-client 2.7.0 defines Slack::Web as a module, and I reopened it as a class. Rails died at boot with Web is not a class (TypeError). Reopening it as module Slack; module Web; class Client works.

The third was assuming the app's enabled flag would be true after the hook was created. It is created disabled; the PoC patches it to enabled before reading the token, which is also what the UI does.

What an attacker can do

Privilege Method / sink Recon / integrity / availability Lab-proven or inferred
Read the authorize URL the tenant is given GET /api/v1/accounts/:id/integrations/apps Recon Lab-proven. No state=
Redeem an arbitrary code into the tenant POST /api/v1/accounts/:id/integrations/slack Integrity Lab-proven, exchange stubbed
Bind the tenant to the attacker's workspace stored Integrations::Hook.access_token Integrity Lab-proven. Token equals the attacker token
Enable the integration PATCH /integrations/hooks/:id Integrity Lab-proven
Receive new-conversation notifications Slack app events Confidentiality Inferred from the integration
Reply into customer threads with two_way Slack message actions Integrity Inferred
Replace a tenant's existing Slack connection allow_multiple_hooks: false Integrity Inferred
Read Chatwoot conversations directly none n/a Closed: the credential is a Slack bot token

Stays closed

Axis Method / sink Why it is closed
Recon Direct Chatwoot data access The stored credential is Slack-scoped
Integrity Silent binding The victim must be logged in and open the link
Integrity Replaying the same code Slack codes are single-use; the stub does not model that
Integrity Choosing the tenant The redirect URI and the POST path both carry the account id

The lab

Postgres 16 with pgvector, Redis 7, Puma and Sidekiq from chatwoot/chatwoot:v4.19.1, plus lab/slack_stub.rb mounted as an initializer. The seed creates one tenant, writes the lab Slack client id and secret into installation_configs, and stops. The PoC asserts the authorize URL, posts the attacker's code with the admin session, enables the hook, then reads the stored token out of Postgres through rails runner so the proof does not depend on an HTTP response.

Plain text
IOC authorize_url=https://slack.com/oauth/v2/authorize?scope=commands,chat:write,...&client_id=lab-slack-client-id&redirect_uri=http://127.0.0.1:28230/app/accounts/1/settings/integrations/slack
IOC state_param_present=false redirect_uri=/app/accounts/1/settings/integrations/slack
IOC redeemed code='lab-attacker-issued-code' hook_id=1 status=False account=1
IOC stored_hook hook_id=1 account=1 status=enabled token='xoxb-lab-attacker-workspace'
IOC tenant_enabled=true hook_bound_to_attacker_workspace=true
SUCCESS CHATWOOT-F3-SLACK-OAUTH-STATE account=1 hook=1 state_absent=true redeemed_without_session=true stored_token=xoxb-lab-attacker-workspace xoxb-lab-attacker-workspace

run.sh tears the stack down on exit.

The fix

Generate a random state when the administrator starts the flow, store it server-side against the account and the user, and require it on the callback before the exchange. Linear's encode_state in the same file is the pattern to copy. Reject a callback with no state, or one that does not match the account in the path.

References

Abraxas Labs abraxaslabs.tech · github.com/abraxas · @abraxas_null · abraxas.null@proton.me