Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-104199 — Proof-of-concept and lab for CVE-2026-104199: a malformed aMQTT '+' wildcard filter triggers catastrophic regex backtracking, freezing the broker. Includes differential 0.11.3 vs 0.11.4 testing. | Kitploit
Tools/GitHubGitHub/googlesky/cve-2026-104199
IoT SecurityVulnerability AnalysisExploitationNetwork SecurityPapers & ResearchLabs & Practice
GitHubgooglesky/cve-2026-104199

CVE-2026-104199

Proof-of-concept and lab for CVE-2026-104199: a malformed aMQTT '+' wildcard filter triggers catastrophic regex backtracking, freezing the broker. Includes differential 0.11.3 vs 0.11.4 testing.

View Repository
3 days agoNot yet reviewed
Share

CVE-2026-104199 — aMQTT: malformed wildcard topic filter triggers catastrophic regex backtracking and freezes the broker

License: MIT Research status: validated

CVECVE-2026-104199
ComponentaMQTT — amqtt/broker.py (add_subscription validation, _matches)
Affected0.11.0 through 0.11.3
Fixed in0.11.4 — commit e48a8a6 (GHSA-2hjf-7455-w946)
CWECWE-1333 (Inefficient Regular Expression Complexity), CWE-400 (Uncontrolled Resource Consumption), CWE-20 (Improper Input Validation)
ImpactA single anonymous client sends one crafted SUBSCRIBE and one PUBLISH; catastrophic backtracking in the topic matcher holds the GIL inside the broker's broadcast loop and freezes the entire process — no CONNACK, no delivery, no keepalive — until restart
VectorNetwork — MQTT SUBSCRIBE + PUBLISH, anonymous under the default configuration
TriggerSUBSCRIBE "+/" + "+"*60, then PUBLISH "/" + "a"*18 + "/"

The vulnerable matcher built a regular expression from the subscription filter, turning every + into a greedy [^/]* fragment:

# v0.11.3, broker.py _matches()
self._topic_filter_matchers[a_filter] = re.compile(
    re.escape(a_filter).replace("\\#", "?.*").replace("\\+", "[^/]*").lstrip("?"))
return bool(match_pattern.fullmatch(topic))

The fix validates each level and matches deterministically in O(n):

# v0.11.4 (commit e48a8a6) — per-level validation rejects malformed '+'/'#'
# and _matches() walks '/'-delimited levels instead of using a regex.

1. Root cause

Two defects chain into a single-packet broker freeze:

  1. Weak wildcard validation. add_subscription() checked the single-level wildcard + with substring tests ("/+" in filter, "+/" in filter) instead of requiring every /-delimited level that contains + to be exactly +. The malformed filter "+/" + "+"*60 contains both substrings, so it was accepted (SUBACK 0x00) rather than rejected with 0x80 as MQTT-4.7.1-3 requires.
  2. Backtracking matcher. _matches() replaced each + with the greedy fragment [^/]*. Sixty adjacent + characters become sixty adjacent [^/]* groups with no separator between them. Matching a topic that partially matches but ultimately fails (e.g. "/" + "a"*18 + "/") forces the engine to explore exponentially many ways to partition the characters among the groups. re.fullmatch() runs in C while holding the GIL, so the catastrophic backtracking blocks the asyncio event loop — and every other thread — freezing the whole broker until the process is restarted.

The fix validates filters one level at a time (any level containing + must be exactly +; # must be a whole, final level) and replaces the regex with a deterministic level-by-level walk.

2. Reproduction environment

serviceimagerole
amqtt2-vulncve-2026-104199:vulnreal amqtt 0.11.3 broker (PyPI)
amqtt2-fixedcve-2026-104199:fixedreal amqtt 0.11.4 broker (vendor fix)
poccve-2026-104199-poc:localstdlib-only Python driver

Both run the real amqtt.broker.Broker with the default configuration (TCP 0.0.0.0:1883, anonymous allowed). A thin supervisor exposes /info and /stats on :8080. Both sides differ only in the amqtt version. Because the vulnerable broker stays frozen after the attack, the driver restarts the target container before each mode.

3. Running the environment

./run-lab.sh build     # installs amqtt 0.11.3 / 0.11.4 from PyPI
./run-lab.sh up        # cve104199lab network: amqtt2-vuln / amqtt2-fixed
./run-lab.sh sweep     # restarts each target before every mode
./run-lab.sh down

4. The PoC

poc/poc.py (stdlib only, raw MQTT 3.1.1 packets). One connection sends the crafted SUBSCRIBE and PUBLISH; responsiveness is then probed with a fresh CONNECT (a frozen broker completes the TCP handshake from the kernel backlog but never sends CONNACK):

  • check — exit 1 when the filter is accepted (SUBACK 0x00) and the broker freezes, 0 when rejected (0x80) and responsive; 3 no worker, 2 unreachable/indeterminate.
  • exploit — narrated stages with the SUBACK code and the freeze.
  • probe — filter matrix: malformed +/+++..., valid sport/+, valid # (valid wildcards must still be granted on the fixed build).
  • mitigation — 0.11.4 / commit e48a8a6, plus the interim topic-filtering plugin workaround.

A standalone full-chain exploit ships at exploit/exploit.py:

python3 exploit/exploit.py --host=amqtt2-vuln
# exit 1 on confirmed broker freeze, 0 on a safe target

5. Expected results

observationamqtt2-vuln (0.11.3)amqtt2-fixed (0.11.4)
SUBSCRIBE malformed filterSUBACK 0x00 (accepted)SUBACK 0x80 (rejected)
broker after one PUBLISHfrozen — no CONNACKresponsive
valid sport/+ / #grantedgranted (0x00), responsive

Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt, evidence/probe-*-run.txt, evidence/mitigation-*-run.txt, evidence/exploit-standalone-run.txt, evidence/exploit-standalone-fixed-run.txt, evidence/versions.txt, evidence/0day-sweep.txt.

6. Environment preconditions

  • Podman (or Docker); bounded containers on the isolated cve104199lab network.
  • Anonymous access (the default configuration) is sufficient; with authentication enabled, any client permitted to create arbitrary subscriptions and publish may trigger the freeze.

7. Additional findings (0-day sweep on the fixed line)

The fixed line rejects the malformed + filter at subscription time (0x80) and matches topics with a deterministic O(n) level walk, so no backtracking regex remains. Valid wildcard filters (sport/+, #) are still granted and match normally — no functional regression and no ReDoS path.

8. Repository layout

README.md             this write-up
run-lab.sh            environment driver (build / up / sweep / down)
Makefile              convenience targets
poc/poc.py            the PoC (check / exploit / probe / mitigation)
exploit/exploit.py    standalone full-chain exploit
lab/lab.Dockerfile    installs both upstream PyPI releases
lab/service.py        real Broker + /info, /stats supervisor
evidence/             captured runs of every mode on both sides
TRACKING.md           excluded (working record)

9. References

  • CVE record — https://www.cve.org/CVERecord?id=CVE-2026-104199
  • GitHub advisory — https://github.com/Yakifo/amqtt/security/advisories/GHSA-2hjf-7455-w946
  • Fix commit — https://github.com/Yakifo/amqtt/commit/e48a8a65027667f936d415db7f01d3ac350104e0
  • Fixed release — https://github.com/Yakifo/amqtt/releases/tag/v0.11.4
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    901
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    861
  • 3

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    668
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    448
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    414
  • 6

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    401

Explore all tools

Browse our collection of tools

View all tools →