loopback
← All posts

News / Security / Packages

Matrix Synapse Vulnerability: Memory Leak Fixed

By Loopback Updated 5 min read

Flat monochrome illustration: matrix Synapse server beside MessagePack decoding, retained memory blocks and a software update.

Synapse 1.164.1 fixes a Matrix Synapse vulnerability that can exhaust server memory. Malformed tokens sent to its public room-list API can trigger a leak in the MessagePack library. The October 28, 2026 release updates the locked dependency from 1.2.1 to 1.2.4. The release notes identify the affected API, and Matrix.org’s weekly update confirms the link.

The library flaw is GHSA-j586-36cw-2gc2, assigned CVE-2026-114613. It can cause denial of service, leaving users unable to reach the server. The Synapse version alone cannot establish risk, which depends on the loaded library and access to the affected code.

The MessagePack memory leak

MessagePack stores data in a binary format. Synapse uses the Python package for that format to read tokens that track pages of directory results. Its C extension can leave memory in use after it rejects malformed data.

With the default strict_map_key=True setting, the decoder rejects map keys that are neither strings nor bytes. By the time the key check fails, the decoder has already built the paired value. The error path omits cleanup for that value, leaving memory in use after parsing ends. Repeated failures can exhaust the memory the process needs to serve requests.

The upstream advisory covers versions before 1.2.3 and names 1.2.3 as patched. The leak affects both single-buffer decoding and the streaming unpacker. Tests in the report did not find this leak in the pure-Python fallback. The repair also uncovered a separate memory-safety flaw in the streaming parser, but the report does not show that Synapse exposes it.

Flat monochrome illustration: matrix public room-list token passing through MessagePack decoding to server memory, with a patch below.
Synapse’s public room-list code decodes pagination tokens with MessagePack.

Synapse’s room-list API

Room directories return results in pages. A client sends a pagination token to request another page. The token comes from the caller, so the server cannot assume that it contains valid data.

In Synapse 1.164.0’s room-list handler, the token decoder passes data to MessagePack. The dependency-update pull request links malformed directory tokens to memory exhaustion. The code and release note confirm that this API passes untrusted input to the flawed decoder. A package list alone would not prove that link.

Access rules depend on the request. The client API code permits anonymous GET requests for the local directory when allow_public_rooms_without_auth is true. That option defaults to false in the inspected release. POST requests need authentication, as do requests that ask Synapse to fetch another server’s directory. Some servers expose the local directory to callers without an account, while others require credentials.

If the administrator disables room-list search, the handler returns before decoding tokens. Check this setting when assessing risk. Requiring a login narrows access but leaves the faulty decoder in place for callers who pass that check.

Affected and fixed versions

Check both packages when assessing an installation:

  • MessagePack: upstream lists msgpack < 1.2.3 as affected and 1.2.3 as the first patched version.
  • Synapse: 1.164.1 is the first stable release containing this dependency update. Its lockfile selects MessagePack 1.2.4. The checked 1.163.2 and 1.164.0 lockfiles select 1.2.1.

The sources do not list every past Synapse release that used this code, so older deployments with vulnerable MessagePack need review. A library update or a repair backported by the package provider can change a server’s status.

The fix remains in Synapse 1.164.2 and 1.165.0rc1, whose lockfiles also select 1.2.4. As checked on November 4, 2026, 1.164.2 is the latest stable release. The release candidate is not necessary for this fix.

What administrators should do

Use your existing package or container workflow to upgrade Synapse to a current stable release with the fix. Read its upgrade instructions and keep a backup you can restore. Restart or replace the affected processes so they load the new library.

Check MessagePack in the environment that runs Synapse. 1.164.1’s package metadata still allows msgpack>=0.5.2. Because installers that resolve dependencies without this lockfile may keep an older library, upgrading Synapse alone does not prove that they replaced it.

When you use workers, check each image or environment that handles these requests. Running the check in your own shell may inspect a different Python environment from the one the service uses.

This read-only command is an untested example for administrators. Run it with Synapse’s Python interpreter, inside its virtual environment or container:

Shell · read-only version check
python -m pip show matrix-synapse msgpack

Check the reported versions and installation locations. A distributor may backport the repair under an older version number, so consult its security notice. Loopback’s package-management comparison explains why update tooling differs between systems.

Review process memory, unexpected restarts, out-of-memory events and errors from directory requests. Look for changes that occur together, but do not assume that memory growth proves an attack using this flaw. Keep timestamps and logs to compare before and after the upgrade.

Was Matrix.org breached?

The reviewed advisory, Synapse release notes and Matrix.org update do not report confirmed real-world exploitation of this issue. They do not identify stolen messages, compromised keys or a Matrix.org breach caused by it. The reported denial-of-service impact concerns access to the server. It does not show that the flaw breaks Matrix encryption.

Sources