← Blog

· 10 min read #rust#mqtt#iot#unikernel#security#open source

urMQTT 0.6.0: the production features, and an internal security review that found 31 problems we then fixed

Release 0.6.0 adds IPv6, Prometheus metrics, A/B updates with rollback, run-time accounts, a per-address connection limit, multiqueue, an IOMMU, Secure Boot for installed disks and a disk key that is not in the image. Before the tag we ran an internal, AI-assisted security review: 48 candidates, 31 fixed, three of them high severity. What the review is, what it is not, and what it cannot tell you.

The short version. Release v0.6.0 is the release that tries to close the distance between "an MQTT broker that is fast" and "an MQTT broker you could run in production": it adds the operating features that were missing (IPv6, Prometheus metrics, A/B updates with automatic rollback, password accounts you can add and remove at run time, a limit on connections per source address) and the security features we had listed as open debt (DMA remapping through an IOMMU, Secure Boot for installed disks, a disk key that is not inside the image). Before tagging it we ran an internal security review of the whole thing. It found 48 candidates, 31 of which are fixed with a regression test, including three of high severity, and left 8 low-severity findings open, whose details we withhold until they are fixed.

And the paragraph that has to stand next to it. That review is not an independent audit. The same AI-assisted process that wrote the code also reviewed and fixed it. It has no accreditation, no certificate and no liability behind it, it never touched real hardware, and it did not look at everything. It is a pre-audit package: the thing you hand to an external firm so that they start from a map instead of from zero. It does not make urMQTT safe to run on the open internet; it makes the next, independent review cheaper and better aimed. urMQTT is still alpha. If you run v0.5.0 or older, update: we tested only v0.6.0 as it stood before the fixes, but the code behind the three high findings is older than this release.

What is in 0.6.0

Every item has an ADR (a short decision record in the repository), tests, a fuzz target where it parses bytes from the network, and a QEMU scenario where it is visible on the wire. Nothing of this release ran on a VPS or on physical hardware; we say so again at the end.

For operating it.

  • A/B updates with automatic rollback. A new install gets two boot slots. urmqtt-disk slots stages an update from a signed release into the inactive slot, the new kernel confirms itself after it has come up and served, and if it does not, the machine goes back to the previous slot. A power cut at each step of the update was tested. The honest limits: disks installed before 0.6.0 stay single-slot (making room would mean moving the data), and a kernel that dies before its own block driver runs is not counted as a failed trial, so it can loop until someone rolls back offline.
  • Password accounts at run time. An operator adds, changes and removes accounts for the plain and WebSocket listeners over the signed control channel, with no new image. The broker only ever receives a PBKDF2 hash. It is off by default and needs a store migration (schema 5 to 6, one way: a v0.5 kernel will refuse the migrated database, so take a backup first).
  • Prometheus metrics. The kernel serves the text format on its own port (9100), default off, behind a required allow-list. It has no TLS and no authentication of its own: the allow-list is the only control, and the documentation says so.
  • A limit on established TLS connections per source address, 1024 by default. This one is on without you asking, so read the upgrade notes: a site with more than 1024 devices behind one NAT address must raise it before updating.
  • IPv6, with SLAAC or static addresses, on every listener. Off unless configured. Not done: UDP over IPv6 (so SNTP, syslog and statsd stay on IPv4), fragment reassembly, ICMPv6 errors, DHCPv6. It was tested against QEMU's router, not on a real /64.
  • virtio-net multiqueue with receive-side scaling, negotiated automatically when the device offers it. Tested under QEMU only; we have measured no throughput gain yet and the roadmap entry says so.
  • The first outbound connection the broker makes, with TLS 1.3 log shipping as its only user for now. IPv4 literal destinations, no client certificate, delivery at most once.
  • Encrypted project files on the builder page, so a configuration with keys in it can be kept in the browser or on disk behind a passphrase.
  • The kernel as a library, so another repository can build its own image from these crates. That is the groundwork for editions beyond virtio.

For the security boundary.

  • An IOMMU (VT-d, AMD-Vi and SMMUv3): a device gets only the buffers the kernel mapped for it, and faults are counted. Off by default, and only ever run on QEMU's models.
  • Secure Boot for installed disks: sealed images, sign-iso, revocation through dbx. Not done: a firmware version counter, shim, signing a project key into releases, and any run on real firmware.
  • A disk key that is not in the image: a passphrase typed at the console. The price is that the broker stays down after every reboot until somebody types it.

The review

We call it internal because that is what it is. The method, in the order it ran:

  1. Nine lenses. Each was a separate pass over one part of the system with its own questions: supply chain and release signing, TLS and cryptography, authentication and authorisation, the broker's protocol logic, the boot chain and update tools, unsafe code and device handling, storage and disk keys, network denial of service, and the parsers of untrusted bytes.
  2. Proof per finding. A candidate counted only with a reproduction: a failing test, a crashing input, a precise code path.
  3. Three skeptics per finding. Independent agents, each with a different angle (can an attacker reach it, does it reproduce from a clean checkout, how bad is it really) and each told to refute the finding by default.
  4. A fix with a regression test. Each fix has a test that fails on v0.6.0 and passes after it, ran through the full CI, and was merged.
  5. Fuzzing alongside. All 42 committed fuzz targets ran 300 seconds each. Nothing crashed that was not already one of the findings.
Candidates found and findings fixed, per lens, in the internal security review of urMQTT v0.6.0.
Candidates found and findings fixed, per lens, in the internal security review of urMQTT v0.6.0.

The totals: 48 candidates, 38 confirmed, 31 fixed (30 distinct flaws: one was reported by two lenses). By severity the fixed ones are 3 high, 11 medium and 17 low. The 10 candidates that were not confirmed are information-level observations: hardening ideas, a documentation mismatch, a fuzzing gap, a reproducibility note. Eight low-severity findings are open; their details stay private until each is fixed, following the project's vulnerability handling.

The three high ones

All three are fixed in 0.6.0. We reproduced them on v0.6.0 as it was before the fixes; the code involved is older, so assume earlier releases are affected too.

  • A TLS handshake leak. The server kept a table of handshake secrets, one slot per client, and an abandoned handshake never gave its slot back. After 4,096 abandoned handshakes, new handshakes started evicting each other until the next reboot. The table is gone; each session now owns and wipes its own secrets on every exit path. Handshake cost did not change.
  • A certificate that could carry another identity. The broker took the first common name of one string type from a client certificate, while our certificate-signing script checked the first common name of any type. A certificate could therefore be issued for one name and be read as another. The broker now refuses a subject with more than one common name, or one of a different string type, as having no identity at all, and the signing tool refuses such requests.
  • A connection that never closed. A TLS handshake refused under a zero receive window left a connection that was never freed; enough of them filled the heap and every new connection was refused. There is now a 5-second close deadline after which the connection is dropped, its counts released and a reset sent. In the test, 2,000 such handshakes produce 2,000 resets and every connection is freed; the unfixed kernel sent none.

The medium findings included a revocation that did not apply to a handshake already in flight, a peer that never reads being able to grow the broker's own output buffer without bound, filters that were never freed after subscribe churn, and an MSI-X table offset that was not checked against its BAR. The full list, with the regression test of each, is in the report.

A pattern is visible in the highs and mediums, and it is the one you would expect in a young, self-written network stack: resource exhaustion, and identity handled in two places that disagree. That is where an external auditor should spend time.

What the review cannot tell you

The report ends with a prioritised list of what an external audit should look at first. The short form:

  • Hardware. No bare metal, no real NIC, IOMMU, TPM or Secure Boot chain. The boundaries with the highest impact, DMA and boot trust, depend on behaviour an emulator models only partly.
  • Repository and site settings. The release-key protection we added in this review (the signing key now lives in a separate protected job and environment) is only as good as the live settings of the repository, which no offline review can see.
  • Third-party cryptography. The primitives, rustls and webpki were assumed correct, and 53 of the 67 kernel-linked crate versions are covered by supply-chain exemptions, not audits.
  • The unsafe core, 937 sites with written justifications, read but not proved.
  • The review's own filter. No skeptic ever refuted a candidate. That can mean the findings were solid. It can also mean the skeptics were not hard enough. Treat it as a reason for caution, and ask for the skeptic notes and the full candidate list when you hire a reviewer.

Upgrading

The details are in the changelog under "Upgrading from v0.5.0". The things that bite:

  • The store migrates from schema 5 to 6 on the first boot and cannot go back. Take a backup of the data disk first.
  • Configuration formats now go up to 23. A configuration that sets none of the new keys still packs into the old template; one that sets a new key is refused by an old template, with a message that says which format it needs.
  • The 1024 connections per address default, as above.
  • Existing disks stay single-slot; A/B needs a disk installed by 0.6.0 or later.

The release is signed with the same release key as 0.4.2 and 0.5.0, and its pipeline changed as a result of the review: the build runs with no secret, a separate protected job signs, and a signed older release can no longer be offered under a newer tag.

We have not run any of this on a rented VPS or on physical hardware, and the x86_64 smoke tests are not in CI yet. Next on the list is a run on the two VPSes of the earlier comparison, to see what a real hypervisor says, and then an independent reviewer. urMQTT is alpha, and this text measures one review of one release; it does not measure maturity.

Comments

Comment rules

Comment rules

Comments are here to share experience and questions about the topics of the blog. These rules keep the discussion useful for everyone.

  1. Be civil No insults, threats, harassment, hate speech or discrimination on any grounds. Criticise the argument, not the person.
  2. Stay on topic A comment should relate to the post or to the discussion under it.
  3. No ads or spam No advertising, chain messages or links without context. Links and images are welcome when they add to the discussion.
  4. Others' privacy Do not post other people's personal data: full names of private individuals, addresses, phone numbers, emails, photos without consent.
  5. Copyright Post only content you are allowed to share. When quoting, name the source.
  6. One identity Use one nickname and do not pose as someone else.
  7. Email confirmation A comment is published only after you confirm the link sent by email. The address is not shown and not used for anything else; unconfirmed comments are deleted after 48 hours.
  8. Moderation Comments that break the rules are hidden or deleted without notice, and a discussion may be locked. Moderators' decisions are final.
  9. Responsibility The author is responsible for the content of a comment. Comments do not reflect the views of ALDO TECH.
  10. Reporting Report inappropriate content to info@aldo.tech.