Commit Graph
3680 Commits
Author SHA1 Message Date
varjolintu a13a1d7582 Fix returning sortPriority with empty priority list 2026-10-26 14:19:40 +02:00
Janek Bevendorff 09e34ba86c Ensure Qt's TLS plugins are deployed on macOS
For whatever reason, macdeployqt does not deploy the TLS plugins on its own. We need to find them manually.

Fixes #13855
2026-10-24 01:13:43 +02:00
Janek Bevendorff a6ba28f8b2 Reformat code with clang-format-20 2026-10-23 15:44:56 +02:00
Janek Bevendorff d5e43b779d Update GitHub sponsors 2026-10-21 14:28:07 +02:00
egglessness e0e3b844e9 Add support for configuration overrides via GPOs in Windows
This is a Windows only feature that uses policies set in the registry to control settings in KeePassXC. Overrides are set in HKLM\Software\Policies\KeePassXC and uses the same structure as the ini settings file. Overridden settings are disabled in the user interface and their values are not written to the user's own settings file.
2026-10-21 00:03:57 -04:00
Christian 9b4632a8da Restore wl-copy clipboard clearing on Wayland
Fixes #13809
2026-10-20 17:49:51 +02:00
Jonathan White 6c686af438 Improve cross-compiling ARM64 on Windows
* Fix using the specified QT_HOST_PATH for executables
* Fix setting the Visual Studio environment for cross-compiling
2026-10-20 11:06:53 +02:00
underclockeddev 0ae1b94093 Do not query the X root window without a display
Under QT_QPA_PLATFORM=offscreen the X11 native interface exists but has no
display, and DefaultRootWindow() dereferenced the null pointer at startup.
The global shortcut code already checks for a null display.
2026-10-18 16:24:31 +02:00
underclockeddevandClaude Opus 5.5 596ae49d60 Clear m_attemptingLock when a lock's autosave triggers a reload
DatabaseWidget::lock() returned early when its autosave failed and a reload
began, without clearing m_attemptingLock. Every later lock() then returned at
the m_attemptingLock check, so the database could not be locked again until
KeePassXC was restarted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 16:13:58 +02:00
Toni Spets d608efc1b8 Fix portal availability checks racing with D-Bus service activation
QDBusAbstractInterface::isValid() can latch an empty service owner
cached while xdg-desktop-portal is still activating, permanently
disabling auto-type and the global shortcut. Use the interfaces'
version() property reads instead: real blocking calls that trigger
activation if needed and return 0 only on failure.
2026-10-18 14:37:32 +02:00
varjolintu b05b0dd2e8 Use selected database when creaeting a new group when creating a passkey 2026-10-17 06:06:37 -04:00
Jonathan White b5523be1a1 Additional fixes for macOS and modern Qt6
* Replace Q_OS_MAC with Q_OS_MACOS
* Remove deleted macro QTEST_DISABLE_KEYPAD_NAVIGATION
2026-10-15 14:18:47 -04:00
Jonathan White 50738ec006 Fix warnings with COMPAT signal after Qt6 upgrade
* Fixes a specific warning that spams the console due to a deprecated signal that was used to indicate checkboxes state changed.
* Converted all QCheckBox::stateChanged(int) to QCheckBox::toggled(bool). All functionality still works as intended.
2026-10-15 14:18:47 -04:00
ryain11andJanek Bevendorff 21bdc8248f Fixed a Secret Service Integration connection dereferencing a nullptr in some cases (#13655)
* Fix Secret Service message being null in some cases when unlocking a database

* Update changelog

---------

Co-authored-by: Janek Bevendorff <[email protected]>
2026-09-22 21:46:56 +02:00
varjolintu 80e68bb4e8 Fix out-of-bounds writing to browser messages 2026-09-22 21:46:36 +02:00
varjolintu dfdd561fc5 Passkeys: Fix parsing punycode domains 2026-09-21 22:26:59 -04:00
Janek Bevendorff a69ff5b9ec Update About credits 2026-09-20 21:46:58 -04:00
2b58033398 Add native Windows Arm64 support on Qt-vcpkg builds (#13678)
* Add minimal native Windows Arm64 support

Extend the Qt-via-vcpkg work from #13473 with only the source changes required for Windows Arm64 triplet selection, deployqt resolution, ordered runtime dependency deployment, and architecture-correct MSI metadata.

Co-authored-by: Janek Bevendorff <[email protected]>
Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Gordon Lam (SH) (from Dev Box) <[email protected]>
Co-authored-by: Janek Bevendorff <[email protected]>
Co-authored-by: Copilot <[email protected]>
2026-09-20 23:59:34 +02:00
ryain11 f2003b4087 Fix password font size not changing
* Move font size application to showEvent instead of constructor to enable dynamic font size application if changed in app settings.
2026-09-20 20:40:18 +02:00
SimonandCopilot Autofix powered by AI 126f508e6a Add list storing key of all custom attributes in database
Add completer when adding/renaming custom attribute

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-09-19 19:26:55 -04:00
Sami Vänttinen 474da9b877 Fix identifying nested reference placeholders (#13688) 2026-09-19 19:26:29 -04:00
Jonathan White 5ac1b0c98d Center browser dialog on active screen 2026-09-16 18:04:55 -04:00
Janek Bevendorff e053e1d147 Make Pageant shared memory handle name unpredictable 2026-09-16 13:27:34 -04:00
Janek Bevendorff 5d7f371b74 Fixes potential quint32 wrap in KDB 1 importer.
parseGroupTreeState() retrieves the number of record tree states from a 32-bit integer. It then calculates the number of bytes to read as num * 5, which is checked against the actual buffer length. The multiplication occurs as quint32, which wraps at 2^32. An attacker could craft a 32-bit value that wraps to match the observed buffer length. The following loop, however, uses num directly and may thus loop millions of times, reading beyond the end of the buffer.

No bytes are written and the minimum number that wraps is 2^32 / 5, which is well beyond any reasonable buffer size. Hence this is exploitable only as a denial of service. Given that this requires a crafted KDB file, there are easier ways to make the contents of a file unreadable.
2026-09-16 06:03:15 -04:00
Toni Spets 84658ade9a Always call BindShorcuts for new sessions
Previously KDE Plasma implicitly bound them on session start but this
behavior was recently changed so it is now always required to bind them
which is correct according to spec. Our workaround was only needed for
fairly old KDE releases.

Because depending on the version and type of the desktop portal the
behavior might be all over the place we will always list the shortcuts
first as they might be active on session start and calling BindShortcuts
might fail and not give us the list back making our UI stale.

Docs have been updated to indicate version support for both KDE and
GNOME.
2026-09-15 18:22:27 +02:00
Janek Bevendorff 55c54986d6 Add AI scanner notice about _EXEC_CMD not being a security flag 2026-09-15 18:10:14 +02:00
Janek Bevendorff 2094ac5261 Use C++ allocation in zlib (#13677)
* Use C++ allocation in zlib

Marginally reduces the chances of decrypted database fragments remaining in memory.

Addresses CVE-2024-33901, but does not fix the main issue. For a proper solution, we need to replace QXmlStreamReader with something else.

* Fix Linux build always falling back to std::free() branch due to undefined HAVE_MALLOC_USABLE_SIZE
2026-09-15 11:23:12 -04:00
Abdelrahman Saeed Elhassan 61d562b379 Fix search + prefix modifier ignoring case sensitivity
The search parser now passes the CASE_SENSITIVE flag to the term
when the '+' prefix modifier is used, so searches like '+p:test1'
correctly perform case-sensitive matching.

Fixes #13000

[skip ci]
2026-09-14 19:46:56 -04:00
Brais Couce 089cf9a916 Add the number of passkeys and TOTP entries to the statistics of the database report (#13632) 2026-09-14 19:44:49 -04:00
AetfandClaude Fable 5 8e6fe3ffd6 FdoSecrets: keep AccessControlDialog safe across database lock
The item access confirmation dialog used to hold raw Entry pointers in
its model, its deny buttons, and its result signal. When the database
locks or closes while the dialog is open, DatabaseWidget replaces the
Database and destroys every Entry, while the dialog stays up: painting
the model, or answering the dialog, then dereferenced freed entries
(crash in UnlockPrompt::itemUnlockFinished via Entry::uuid, see the
backtrace in #9104).

Make the dialog self-contained: snapshot each entry's uuid and display
data (title, username, icon) at construction and report decisions as a
QHash<QUuid, AuthDecision>, so the dialog never touches an Entry again
after it is shown.

On the UnlockPrompt side, restore the invariant that a non-null item
reference implies a usable backend: track items with QPointer and clear
all references as soon as an item retires (Item::itemAboutToDelete),
mirroring how collection retirement is handled. A decision for an item
that has retired counts as rejected, so the prompt completes as
dismissed instead of reporting success for nothing.

Finally, match the browser behavior: the dialog now withdraws itself
(rejects) when a collection it is asking about locks or goes away,
instead of keeping a stale question on screen.

Fixes #9104

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AqHu6RpvLpaoH2aUGSYQzR
2026-09-14 19:44:08 -04:00
Janek Bevendorff 84f5e58c29 Add -DWITH_BUILD_QT CMake option and --build-qt release-tool flags to build Qt6 via vcpkg instead of using binaries from the system
Also advance vcpkg baseline to pull in Qt 6.11 and to fix compilation
with macOS SDK 26.
2026-09-14 14:31:24 -04:00
Janek Bevendorff 07c102d926 Remove protected attributes from FDOSecrets attribute listing 2026-09-14 14:30:07 -04:00
Sami Vänttinen 26da2a1b17 Browser: Fix placeholders part two (#13670) 2026-09-13 19:03:55 -04:00
Jonathan White 1a2bdfe629 Code format 2026-09-13 17:12:25 +02:00
copilot-swe-agent[bot]anddroidmonkey 8ac2e00d9d Fix key file link translation markup handling
Co-authored-by: droidmonkey <[email protected]>
2026-09-13 17:12:25 +02:00
Janek Bevendorff 61c45ab751 Fix ineffective MAX_REDIRECTS setting 2026-09-11 08:19:12 -04:00
varjolintu 4243717a0b Fix hiding KeePassXC to system tray on macOS 2026-09-07 06:55:35 -04:00
Dylan Pulver 31a4c9ddd4 Reject invalid padding in Base32::decode
decode() counted '=' anywhere in the last six characters and treated
any count outside {1,3,4,6} as unpadded. With two or five pad
characters nQuantumBytes became 0, so the output buffer was returned
with bytes that were never written, and the byte-extraction offset
became -8, shifting by a negative amount.

Count only the trailing run of pad characters, reject counts RFC 4648
does not allow, and reject a '=' that is not part of that run.
2026-09-01 11:12:39 -04:00
Jonathan White 79c3c379ac Fix showing challenge response without password
* Fixes #13498
2026-08-24 12:37:42 -04:00
AetfandClaude Fable 5 30e1fa5dfb Fix use-after-free when a database tab close is re-entered (#13598)
* Fix use-after-free when a database tab close is re-entered

Closing a database tab may spin a nested event loop while the widget
performs save-on-close (Database::save waits for its worker thread in
AsyncTask::waitForFuture). If DatabaseTabWidget::closeDatabaseTab is
re-entered for the same widget from within that nested loop (e.g. two
concurrent FdoSecrets prompts deleting the same collection),
QWidget::close() short-circuits on its internal is_closing flag and
reports success immediately, without delivering another close event.
This behavior is identical in Qt 5 (QWidgetPrivate::close_helper) and
Qt 6 (QWidgetPrivate::handleClose), so none of the downstream guards
(such as DatabaseWidget::lock's m_attemptingLock) ever run for the
re-entrant close. The re-entrant call then removed the tab and
scheduled deletion, and the DeferredDelete event executed inside the
still-running nested loop, destroying the widget while the outer
invocation was still using it; the outer call afterwards repeated
parts of the teardown (stale-index removeTab, deleteLater on the freed
widget, duplicate databaseClosed emission). The bug is long-standing
and was surfaced by scheduler timing under an ASan build with Qt 6.11.

Detected by ASan as a heap-use-after-free in DatabaseWidget::save()
during TestGuiFdoSecrets::testCollectionDeleteConcurrent.

- DatabaseTabWidget::closeDatabaseTab: track widgets with a close in
  progress; a re-entrant call returns false without side effects, and
  only the outermost invocation may remove the tab, schedule deletion,
  and emit databaseClosed (exactly once now). Re-resolve the tab index
  after close() since nested event loops may shift tabs.
- FdoSecrets: PromptBase::prompt now schedules promptSync only once;
  repeated Prompt() calls wait for the same Completed signal instead
  of running the prompt action multiple times.
- FdoSecrets: DeleteCollectionPrompt clears its collection reference on
  Collection::collectionAboutToDelete. The QPointer alone still sees a
  retired collection (removed from D-Bus, m_backend already reset)
  until its deleteLater is delivered, which would violate the
  invariant behind Q_ASSERT(m_backend) in Collection::doDelete. With
  the explicit clearing the invariant "non-null m_collection implies
  usable backend" holds again and the assert stays.
- TestGuiFdoSecrets::testCollectionDeleteConcurrent: fix the second
  prompt proxy accidentally created from the first prompt's path (the
  test was exercising a double-Prompt on one object rather than two
  concurrent prompts), and assert the fail-fast behavior: the losing
  concurrent prompt completes as dismissed while the winner performs
  the deletion.

* FdoSecrets: complete prompts whose collections retire mid-prompt

A Collection retires (removed from D-Bus, backend reset, deleteLater
scheduled) synchronously when its database closes. Prompts, however,
reference collections via QPointer from timer callbacks outside D-Bus
dispatch, and a QPointer still sees the retired object until its
deferred deletion is delivered. This left two holes, both reachable
when a collection goes away while a prompt targeting it is in flight
(e.g. a concurrent Collection.Delete from another client):

- LockCollectionsPrompt/UnlockPrompt could call doLock()/doUnlock() on
  a retired collection, hitting Q_ASSERT(m_backend) in debug builds.
- UnlockPrompt would hang forever: the retired collection never emits
  doneUnlockCollection (its service connections are severed on
  retirement), and the count-based completion condition could no
  longer be satisfied, so the Completed signal never fired and the
  client waited indefinitely. The same accounting also hung when an
  entry was already destroyed by the time promptSync ran.

Following the same principle as DeleteCollectionPrompt: restore the
invariant that a non-null collection reference is usable, instead of
relaxing the asserts.

- LockCollectionsPrompt clears retired collection references on
  collectionAboutToDelete; a retired collection is skipped exactly
  like a destroyed one.
- UnlockPrompt tracks awaited collections in an explicit pending set,
  pre-registered before issuing any doUnlock so that synchronous
  completions (already-unlocked databases) cannot prematurely trigger
  the item unlock step. Retirement is accounted as a rejection and
  re-evaluates completion, so the prompt always terminates.
- Add regression test testServiceUnlockConcurrentDelete covering the
  unlock/delete race; verified to fail (hang detected via signal spy
  timeout) without this fix.

* FdoSecrets: clean up unlock dialog bookkeeping when the widget dies

Service::m_unlockingDb tracks databases with an unlock dialog shown to
prevent duplicate dialogs. If the DatabaseWidget is destroyed while
its dialog is open (e.g. the database is deleted via a concurrent
D-Bus call), dialogFinished never fires for it and the entry stayed
forever, keyed by a dangling pointer. The pointer was only ever
compared, not dereferenced, but the stale entry permanently blocked
doUnlockAnyDatabaseInDialog (used by unlock-before-search), and a
future widget allocated at the same address would have been refused an
unlock dialog as well.

Track a cleanup connection on the widget's destroyed signal alongside
the existing databaseUnlocked oneshot, covering both the per-database
and the unlock-any-database flows. Extend the
testServiceUnlockConcurrentDelete regression test to reopen the
database after the concurrent delete and verify the unlock dialog
still appears; without the fix the test times out in SearchItems
waiting for a dialog that never shows.

---------

Co-authored-by: Claude Fable 5 <[email protected]>
2026-08-23 22:45:29 -04:00
Sami Vänttinenandvarjolintu 0e1510d71a Browser: Do not allow using references when creating or updating credentials (#13580)
* Introduces EntryPlaceholders class and moves static code away from Entry class.

---------

Co-authored-by: varjolintu <[email protected]>
2026-08-12 15:03:33 -04:00
Copilot 9d3d278187 Prevent unfocused wheel changes in alternative save method setting
Solved with copilot assist
2026-08-10 06:14:02 -04:00
e590413544 Fix history items losing entry CustomData (#13573)
* Fix history items losing entry CustomData

Entry::beginUpdate() copied attributes, attachments and auto-type
associations into the temporary history item but not CustomData, unlike
clone() and copyDataFrom(). As a result every history item was created
with empty CustomData, and restoring an entry from history wiped its
CustomData, losing KeePassXC-Browser settings and other client metadata.

Copy CustomData into the history item like the other components and add
TestEntry::testHistoryItemCustomData covering creation and restore.

Co-Authored-By: Claude Fable 5 <[email protected]>

* Removed redundant code to ensure consistency

---------

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Jonathan White <[email protected]>
2026-08-08 22:48:36 -04:00
Adrien Ollier 0b0b2938eb refactor(configure_file): change extension of configure_file input files
Input files of configure_file are traditionnally suffixed with .in.
.cmake extension is preferably reserved to scripts.
2026-08-02 13:29:36 -04:00
varjolintu 205891202f Use native user temporary directory path for the browser socket in macOS 2026-07-23 08:45:18 -04:00
H-TTTTT 33b83d0b68 Fix CSV import header auto-mapping under non-English UI (#13531)
CSV files exported by KeePassXC always use English canonical headers.
When the UI locale translated field labels, only untranslated names
(URL, TOTP) matched. Also match the English export headers so
re-import works regardless of UI language.

Fixes #13523
2026-07-23 06:43:18 -04:00
IgorandJonathan White 58a2919650 Fix #13073: Respect password generator settings for new entries (#13277)
* Fix #13073: Respect password generator settings for new entries

---------

Co-authored-by: Jonathan White <[email protected]>
2026-07-23 06:42:48 -04:00
Adrien OllierandJonathan White caa7d14761 Cleanup line reader code for CLI (#13330)
* refactor(LineReader): Make use of the LineReader class in a much simpler way

The LineReader is made a concrete class whose declaration is independent of the readline library. Only its implementation depends on the presence or absence of the readline library. The LineReader code is embedded in a new library : line_reader, to make the cli library independant of the USE_READLINE definition.

* refactor(readline): better FindReadline module

The readline library is now searched with pkg-config first. If pkg-config is not installed, the search is manual. In both cases, the Readline::readline target is created, embedding transitive requirements.

FindReadline module was written with the help of Le Chat AI (https://chat.mistral.ai/chat)

---------

Co-authored-by: Jonathan White <[email protected]>
2026-07-23 06:41:11 -04:00
ryain11andJonathan White e888fec070 Fix password strength evaluation for referenced passwords (#13479)
* Also fix password strength in entry view

---------

Co-authored-by: Jonathan White <[email protected]>
2026-07-21 12:58:23 -04:00
Janek Bevendorff 6a534f38c6 Remove metastream IDs from UUID list to prevent potential use after free 2026-07-11 21:36:05 +02:00