Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/dunglas/mercure
  4. ›
  5. GHSA-hwr4-mq23-wcv5

GHSA-hwr4-mq23-wcv5: mercure has Topic Selector Cache Key Collision

April 8, 2026

A cache key collision vulnerability in TopicSelectorStore allows an attacker to poison the match result cache, potentially causing private updates to be delivered to unauthorized subscribers or blocking delivery to authorized ones.

The cache key was constructed by concatenating the topic selector and topic with an underscore separator:

k = "m_" + topicSelector + "_" + topic

Because both topic selectors and topics can contain underscores, two distinct pairs can produce the same key:

selector="foo_bar"  topic="baz"     → key: "m_foo_bar_baz"
selector="foo"      topic="bar_baz" → key: "m_foo_bar_baz"

An attacker who can subscribe to the hub or publish updates with crafted topic names can exploit this to bypass authorization checks on private updates.

References

  • github.com/advisories/GHSA-hwr4-mq23-wcv5
  • github.com/dunglas/mercure
  • github.com/dunglas/mercure/commit/4964a69be904fd61e35b5f1e691271663b6fdd64
  • github.com/dunglas/mercure/releases/tag/v0.22.0
  • github.com/dunglas/mercure/security/advisories/GHSA-hwr4-mq23-wcv5

Code Behaviors & Features

Detect and mitigate GHSA-hwr4-mq23-wcv5 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.22.0

Fixed versions

  • 0.22.0

Solution

Upgrade to version 0.22.0 or above.

Impact 7.1 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-1289: Improper Validation of Unsafe Equivalence in Input

Source file

go/github.com/dunglas/mercure/GHSA-hwr4-mq23-wcv5.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 12:20:27 +0000.