Advisory Database
  • Advisories
  • Dependency Scanning
  1. nuget
  2. ›
  3. LiteDB
  4. ›
  5. CVE-2022-23535

CVE-2022-23535: LiteDB may deserialize bad JSON on object type using _type

February 24, 2023 (updated November 9, 2023)

LiteDB is a small, fast and lightweight .NET NoSQL embedded database. Versions prior to 5.0.13 are subject to Deserialization of Untrusted Data. LiteDB uses a special field in JSON documents to cast different types from BsonDocument to POCO classes. When instances of an object are not the same of class, BsonMapper use a special field _type string info with full class name with assembly to be loaded and fit into your model. If your end-user can send to your app a plain JSON string, deserialization can load an unsafe object to fit into your model. This issue is patched in version 5.0.13 with some basic fixes to avoid this, but is not 100% guaranteed when using Object type. The next major version will contain an allow-list to select what kind of Assembly can be loaded. Workarounds are detailed in the vendor advisory.

References

  • github.com/advisories/GHSA-3x49-g6rc-c284
  • github.com/mbdavid/LiteDB/commit/4382ff4dd0dd8b8b16a4e37dfd29727c5f70f93f
  • github.com/mbdavid/LiteDB/commit/d72c6774e6a13de2cfcd7d477d3575efeb75c8f2
  • github.com/mbdavid/LiteDB/releases/tag/v5.0.13
  • github.com/mbdavid/LiteDB/security/advisories/GHSA-3x49-g6rc-c284

Code Behaviors & Features

Detect and mitigate CVE-2022-23535 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 5.0.13

Fixed versions

  • 5.0.13

Solution

Upgrade to version 5.0.13 or above.

Impact 9.8 CRITICAL

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

Learn more about CVSS

Weakness

  • CWE-502: Deserialization of Untrusted Data

Source file

nuget/LiteDB/CVE-2022-23535.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:59 +0000.