Loading...
Skip to main content

CVE-2023-45814 — Bunkum tokens cached in Bunkum — CVE Details

MEDIUM

Bunkum tokens cached in the AuthenticationService are susceptible to a use-after-free

Published October 19, 2023Updated February 16, 2024Source: osv

Summary

### Impact First, a little bit of background. So, in the beginning, Bunkum's `AuthenticationService` only supported injecting `IUser`s. However, as Refresh and SoundShapesServer implemented permissions systems support for injecting `IToken`s into endpoints was added. All was well until 4.0. Bunkum 4.0 then changed to enforce relations between `IToken`s and `IUser`s. This wasn't implemented in a very good way in the `AuthenticationService`, and ended up breaking caching in such a way that cached tokens would persist after the lifetime of the request - since we tried to cache both tokens and users. From that point until now, from what I understand, Bunkum was attempting to use that cached token at the start of the next request once cached. Naturally, when that token expired, downstream projects like Refresh would remove the object from Realm - and cause the object in the cache to be in a detached state, causing an exception from invalid use of `IToken.User`. So in other words, a use-after-free since Realm can't manage the lifetime of the cached token. Security-wise, the scope is fairly limited, can only be pulled off on a couple endpoints given a few conditions, and you can't guarantee which token you're going to get. Also, the token *would* get invalidated properly if the endpoint had either a `IToken` usage or a `IUser` usage. User interaction is required as authenticated requests must be performed. ### Patches The fix is to just wipe the token cache after the request was handled, which is now in `4.2.1`. I'd recommend that you update. Unfortunately, there are no real workarounds for other versions in the 4.X.X range.

Advisory Timeline

  • First published October 19, 2023 (1089 days ago).
  • Last revised February 16, 2024 — 120 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

NuGet
Update Bunkum to 4.2.1 or later
dotnet add package Bunkum --version 4.2.1

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: nuget (1).

PackageEcosystemAffectedFixed In
Bunkum
nuget
4.0.0, 4.0.1, 4.1.0, 4.2.04.2.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Frequently Asked Questions

What is CVE-2023-45814?
Bunkum tokens cached in the AuthenticationService are susceptible to a use-after-free This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.3/10).
How do I check if my project is affected by CVE-2023-45814?
CVE-2023-45814 affects Bunkum. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2023-45814 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
5.3

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-jrf2-h5j6-3rrq

Related CVEs

  • CVE-2026-106111
    MEDIUM

    ImageSharp: EXR ZIP decoder can expose stale allocator data after a short inflate

  • CVE-2026-65829
    MEDIUM

    MPXJ: Potential Path Traversal Vulnerability in Primavera P3 PRX and SureTrak STX readers

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies