Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🦀 crates.io
Not in CISA KEV

GHSA-w3vw-ccc5-qr8v tss-esapi

GHSA-w3vw-ccc5-qr8v is a security vulnerability in tss-esapi. A fix is available for tss-esapi — see the affected versions and patch details below.

Use After Free in Context::start_auth_session

Published
Jun 17, 2022
Updated
Jun 17, 2022
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Jun 17, 2022 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

2 pkgs affected
🦀tss-esapi🦀tss-esapi

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.

Description

Impact

This issue only applies to applications starting authorization sessions using an explicit initial nonce.

When Context::start_auth_session was called with a nonce argument value of Some(...), the nonce pointer passed down through FFI to Esys_StartAuthSession would be a dangling pointer, left over from a defunct instance of TPM2B_NONCE. This could lead to an incorrect value being used as a nonce, though whether that value is controllable is unclear (so should be assumed as possible). The error became apparent due to changes in v1.61.0 of the Rust compiler.

Logs indicating a failure due to this issue (with the 1.61.0 version of the Rust toolchain) look as follows:

2022-05-24T01:04:41.9131341Z WARNING:esys:src/tss2-esys/api/Esys_StartAuthSession.c:390:Esys_StartAuthSession_Finish() Received TPM Error 
2022-05-24T01:04:41.9132192Z ERROR:esys:src/tss2-esys/api/Esys_StartAuthSession.c:136:Esys_StartAuthSession() Esys Finish ErrorCode (0x000001d5) 
2022-05-24T01:04:41.9145124Z [2022-05-24T01:04:41Z ERROR tss_esapi::context::tpm_commands::session_commands] Error when creating a session: structure is the wrong size (associated with parameter number 1)
2022-05-24T01:04:41.9153816Z thread 'main' panicked at 'Call to start_auth_session failed: Tss2Error(FormatOne(FormatOneResponseCode { .0: 469, error_number: 21, parameter: true, format_selector: true, number: 1 }))', tss-esapi/tests/integration_tests/context_tests/tpm_commands/enhanced_authorization_ea_commands_tests.rs:870:14

Patches

The issue has been patched in versions 6 and 7 of the tss-esapi crate. Please update to 7.1.0 or 6.1.2.

Workarounds

There is no workaround that achieves the same functionality.

References

For more information on the cause of the issue and the fix, see this PR.

For more details about the TPM2_StartAuthSession command see section 11.1 of the TPM spec, part 3, and section 19.6.3 of part 1 of the same spec for more information regarding session nonces.

For more information

If you have any questions or comments about this advisory:

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
🦀crates.iotss-esapi7.0.0&&< 7.1.07.1.0cargo update -p tss-esapi --precise 7.1.0
🦀crates.iotss-esapiall versions6.1.2cargo update -p tss-esapi --precise 6.1.2

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for tss-esapi, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update tss-esapi to 7.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-w3vw-ccc5-qr8v is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-w3vw-ccc5-qr8v can be triaged on real exposure rather than presence alone.

Tailored to GHSA-w3vw-ccc5-qr8v. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Impact **This issue only applies to applications starting authorization sessions using an explicit initial `nonce`.** When [`Context::start_auth_session`](https://docs.rs/tss-esapi/7.0.1/tss_esapi/struct.Context.html#method.start_auth_session) was called with a `nonce` argument value of `Some(...)`, the nonce pointer passed down through FFI to `Esys_StartAuthSession` would be a dangling pointer, left over from a defunct instance of `TPM2B_NONCE`. This could lead to an incorrect value being used as a nonce, though whether that value is controllable is unclear (so should be assumed as poss
O3 Security · Impact-Aware SCA

Is GHSA-w3vw-ccc5-qr8v in your dependencies?

O3 Security finds GHSA-w3vw-ccc5-qr8v across crates.io dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-w3vw-ccc5-qr8v: tss-esapi | O3 Security