CVE-2022-23535 is a high-severity (CVSS 7.3) Deserialization of Untrusted Data vulnerability in LiteDB. A fix is available for LiteDB — see the affected versions and patch details below.
LiteDB contains Deserialization of Untrusted Data
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-23535.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
LiteDBReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects NuGet packages — download data is not available via public APIs for these ecosystems.
Description
Impact
LiteDB use a special field in JSON documents to cast diferent types from BsonDocument do POCO classes. When instance 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 in your model.
If your end-user can send to your app a plain JSON string, deserialization can load an unsafe object to fit in your model.
Patches
Version >= 5.0.13 add some basic fixes to avoid this, but is not 100% guaranteed when using Object type
Next major version will contains a allow-list to select what king of Assembly can be loaded
Workarounds
- Avoid users send to your app a JSON string to be direct insert/update into database
- Avoid use classes with
Objecttype - try use an interface when possible
If your app send a plain JSON string to be insert/update into database, prefer this:
// Bad
public class Customer {
public int Id { get; set; }
public string Name { get; set; }
public Object AnyData { get; set; } // <= Avoid use `Object` base type
}
// Good
public class Customer {
public int Id { get; set; }
public string Name { get; set; }
public IDictionary<string, string> AnyData { get; set; } // Will accept only key/value strings
}
References
See this workaround fix on this commit:
https://github.com/mbdavid/LiteDB/commit/4382ff4dd0dd8b8b16a4e37dfd29727c5f70f93f
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| .NETNuGet | LiteDB | all versions | 5.0.13dotnet add package LiteDB --version 5.0.13 |
Affected Products
litedblitedbDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for LiteDB, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update LiteDB to 5.0.13 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-23535 is resolved across your whole dependency graph.
Workarounds
Do not deserialise data from untrusted sources: where the format allows it, restrict deserialisation to an explicit allowlist of expected types, and prefer a data-only format (JSON, Protobuf) over one that can reconstruct arbitrary objects until you can upgrade.
Frequently Asked Questions
Is CVE-2022-23535 in your dependencies?
Find it across NuGet, including transitive dependencies.