CVE-2026-104199amqtt >= 0.11.0, Improper Input Validation
NVD
Vulnerability Summary
### Impact
`amqtt` is vulnerable to a remote denial of service caused by improper MQTT topic-filter validation combined with catastrophic regular-expression backtracking.
A single client can freeze the entire broker by sending one specially crafted `SUBSCRIBE` packet followed by one `PUBLISH` packet.
The vulnerability is caused by two defects:
1. `add_subscription()` validates the placement of the single-level wildcard `+` using substring checks for `/+` and `+/`, rather than verifying that each `/`-delimited level containing `+` is exactly `+`. This allows malformed filters such as `"+/" + "+" * 60` to be accepted instead of rejected with return code `0x80`, as required by MQTT-4.7.1-3.
2. `_matches()` converts every `+` character into the greedy regular-expression fragment `[^/]*` and evaluates the resulting expression with `re.fullmatch()`. A filter containing many adjacent `+` characters can cause catastrophic backtracking when matched against a topic that partially matches but ultimately fails.
Topic matching runs synchronously inside the broker’s global broadcast loop. When the malicious match is evaluated, it blocks the asyncio event loop and prevents the broker from processing any other work.
The issue was reproduced using a single raw MQTT 3.1.1 TCP connection with no third-party client dependencies.
Successful exploitation causes:
- Existing message delivery to stop
- New MQTT connections to receive no `CONNACK`
- Keepalive processing to stop
- Broadcast processing to stop
- The broker to remain unavailable until the process is restarted
Under the default configuration, anonymous clients can exploit the vulnerability without credentials. When authentication is enabled, any authenticated client permitted to create arbitrary subscriptions and publish messages may still exploit it. Authentication alone is therefore not a sufficient mitigation.
- Ecosystem: `pip`
- Package: `amqtt`
- Affected versions: `>= 0.11.0, <= 0.11.3`
The vulnerable code is present in the `v0.11.0` release commit, `352678c87e50e501a8a5bb91fab73c9400fa046c`, and remained present on the main branch as of `eeb1e254da9a1e8d9cc68ae754fcedac652e8fc0`. Versions before 0.11.0 were not evaluated.
This is a denial-of-service vulnerability only. `re.escape()` prevents arbitrary regular-expression injection, and there is no known path to remote code execution.
No confidentiality or integrity impact has been identified. Successful exploitation causes a complete loss of availability for the affected broker process.
### Patches
The issue has been patched in the `v0.11.4` released version; all users should upgrade.
The completed fix:
- Validate topic filters one level at a time
- Require any level containing `+` to be exactly `+`
- As part of comprehensive MQTT topic-filter validation, require `#` to occupy an entire level and appear only as the final level
- Replace the regular-expression matcher with deterministic, level-by-level MQTT topic matching
Simply changing the validation logic is not sufficient defense in depth if malformed filters can reach the existing regular-expression matcher through another code path.
### Workarounds
This is the temporary mitigation that was recommended prior to the patched release: administrators can install a topic-filtering plugin that rejects malformed wildcard subscriptions before they are added to the broker. Place the plugin in an importable Python module, enable it in the broker configuration, and restart the broker.
```python
from amqtt.contexts import Action
from amqtt.plugins.base import BaseTopicPlugin
from amqtt.session import Session
class RejectInvalidTopicFilters(BaseTopicPlugin):
"""A plugin to prevent invalid wildcard subscriptions."""
async def topic_filtering(
self, *, session: Session | None = None,
topic: str | None = None,
action: Action | None = None
) -> bool | None:
if topic and action == Action.SUBSCRIBE:
levels = topic.split("/")
return all(
level in {"+", "#"} or ("+" not in level and "#" not in level)
for level in levels
) and "#" not in levels[:-1]
return True
config = {
...
'plugins':{
...
'myplugins.RejectInvalidTopicFilters': {}
}
}
```
This workaround applies when subscription requests pass through the plugin. If the broker is configured to use a persistent session plugin, restarting the broker alone is not sufficient; any persisted sessions containing malformed topic filters need to be removed.
Restarting the broker restores availability after exploitation, but the broker remains vulnerable until the patch or workaround is installed.
### Acknowledgments
aMQTT thanks the following security researchers for their professional, coordinated private disclosure:
* **Yongkang Xiao** (Wuhan University)
* **Min Shi** (Wuhan University)
* **Qiyi Deng** (Wuhan University)
* **Jing Chen** (Wuhan University)
`amqtt` is vulnerable to a remote denial of service caused by improper MQTT topic-filter validation combined with catastrophic regular-expression backtracking.
A single client can freeze the entire broker by sending one specially crafted `SUBSCRIBE` packet followed by one `PUBLISH` packet.
The vulnerability is caused by two defects:
1. `add_subscription()` validates the placement of the single-level wildcard `+` using substring checks for `/+` and `+/`, rather than verifying that each `/`-delimited level containing `+` is exactly `+`. This allows malformed filters such as `"+/" + "+" * 60` to be accepted instead of rejected with return code `0x80`, as required by MQTT-4.7.1-3.
2. `_matches()` converts every `+` character into the greedy regular-expression fragment `[^/]*` and evaluates the resulting expression with `re.fullmatch()`. A filter containing many adjacent `+` characters can cause catastrophic backtracking when matched against a topic that partially matches but ultimately fails.
Topic matching runs synchronously inside the broker’s global broadcast loop. When the malicious match is evaluated, it blocks the asyncio event loop and prevents the broker from processing any other work.
The issue was reproduced using a single raw MQTT 3.1.1 TCP connection with no third-party client dependencies.
Successful exploitation causes:
- Existing message delivery to stop
- New MQTT connections to receive no `CONNACK`
- Keepalive processing to stop
- Broadcast processing to stop
- The broker to remain unavailable until the process is restarted
Under the default configuration, anonymous clients can exploit the vulnerability without credentials. When authentication is enabled, any authenticated client permitted to create arbitrary subscriptions and publish messages may still exploit it. Authentication alone is therefore not a sufficient mitigation.
- Ecosystem: `pip`
- Package: `amqtt`
- Affected versions: `>= 0.11.0, <= 0.11.3`
The vulnerable code is present in the `v0.11.0` release commit, `352678c87e50e501a8a5bb91fab73c9400fa046c`, and remained present on the main branch as of `eeb1e254da9a1e8d9cc68ae754fcedac652e8fc0`. Versions before 0.11.0 were not evaluated.
This is a denial-of-service vulnerability only. `re.escape()` prevents arbitrary regular-expression injection, and there is no known path to remote code execution.
No confidentiality or integrity impact has been identified. Successful exploitation causes a complete loss of availability for the affected broker process.
### Patches
The issue has been patched in the `v0.11.4` released version; all users should upgrade.
The completed fix:
- Validate topic filters one level at a time
- Require any level containing `+` to be exactly `+`
- As part of comprehensive MQTT topic-filter validation, require `#` to occupy an entire level and appear only as the final level
- Replace the regular-expression matcher with deterministic, level-by-level MQTT topic matching
Simply changing the validation logic is not sufficient defense in depth if malformed filters can reach the existing regular-expression matcher through another code path.
### Workarounds
This is the temporary mitigation that was recommended prior to the patched release: administrators can install a topic-filtering plugin that rejects malformed wildcard subscriptions before they are added to the broker. Place the plugin in an importable Python module, enable it in the broker configuration, and restart the broker.
```python
from amqtt.contexts import Action
from amqtt.plugins.base import BaseTopicPlugin
from amqtt.session import Session
class RejectInvalidTopicFilters(BaseTopicPlugin):
"""A plugin to prevent invalid wildcard subscriptions."""
async def topic_filtering(
self, *, session: Session | None = None,
topic: str | None = None,
action: Action | None = None
) -> bool | None:
if topic and action == Action.SUBSCRIBE:
levels = topic.split("/")
return all(
level in {"+", "#"} or ("+" not in level and "#" not in level)
for level in levels
) and "#" not in levels[:-1]
return True
config = {
...
'plugins':{
...
'myplugins.RejectInvalidTopicFilters': {}
}
}
```
This workaround applies when subscription requests pass through the plugin. If the broker is configured to use a persistent session plugin, restarting the broker alone is not sufficient; any persisted sessions containing malformed topic filters need to be removed.
Restarting the broker restores availability after exploitation, but the broker remains vulnerable until the patch or workaround is installed.
### Acknowledgments
aMQTT thanks the following security researchers for their professional, coordinated private disclosure:
* **Yongkang Xiao** (Wuhan University)
* **Min Shi** (Wuhan University)
* **Qiyi Deng** (Wuhan University)
* **Jing Chen** (Wuhan University)
CVSS v4.0 Base Metrics — Score 8.7
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XAttack VectorNetwork
Attack ComplexityLow
Attack RequirementsNone
Privileges RequiredNone
User InteractionNone
Confidentiality (Vulnerable System)None
Integrity (Vulnerable System)None
Availability (Vulnerable System)High
Confidentiality (Subsequent System)None
Integrity (Subsequent System)None
Availability (Subsequent System)None
Affected & Patched Versions
- amqtt >= 0.11.0, <= 0.11.3
No patched version published yet
Until a fix ships, reduce exposure:
- Restrict access to the affected service or interface to trusted networks.
- Disable the affected feature if you do not need it.
- Watch the vendor advisory for a firmware or software update.
What to do
Plan remediation soon. No exploitation is confirmed yet, but the severity is high.
- Check whether you run amqtt >= 0.11.0, and which version.
- No patched version is listed yet. Limit access to the affected service to trusted networks, and disable the feature if you can.
- Subscribe to the vendor advisory so you learn when a fix ships.
Timeline
- Nov 19, 2026Published
- Nov 20, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new amqtt >= 0.11.0, CVEsYou are reading CVE-2026-104199. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
- Vendor Advisoryhttps://github.com/Yakifo/amqtt/security/advisories/GHSA-2hjf-7455-w946
- CVE Recordhttps://nvd.nist.gov/vuln/detail/CVE-2026-104199
- Patchhttps://github.com/Yakifo/amqtt/pull/361
- Patchhttps://github.com/Yakifo/amqtt/commit/e48a8a65027667f936d415db7f01d3ac350104e0
- Referencehttps://github.com/Yakifo/amqtt/releases/tag/v0.11.4
- Referencehttps://github.com/advisories/GHSA-2hjf-7455-w946
Data last checked: Nov 20, 2026 17:00 UTC