# CVE-2025-12790: Rubygem-mqtt: rubygem-mqtt hostname validation

> The Ruby MQTT library lacked hostname validation by default, allowing attackers to perform Man-in-the-Middle attacks against MQTT connections.

- **Severity:** High 7.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Nov 2025
- **Updated:** 26 Feb 2026
- **Also known as:** GHSA-9c5q-w6gr-fxcq

## What is CVE-2025-12790?

CVE-2025-12790 is a high-severity vulnerability in Nicholas J Humfrey Red Hat Satellite 6, published on 6 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A flaw was found in Rubygem MQTT. By default, the package used to not have hostname validation, resulting in possible Man-in-the-Middle (MITM) attack.

Weakness: CWE-29 (Path Traversal: '\..\filename')

## Which versions are affected by CVE-2025-12790?

2 open source packages ship an affected version, including mqtt.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mqtt` | RubyGems | All versions | 0.7.0 |
| `mqtt` | RubyGems | All versions | 0.7.0 |

## How do I fix CVE-2025-12790?

Upgrade mqtt to 0.7.0 or later.

## Is CVE-2025-12790 being exploited?

There is no known exploitation of CVE-2025-12790 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-12790 and fix it if it is affected.

What it is: CVE-2025-12790 is a high-severity vulnerability in Nicholas J Humfrey Red Hat Satellite 6, published on 6 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-12790 in the wild and no public exploit code.

Affected packages and fixed versions:
- mqtt (RubyGems): affected all versions; fixed in 0.7.0
- mqtt (RubyGems): affected all versions; fixed in 0.7.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-12790/ (Markdown: https://insights.sbomify.com/CVE-2025-12790/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-12790
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-12790
- OSV: https://osv.dev/vulnerability/CVE-2025-12790

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-12790/
Summaries are generated and may contain mistakes; the official description above is the record.
