Closed hdocsek closed 2 weeks ago
Thank you for reporting this issue. We appreciate your detailed description and code to reproduce the problem.
Given the current backlog of work and the focus on addressing existing pull requests, we won't be able to prioritize this issue immediately. However, if this issue is critical for your project, we encourage you to investigate and implement a fix yourself. You can then submit a pull request for review.
We appreciate your understanding and contributions to the project. If you choose to work on a fix, please ensure it includes thorough testing to verify compatibility with databases created using earlier versions.
We have the same issue for our use of LiteDB - older releases are on LiteDB v4, and would need to upgrade to LiteDB v5 due to the published security issue. However, the upgrade bug from v5.0.18 onwards means we can't use the library.
Based on my investigation, I believe this issue is an incompatibility with the v4 format with a password and the AesStream class. Essentially, any time a v4 file is opened, it has to use the Stream class instead of AesStream. I'll test my workaround for this with your sample and if it works, I'll put it up for review and we can iterate over that.
Version
Describe the bug
4.1.4
using versions higher than5.0.17
(i.e.5.0.18
to5.0.20
) fails with a LiteException:File is not encrypted
Code to Reproduce
4.1.4
or try to open the attached version 4 database in MyDataV4.zip using version5.0.20
. Password ispass123
.ConsoleApp1.csproj
Program.cs
Expected behavior The database should be upgraded to the new format without exception.
Screenshots/Stacktrace The exception thrown is: