# CVE-2024-40640: Usage of non-constant time base64 decoder could lead to leakage of secret key material in vodozemac

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** LOW 2.9
- **CVSS:** 2.9 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-208
- **Aliases:** GHSA-j8cm-g7r6-hfpq, RUSTSEC-2024-0354
- **Published:** 2024-07-17T12:00:00.000Z
- **Modified:** 2026-10-12T18:00:07.418Z

## Who should check

- Projects that depend on crates.io package vodozemac (\< 0.7.0)
- Anyone running matrix-org vodozemac \< 0.7.0

## Description

vodozemac is an open source implementation of Olm and Megolm in pure Rust.  Versions before 0.7.0 of vodozemac use a non-constant time base64 implementation for importing key material for Megolm group sessions and \`PkDecryption\` Ed25519 secret keys. This flaw might allow an attacker to infer some information about the secret key material through a side-channel attack. The use of a non-constant time base64 implementation might allow an attacker to observe timing variations in the encoding and decoding operations of the secret key material. This could potentially provide insights into the underlying secret key material. The impact of this vulnerability is considered low because exploiting the attacker is required to have access to high precision timing measurements, as well as repeated access to the base64 encoding or decoding processes.  Additionally, the estimated leakage amount is bounded and low according to the referenced paper. This has been patched in commit 734b6c6948d4b2bdee3dd8b4efa591d93a61d272 which has been included in release version 0.7.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.

## Affected and fixed versions

- crates.io `vodozemac`: affected \< 0.7.0; fixed 0.7.0 (osv)
- matrix-org vodozemac: \< 0.7.0 (cvelist)

## Mitigation

- Upgrade vodozemac to 0.7.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-40640. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-40640.md
Affected: vodozemac < 0.7.0
Fixed in: 0.7.0

Steps:
1. Search this machine and project for vodozemac (crates.io), matrix-org vodozemac: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-40640 being exploited?

There is no confirmed exploitation: CVE-2024-40640 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-40640?

Low: CVSS 2.9 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2024-40640?

vodozemac \< 0.7.0.

### Is there a fix for CVE-2024-40640?

Yes. Fixed in 0.7.0. Upgrade vodozemac to 0.7.0 or later.

### How do I check if I'm affected by CVE-2024-40640?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/matrix-org/vodozemac/security/advisories/GHSA-j8cm-g7r6-hfpq>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2024-40640>
- vendor: <https://rustsec.org/advisories/RUSTSEC-2024-0354.html>
- patch: <https://github.com/matrix-org/vodozemac/commit/734b6c6948d4b2bdee3dd8b4efa591d93a61d272>
- patch: <https://github.com/matrix-org/vodozemac/commit/77765dace11266ef9523301624a01265c6e0f790>
- other: <https://arxiv.org/abs/2108.04600>
- other: <https://github.com/matrix-org/vodozemac>
- other: <https://crates.io/crates/vodozemac>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-40640>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-j8cm-g7r6-hfpq> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/RUSTSEC-2024-0354> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-40640> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-40640>
