keepassium / KeePassium

KeePass-compatible password manager for iOS
https://keepassium.com
Other
1.21k stars 103 forks source link

Insufficient memory to proceed when opening Argon2 database #261

Closed OculiViridi closed 2 years ago

OculiViridi commented 2 years ago

Description

When selecting suggested entry from iOS autofill on a website form, instead of autofilling the field, KeePassium opened the app, asked which database to select and once selected the correct database, the following error appears (copied from app's log file):

0.024 (I) DatabaseLoader.swift:269 loadInBackgroundQueue() Will load database [location: Cloud storage / other app, fileProvider: com.microsoft.skydrive.onedrivefileprovider] 0.086 (I) DatabaseLoader.swift:210 initDatabase(signature:) DB signature: KDBX 0.086 (I) DatabaseLoader.swift:344 onDatabaseDocumentReadComplete(data:fileURL:fileProvider:) Using a ready composite key 0.086 (I) DatabaseLoader.swift:445 onCompositeKeyComponentsProcessed(dbFile:compositeKey:) Loading database 0.086 (I) Database2.swift:201 load(dbFileName:dbFileData:compositeKey:warnings:) Loading KDBX database 0.086 (I) DataCipherFactory.swift:28 createFor(uuid:) Creating ChaCha20 cipher 0.086 (D) KDFParams.swift:24 read(data:) Parsing KDF params 0.086 (I) KDFFactory.swift:56 createFor(uuid:) Creating Argon2id KDF 0.086 (D) Database2.swift:208 load(dbFileName:dbFileData:compositeKey:warnings:) Header read OK [format: v4.1] 0.086 (D) Database2.swift:690 deriveMasterKey(compositeKey:cipher:canUseFinalKey:) Start key derivation 0.086 (D) Database2.swift:217 load(dbFileName:dbFileData:compositeKey:warnings:) Key derivation OK 0.086 (D) Database2.swift:347 decryptBlocksV4(data:cipher:) Decrypting V4 blocks 0.093 (E) Database2.swift:370 decryptBlocksV4(data:cipher:) Header HMAC mismatch. Invalid master key? 0.093 (D) Database2.swift:161 erase() DB memory cleaned up 0.093 (E) DatabaseLoader.swift:477 onCompositeKeyComponentsProcessed(dbFile:compositeKey:) Invalid master key. [message: Invalid password or keyfile] 0.093 (D) Database2.swift:161 erase() DB memory cleaned up 0.093 (D) Database2.swift:161 erase() DB memory cleaned up 0.101 (I) DatabaseUnlockerCoordinator.swift:490 databaseLoader(:didFailLoading:with:) Express unlock failed, retrying slow 0.124 (I) DatabaseLoader.swift:269 loadInBackgroundQueue() Will load database [location: Cloud storage / other app, fileProvider: com.microsoft.skydrive.onedrivefileprovider] 0.178 (I) DatabaseLoader.swift:210 initDatabase(signature:) DB signature: KDBX 0.179 (I) DatabaseLoader.swift:344 onDatabaseDocumentReadComplete(data:fileURL:fileProvider:) Using a ready composite key 0.179 (I) DatabaseLoader.swift:445 onCompositeKeyComponentsProcessed(dbFile:compositeKey:) Loading database 0.179 (I) Database2.swift:201 load(dbFileName:dbFileData:compositeKey:warnings:) Loading KDBX database 0.179 (I) DataCipherFactory.swift:28 createFor(uuid:) Creating ChaCha20 cipher 0.179 (D) KDFParams.swift:24 read(data:) Parsing KDF params 0.179 (I) KDFFactory.swift:56 createFor(uuid:) Creating Argon2id KDF 0.179 (D) Database2.swift:208 load(dbFileName:dbFileData:compositeKey:warnings:) Header read OK [format: v4.1] 0.179 (D) Database2.swift:690 deriveMasterKey(compositeKey:cipher:canUseFinalKey:) Start key derivation 0.240 (E) AutoFillCoordinator.swift:80 handleMemoryWarning() Received a memory warning 0.242 (D) Database2.swift:161 erase() DB memory cleaned up 0.242 (I) DatabaseLoader.swift:487 onCompositeKeyComponentsProcessed(dbFile:compositeKey:) Database loading was cancelled. [reason: Insufficient memory to proceed. This can happen with large databases or with overly ambitious database settings (memory parameter Argon2).] 0.242 (D) Database2.swift:161 erase() DB memory cleaned up 0.242 (D) Database2.swift:161 erase() DB memory cleaned up 0.251 (E) DatabaseUnlockerVC.swift:164 showErrorMessage(_:reason:haptics:action:) Insufficient memory to proceed. This can happen with large databases or with overly ambitious database settings (memory parameter Argon2).

Additional information

The database is KeePass v4 format using ChaCha20 encryption and a key file v2 (.keyx file). The key transformation settings are:

The average opening time on PC is less than 0,5 seconds. The database is stored on OneDrive.

How to reproduce

Steps to reproduce the behavior:

  1. Open a webform and on a user/password field
  2. Tap on the auto suggested value taken from KeePassium.

Environment

keepassium commented 2 years ago

This can happen with large databases or with overly ambitious database settings (memory parameter Argon2).

Argon2id 64 MB

https://keepassium.com/articles/autofill-memory-limits/