# RUSTSEC-2026-0335: Pre-shared key mode transmits the TGK in cleartext, exposing the SRTP master key

> Passive network listeners can recover SRTP master keys from cleartext MIKEY messages, compromising media session confidentiality and integrity.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Oct 2026
- **Also known as:** GHSA-fwjg-cm92-j3hj

## What is RUSTSEC-2026-0335?

RUSTSEC-2026-0335 is a vulnerability in mykey, published on 9 Oct 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

`mykey` implements MIKEY (RFC 3830) for SRTP key exchange. Pre-shared key mode
transmitted the TEK Generation Key (TGK) in the clear.

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

The transmitted value was never even used by the receiver: `complete_psk`
re-derived the TGK from the pre-shared key and ignored `enc_data` entirely. The
field was write-only; it provided nothing and disclosed everything.

A second consequence: the message authentication key was derived from the TGK
rather than from the pre-shared key, so an attacker who read the TGK off the wire
could also forge a valid message MAC. Integrity was lost along with
confidentiality. That aspect is tracked separately as GHSA-xq78-wvcv-hqvj.

## Exploitability

A MIKEY message is normally distributed as an SDP `a=key-mgmt:mikey` attribute,
which in AES67 and SMPTE ST 2110 deployments is typically announced over SAP
multicast. A passive listener on the media network recovers the session key with
no active attack and no credentials.

RFC 3830 §4.2.3 permits NULL encryption only where "the underlying protocols can
guarantee security", and warns to use it with caution. An SDP file or a SAP
announcement is not such a channel.

## The fix

Pre-shared key mode now follows RFC 3830 §3.1 as key *transport*: the initiator
generates a random TGK, frames it as a Key data sub-payload (§6.13), and encrypts
it with AES-CM (§4.2.3) under an encryption key and 112-bit salt derived from the
pre-shared key (§4.1.4). The message MAC is keyed from the pre-shared key and
verified before anything is decrypted.

This changes the wire format, so both ends of an exchange must be upgraded
together. The incompatibility is silent: an old peer and a new peer complete the
exchange without error and then derive different SRTP keys.

## Workarounds

Use ephemeral Diffie-Hellman mode instead of pre-shared key mode, or carry the
PSK-Init only over a channel that is already confidential and authenticated end
to end.

## Which versions are affected by RUSTSEC-2026-0335?

1 open source package ship an affected version, including mykey.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mykey` | crates.io | From 0.0.0-0 | 2.0.0 |

## How do I fix RUSTSEC-2026-0335?

Upgrade mykey to 2.0.0 or later.

## Is RUSTSEC-2026-0335 being exploited?

There is no known exploitation of RUSTSEC-2026-0335 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for RUSTSEC-2026-0335 and fix it if it is affected.

What it is: RUSTSEC-2026-0335 is a vulnerability in mykey, published on 9 Oct 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of RUSTSEC-2026-0335 in the wild and no public exploit code.

Affected packages and fixed versions:
- mykey (crates.io): affected from 0.0.0-0; fixed in 2.0.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/RUSTSEC-2026-0335/ (Markdown: https://insights.sbomify.com/RUSTSEC-2026-0335/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/RUSTSEC-2026-0335

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