Intel

AIKIDO-2026-387567

cryptoki is vulnerable to Out-of-bounds Read

Out-of-bounds ReadGHSA-r6vc-97x9-63vv Published 3 days ago

51

Medium Risk

This Affects:

RUSTcryptoki
0.1.0 - 0.10.0
Fixed in 0.10.1
0.11.0 - 0.11.0
Fixed in 0.11.1
0.12.0 - 0.12.0
Fixed in 0.12.1
Are you affected? Scan for Free

TL;DR

Affected versions of cryptoki treat the PKCS #11 CKA_ALLOWED_MECHANISMS ulValueLen byte count as a CK_MECHANISM_TYPE element count. Reading a valid nonempty attribute through the safe Session::get_attributes API can therefore construct an out-of-bounds slice and trigger undefined behavior. That can crash the process or cause a denial of service, and may disclose adjacent heap words through decoded mechanism values. The fix interprets the length as a byte count when decoding the attribute. cryptoki-sys is not affected.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and request AttributeType::AllowedMechanisms through Session::get_attributes. Exploitability depends on who can influence the PKCS #11 provider or object response.

Background info

cryptoki is vulnerable to Out-of-bounds Read in versions 0.12.0 - 0.12.0, 0.11.0 - 0.11.0 and 0.1.0 - 0.10.0.

How to fix this

Upgrade the cryptoki library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform