You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FUZZER/LOW] aes256cbc in legacy mode writes a journal_mode=WAL database that fails to reopen with its own key, after a single VACUUM #279
This is one of a handful of bugs identified via fuzzing, as described in #277 and as requested there I am opening them as issues. This one I would also label as low priority.
A brand-new, schema-less database keyed with aes256cbc, legacy=1, switched to journal_mode=WAL, and then VACUUMed once, closes without error, but cannot be reopened with the identical passphrase. Every statement on the second connection fails SQLITE_NOTADB, including sqlite_dbpage reads of page 1 itself.
It is similar to #278 as it shares a similar symptom but reproduce through different mechanisms. #278 needs aes128cbc under the default rollback journal, with a specific nine-VACUUM, two-table sequence. This one needs aes256cbc under journal_mode=WAL, reproducing with a single bare VACUUM and no CREATE TABLE at all. Mixing up their configurations to try and find common denominators does not reproduce any error at all.
This is one of a handful of bugs identified via fuzzing, as described in #277 and as requested there I am opening them as issues. This one I would also label as low priority.
The reason for the failure is exactly the same as described for issue #278. It's the curse of the legacy mode.
BTW, I doubt that any database file encrypted with aes128cbc or aes256cbc in legacy mode is practically in existence anymore nowadays. Back then when this format was replaced by the non-legacy mode there was no way to select the legacy mode other than using an older version of wxSQLite3. - The use of the cipher schemes aes128cbc and aes256cbc is strongly discouraged for new applications, not to mention legacy mode.
A brand-new, schema-less database keyed with aes256cbc, legacy=1, switched to journal_mode=WAL, and then VACUUMed once, closes without error, but cannot be reopened with the identical passphrase. Every statement on the second connection fails SQLITE_NOTADB, including sqlite_dbpage reads of page 1 itself.
As I see it the issue is not related to WAL journal mode. It could happen in all configurations. This time SQLite identifies a valid page size of 64 kB (because the bytes in the database file denote the value x0001 (= 64 KB)), but in reality the page size is 4 kB.
As already said in my response in #278 the cipher schemes sqlcipher and chacha20 in legacy mode are also affected by this curse.
Unfortunately, there is absolutely nothing that can be done to solve the issue, except for not using legacy mode.
Activity
utelle commentedon Oct 3, 2026
The reason for the failure is exactly the same as described for issue #278. It's the curse of the legacy mode.
BTW, I doubt that any database file encrypted with
aes128cbcoraes256cbcin legacy mode is practically in existence anymore nowadays. Back then when this format was replaced by the non-legacy mode there was no way to select the legacy mode other than using an older version of wxSQLite3. - The use of the cipher schemesaes128cbcandaes256cbcis strongly discouraged for new applications, not to mention legacy mode.As I see it the issue is not related to WAL journal mode. It could happen in all configurations. This time SQLite identifies a valid page size of 64 kB (because the bytes in the database file denote the value
x0001(= 64 KB)), but in reality the page size is 4 kB.As already said in my response in #278 the cipher schemes
sqlcipherandchacha20in legacy mode are also affected by this curse.Unfortunately, there is absolutely nothing that can be done to solve the issue, except for not using legacy mode.