Skip to content

Add advisories for mykey (cleartext TGK, unverified message MAC) - #3341

Open
waxspin wants to merge 2 commits into
rustsec:mainfrom
waxspin:mykey-advisories
Open

waxspin wants to merge 2 commits into
rustsec:mainfrom
waxspin:mykey-advisories

Conversation

@waxspin

@waxspin waxspin commented Oct 9, 2026

Copy link
Copy Markdown

Two advisories for mykey, a MIKEY (RFC 3830) implementation used for SRTP key exchange. Both affect all published versions up to and including 1.0.0 and are fixed in 2.0.0, which is already on crates.io.

Filed by the crate author, so per CONTRIBUTING the upstream-report and coordinated-disclosure prerequisites are satisfied. Both have published GitHub Security Advisories, linked via aliases.

File GHSA Severity Summary
RUSTSEC-0000-0000.md GHSA-fwjg-cm92-j3hj Critical (9.1) PSK mode transmitted the TGK in cleartext
RUSTSEC-0000-0000.1.md GHSA-xq78-wvcv-hqvj High (7.5) Message MAC never verified on receive

The cleartext TGK (critical)

MikeyMessage::new_psk_init built its KEMAC with EncAlg::Null and placed the TEK Generation Key in enc_data verbatim. Anyone able to read a PSK-Init message therefore recovered the TGK — and so the SRTP master key — without knowing the pre-shared key.

The transmitted value was never even used: the receiver re-derived the TGK from the pre-shared key and ignored enc_data. The field was write-only.

MIKEY messages are normally distributed as an SDP a=key-mgmt:mikey attribute, which in AES67 / ST 2110 deployments is typically announced over SAP multicast — so a passive listener recovers the session key with no active attack. RFC 3830 §4.2.3 permits NULL encryption only where "the underlying protocols can guarantee security".

The unverified MAC (high)

No receive path called verify_mac. The sender computed and appended an HMAC-SHA-1-160, so a tag was present and looked like integrity protection, but a receiver accepted any message regardless of whether the MAC was correct, wrong, or absent. Note this does not require a MITM position — since nothing is checked, a wholly forged PSK-Init is accepted, hence AC:L.

Fixes in 2.0.0

PSK mode now follows RFC 3830 §3.1 as key transport: a random TGK framed as a §6.13 Key data sub-payload and encrypted with AES-CM per §4.2.3, under keys derived from the pre-shared key per §4.1.4. The MAC is keyed from the pre-shared key and verified before anything is decrypted.

Notes for reviewers

  • There is no unaffected earlier release, so patched = [">= 2.0.0"] with no unaffected range.
  • Two drafts in one directory use the RUSTSEC-0000-0000.1.md suffix. I verified rustsec-admin assign-id handles this — it assigns two sequential IDs and renames both files, updating each id field.
  • rustsec-admin lint passes, built from the revision pinned by this repo's install-rustsec-admin action (note that older released versions of rustsec-admin reject the .1 filename).
  • CVE requests are open with GitHub as CNA; the aliases entries should let the nightly OSV sync attach the CVE IDs once issued.
  • Happy to split this into two PRs if that is preferred for ID assignment.

mykey is a MIKEY (RFC 3830) implementation for SRTP key exchange. Two
vulnerabilities affecting all published versions up to and including 1.0.0,
both fixed in 2.0.0, filed by the crate author:

- Pre-shared key mode transmitted the TGK in the clear in the KEMAC payload,
  so anyone able to read a PSK-Init message recovered the SRTP master key
  without knowing the pre-shared key (GHSA-fwjg-cm92-j3hj).
- No receive path verified the MIKEY message MAC, so forged or modified
  messages were accepted (GHSA-xq78-wvcv-hqvj).

Each advisory carries its published GitHub Security Advisory in `aliases`, so
the nightly OSV sync can attach CVE identifiers once GitHub issues them.

Verified with `rustsec-admin lint` built from the revision pinned by this
repository's install-rustsec-admin action.
Comment thread crates/mykey/RUSTSEC-0000-0000.1.md Outdated
id = "RUSTSEC-0000-0000"
package = "mykey"
date = "2026-10-09"
url = "https://github.com/waxspin/mykey/security/advisories/GHSA-xq78-wvcv-hqvj"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use an issue, PR or commit in the url, aliases already links to the GHSA.

Comment thread crates/mykey/RUSTSEC-0000-0000.1.md Outdated
(cleartext TGK), which already let a passive observer recover the key material
outright without needing to forge anything.

## Affected versions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't repeat metadata in the contents.

Comment thread crates/mykey/RUSTSEC-0000-0000.md Outdated
guarantee security", and warns to use it with caution. An SDP file or a SAP
announcement is not such a channel.

## Affected versions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, too.

Comment thread crates/mykey/RUSTSEC-0000-0000.md Outdated
id = "RUSTSEC-0000-0000"
package = "mykey"
date = "2026-10-09"
url = "https://github.com/waxspin/mykey/security/advisories/GHSA-fwjg-cm92-j3hj"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

- `url` now points at the pull request that fixed both issues
  (waxspin/mykey#25) instead of the GitHub advisory, which `aliases`
  already links.

- Removed the "Affected versions" and "Patched versions" sections, which
  restated the `[versions]` table and the absence of an `unaffected` range.
  The technical description of what changed is kept under "The fix", and the
  "Workarounds" sections no longer open by restating the patched version.

- Dropped the "in versions up to and including 1.0.0" phrasing from the
  opening paragraphs for the same reason — the version range is metadata.
@waxspin

waxspin commented Oct 9, 2026

Copy link
Copy Markdown
Author

Both addressed in a5c60e4.

  • url now points at waxspin/mykey#25, the PR that fixed both issues.
  • Dropped the ## Affected versions and ## Patched versions sections, the "up to and including 1.0.0" phrasing, and the "Upgrade to 2.0.0" line opening each ## Workarounds.

rustsec-admin lint passes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants