{"id":"CVE-2022-23535","aliases":["CVE-2022-23535","GHSA-3x49-g6rc-c284"],"related":[],"kind":"vulnerability","state":"published","title":"LiteDB contains Deserialization of Untrusted Data","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nLiteDB 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.\nIf your end-user can send to your app a plain JSON string, deserialization can load an unsafe  object to fit in your model.\n\n### Patches\nVersion >= 5.0.13 add some basic fixes to avoid this, but is not 100% guaranteed when using `Object` type\nNext major version will contains a allow-list to select what king of Assembly can be loaded\n\n### Workarounds\n- Avoid users send to your app a JSON string to be direct insert/update into database\n- Avoid use classes with `Object` type - try use an interface when possible\n\nIf your app send a plain JSON string to be insert/update into database, prefer this:\n```\n// Bad\npublic class Customer {\n    public int Id { get; set; }\n    public string Name { get; set; }\n    public Object AnyData { get; set; } // <= Avoid use `Object` base type\n}\n\n// Good\npublic class Customer {\n    public int Id { get; set; }\n    public string Name { get; set; }\n    public IDictionary<string, string> AnyData { get; set; } // Will accept only key/value strings\n}\n\n```\n\n### References\nSee this workaround fix on this commit:\n\nhttps://github.com/mbdavid/LiteDB/commit/4382ff4dd0dd8b8b16a4e37dfd29727c5f70f93f","format":"markdown","source":"ghsa"},{"lang":"es","text":"LiteDB es una base de datos integrada .NET NoSQL pequeña, rápida y liviana. Las versiones anteriores a la 5.0.13 están sujetas a la deserialización de datos que no son de confianza. LiteDB utiliza un campo especial en documentos JSON para convertir diferentes tipos, desde `BsonDocument` a clases POCO. Cuando las instancias de un objeto no son las mismas que las de una clase, `BsonMapper` usa un campo especial `_type` con información de cadena con el nombre completo de la clase con el ensamblaje que se cargará y se ajustará a su modelo. Si su usuario final puede enviar a su aplicación una cadena JSON simple, la deserialización puede cargar un objeto inseguro para que quepa en su modelo. Este problema se solucionó en la versión 5.0.13 con algunas correcciones básicas para evitarlo, pero no está 100% garantizado cuando se usa el tipo \"Objeto\". La próxima versión principal contendrá una lista de permitidos para seleccionar qué tipo de ensamblaje se puede cargar. Los workarounds se detallan en el aviso para proveedores.","source":"nvd"}],"published":"2023-02-24T16:22:50.000Z","modified":"2026-06-17T04:30:18.633Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-502"],"affected":[{"ranges":[{"version":"< 5.0.13","status":"affected"}],"vendor":"mbdavid","product":"LiteDB","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.0.13"}],"ecosystem":"NuGet","package":"LiteDB","purl":"pkg:nuget/LiteDB","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"5.0.13"}],"vendor":"litedb","product":"litedb","cpe":"cpe:2.3:a:litedb:litedb:*:*:*:*:*:.net:*:*","source":"nvd"}],"references":[{"url":"https://github.com/mbdavid/LiteDB/security/advisories/GHSA-3x49-g6rc-c284","tags":["mitigation","patch","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mbdavid/LiteDB/commit/4382ff4dd0dd8b8b16a4e37dfd29727c5f70f93f","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23535","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/mbdavid/LiteDB/commit/d72c6774e6a13de2cfcd7d477d3575efeb75c8f2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/mbdavid/LiteDB","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/mbdavid/LiteDB/releases/tag/v5.0.13","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2025-03-10T20:58:20.417Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-23535","url":"https://www.cve.org/CVERecord?id=CVE-2022-23535","licence":"CVE Terms of Use","modified":"2025-03-10T21:06:16.611Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3x49-g6rc-c284","url":"https://github.com/advisories/GHSA-3x49-g6rc-c284","licence":"CC-BY-4.0","modified":"2023-11-08T04:08:21.233Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-23535","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-23535","licence":"Public domain","modified":"2026-06-17T04:30:18.633Z"}],"updatedAt":"2026-11-25T22:58:18.743Z","epss":{"score":0.00699,"percentile":0.54385,"date":"2026-12-01T12:00:22.000Z"}}