Watch
1
0
Fork
You've already forked vaultwarden
0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2026-11-09 23:59:17 -05:00
Commit graph

3,157 commits

Author SHA1 Message Date
Daniel García
a8e4fe1ec4
Move the v2 upgrade token migration to its own version
Diesel identifies a migration by the date in its folder name alone, and silently drops one of two folders that share it. The Custom Roles migration uses the same date.
2026-11-04 22:13:23 +01:00
Daniel García
2bb9035940
Remove the v2 upgrade feature flags
With force-upgrade-v2-encryption on, the clients loop on any v1 account that stays v1 on a vault route: the migration check runs fullSync(false), which writes lastSync, which triggers the scheduler again. No server response stops it, so don't serve the flag until the clients fix it.

pm-30144-sdk-key-rotation and pm-31050-no-logout-key-upgrade-rotation only serve that upgrade, so they go too.
2026-11-04 22:13:23 +01:00
Daniel García
f07f99fcb4
Document the v2 encryption feature flags 2026-11-04 22:13:23 +01:00
Daniel García
9c6357a9fd
Gate v2 logins on upstream's v2 encryption check 2026-11-04 22:13:23 +01:00
Daniel García
acd40b1705
Save the signature key pair before the v2 account state 2026-11-04 22:13:23 +01:00
Daniel García
90993c92be
Refuse key ids that aren't 32 lowercase hex characters, like upstream 2026-11-04 22:13:23 +01:00
Daniel García
aaa8f240d6
Clear user key ids left stale by key rotations 2026-11-04 22:13:23 +01:00
Daniel García
6dd49a7cf9
Implement V2 key rotation support 2026-11-04 22:13:23 +01:00
Daniel García
de40d7de29
Implement V2 registration support 2026-11-04 22:13:12 +01:00
Daniel García
c218e0200c
Support blob-encrypted ciphers and match upstream's key id checks 2026-11-04 22:13:12 +01:00
Tom
904b80115d
[PR 1] Add experimental Custom Roles foundation (#7847) 2026-11-04 22:11:52 +01:00
Daniel García
82fc47e83e
Redact query values in request logs (#7929) 2026-11-03 00:12:56 +01:00
Tom
286499781a
Add Fill Assist feature flag in .env.template (#7928) 2026-11-02 20:28:51 +01:00
Daniel García
6ed6921cc2
Escape request values in log messages (#7921) 1.37.5 2026-11-01 22:38:18 +01:00
Mathijs van Veluw
5d870b796f
Clippy fixes, crate and web-vault updates (#7920) 2026-11-01 18:59:00 +01:00
Tom
79ee29d501
Add HTTP auth and policy revocation audit events (#7919) 2026-11-01 17:09:56 +01:00
Daniel García
acb574b768
Two small fixes for upstream parity (#7918) 2026-11-01 16:30:35 +01:00
Cassian433
e056359a42
Send logout notification when deleting a user (#7839) 2026-10-29 23:16:14 +01:00
Michael Mu
f1c7eccd4a
Bump user revision once for bulk cipher move (#7840) 2026-10-29 22:38:39 +01:00
Tom
0dbc92f2b7
Make 2FA remember duration configurable (#7421) 2026-10-29 22:33:26 +01:00
Tom
42660af757
Add registration email verification clicked endpoint (#7790) 2026-10-29 22:32:37 +01:00
Tom
863395f5e2
Add configurable Fill Assist rules URL (#7791) 2026-10-29 22:25:23 +01:00
Tauan BF
be5d3ad907
Don't return internal error details in bulk member responses; gate SSO token logging (#7777) 2026-10-29 22:22:12 +01:00
lede
80d1859452
Fix push device unregistration endpoint (#7891) 2026-10-29 22:18:00 +01:00
Michael Mu
b723afe08a
Document two feature flags in .env.template (#7841) 2026-10-29 22:15:26 +01:00
Daniel García
64ae55ceb2
Align cipher org checks & attachment notification with upstream (#7906) 2026-10-28 23:14:28 +01:00
Luca Becker
a96912bf21
fix(attachments): enforce quota at v2 metadata reservation (#7450)
* fix(attachments): enforce quota at v2 metadata reservation

POST /ciphers/<id>/attachment/v2 persisted client-declared fileSize without
checking USER_ATTACHMENT_LIMIT or ORG_ATTACHMENT_LIMIT, allowing a writer to
exhaust org/user quota via metadata-only reservations before uploading bytes.

Extract shared quota arithmetic into attachment_quota_remaining and use it
from post_attachment_v2 (size_adjust=0) and save_attachment so both paths
stay consistent. Add unit tests covering limit, size_adjust, and the v2
over-quota rejection case.

* Remove unneeded tests and simplify

---------

Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2026-10-28 21:54:06 +01:00
Daniel García
e2d63cfca3
Remove expired cookies from the icon cookie jar (#7905) 2026-10-28 21:28:02 +01:00
Arthurmeade12
0f44744ef8
Fix typo (#7864)
sever -> server
2026-10-25 20:42:35 +01:00
Mathijs van Veluw
44c4853d37
Upgrade to Rocket v0.5.2 (#7890)
Upgrade Rocket to v0.5.2 which has updated all the crate dependencies.
Also adjusted some code which I changed with Rkt and during that found
some small bugs and fixed those too.

Adjusted the ETag Caching a bit.

Also updated other crates and GHA.

Signed-off-by: BlackDex <black.dex@gmail.com>
2026-10-25 17:08:08 +01:00
Tom
e5a90968f2
Fix bulk cipher share response for SDK clients (#7831)
* Fix bulk cipher share response for SDK clients

* Simplify cipher sharing code
2026-10-25 16:49:20 +01:00
Alexander Widak
7ce705be56
Return stored manage flag for groups in collections/details (#7795)
CollectionGroup::to_json_details_for_group derived manage from
!read_only && !hide_passwords, so the group permission "Can edit items"
was reported as "Can manage collection" by collections/details, while
groups/<id>/details reported the stored value. Saving the collection
access dialog in the web vault then persisted manage=true.

Fixes #7794

Co-authored-by: Alexander Widak <deltatree.widak@gmail.com>
2026-10-25 16:49:12 +01:00
MinchinWeb
c925c04de0
Send null org key for unconfirmed members in sync (#7850)
Since #7666 the sync profile's `organizationsNew` also lists Accepted
(not yet confirmed) memberships. Their `akey` is still empty, so the
response contained `"key": ""`, whereas upstream sends `null` until the
member is confirmed.

Bitwarden Android 2026.9 prefers `organizationsNew` and only skips
organizations whose key is null. The empty string is handed to the SDK,
which rejects it ("Invalid asymmetric type, got type 0 with 1 parts"),
so the whole `initializeOrgCrypto` call fails: none of the user's
organization keys are loaded and every organization item and collection
fails to decrypt on that device.

Send null for an empty key, matching upstream and the existing handling
of the user key in `GET /api/accounts/keys`.


Claude-Session: https://claude.ai/code/session_011UHYQWTz2PkXSCfucaRMZB

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:49:02 +01:00
Mathijs van Veluw
b71cb7a832
Misc fixes regarding jobs and config (#7858)
* Fix several scheduled job issues

Several jobs could cause a panic, or stop without running through all
items because of this panic. This could cause missed items until that
panic somehow resolved it self, and probably would never work fully
again.

This could cause emergency access for example to never work again.
Besides this, emergency access was also able to be panic if the
wait-time was out-of-bounds and date/time calculation might fail.
This is also fixed now by using `checked` functions and continue upon
those issues so all awaiting items will be handled.

Signed-off-by: BlackDex <black.dex@gmail.com>

* Fix several possible panics and overflows

Adjust several integer types to be a lower or unsigned type.
Most types were too large, only because the function which used this
value needed that specific type. But, this allowed too large values
which either caused panics or might cause a DoS.

This does however might possible cause configurations which have larger
values, which are probably way too large anyway to be not loaded or use
their defaults. During the config loading, either via env or json, it
will show error logs regarding these items.

Also fixed an issue with protected actions via OTP, it increased the
attempt before it validated if the attempt limit was reached. This could
cause an issue when set to `1`, that way it was never allowed, and `3`
times would actually be `2`.

Also added several config validation checks which otherwise would have
prevent Vaultwarden to start, or login, so these will probably not cause
issues, else users would already have issues.

Signed-off-by: BlackDex <black.dex@gmail.com>

* Show config errors on diagnostics page

With the previous commits it is now possible to add a warning if their
rare issues with loading of the config, either environment variables
which we were not able to parse correctly, or if loading the
`config.json` failed instead of just showing it wasn't used, while it
does exists, which might be confusing.

Signed-off-by: BlackDex <black.dex@gmail.com>

---------

Signed-off-by: BlackDex <black.dex@gmail.com>
2026-10-22 14:20:03 +02:00
Mathijs van Veluw
f4696877b9
Update dependencies (#7882)
- Updated all the crates
- Updated JavaScript libraries
- Updated xx to v1.10.0
- Updated Rust to v1.99.1
- Updated GHA & Pre-Commit

Resolves #7877

Signed-off-by: BlackDex <black.dex@gmail.com>
2026-10-22 12:47:30 +02:00
ump45nose
296599003c
docs: fix connect-src description grammar in config.rs and .env.template (#7866) 2026-10-22 12:46:26 +02:00
ump45nose
970cc49182
api/icons: fix typos in the minimum PNG size comment (#7867) 2026-10-22 12:46:00 +02:00
Mathijs van Veluw
58a980f850
Add unsupported riscv64 architecture (#7859)
This PR makes it easy for users to build a Debian container images which
is able to run on a riscv64 architecture using a Debian Container, or if
needed, you can extract the binary from this container, but the user
needs to be sure the libraries are available and supported if using
Docker is not an option.

Signed-off-by: BlackDex <black.dex@gmail.com>
2026-10-16 11:51:32 +02:00
Cassian433
64895524e4
Delete auth requests when deleting a user (#7837) 2026-10-10 19:58:40 +02:00
Pier Carlo Cadoppi
df2cd3c869
Add biometrics-sdk-ipc feature flag (#7813) 2026-10-07 19:20:23 +02:00
Tom
0e93d15b73
Add Windows desktop autotype support (#7808) 2026-10-07 19:20:04 +02:00
will-lottkowitz-prism
d1cbd027cd
Add revision_date to org policies (#7571)
* Add revision_date to org policies

Org policy JSON responses never included a revisionDate field, unlike
every other synced entity. The official Bitwarden server always sets
it, and current official clients (recently migrated to the WASM SDK's
typed PolicyView) now assume it is always a valid date string. Its
absence deserializes to undefined client-side, which then throws
(RangeError: Invalid time value) when the client formats it, breaking
the whole policy sync pipeline and silently emptying the vault view in
the browser and desktop apps.

Adds a revision_date column (mirroring the existing pattern used by
Send), stamped on creation and bumped on every save.

* Fix migration correctness for org policy revision_date

Caught by review: SQLite rejects non-constant defaults in ALTER TABLE
ADD COLUMN, so the sqlite migration would fail outright on every
existing installation (vaultwarden's default backend) rather than the
postgresql setup this was developed against.

- sqlite/mysql: add the column with a constant placeholder default,
  then backfill via UPDATE, since neither allows a volatile default
  in ALTER TABLE ADD COLUMN (mysql does allow it, but a constant
  keeps the three backends' migrations symmetric).
- mysql: use DATETIME instead of TIMESTAMP, matching this repo's
  existing revision_date columns, and backfill with UTC_TIMESTAMP()
  instead of a session-timezone-dependent CURRENT_TIMESTAMP.
- postgresql: backfill with `now() AT TIME ZONE 'utc'` instead of a
  DEFAULT now(), since assigning timestamptz now() into this naive
  TIMESTAMP column would otherwise cast through the server's TimeZone
  GUC and store local wall-clock instead of UTC on non-UTC servers.
- mysql/postgresql: add a real down.sql (DROP COLUMN) instead of
  leaving it empty.

* Move org policy revision_date migration after the latest one

---------

Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2026-10-07 19:19:26 +02:00
Daniel García
1f802f8e6a
Update web-vault to v2026.8.0 (#7828) 2026-10-07 00:56:01 +02:00
Daniel García
a2efadc650
Fix email 2FA for SSO logins on iOS and Android (#7827)
* Allow email-only /api/two-factor/send-email-login for mobile clients

Mobile clients (iOS) may call /api/two-factor/send-email-login with only the user's email and without a MasterPasswordHash or an AuthRequest. Permit email-only requests so the server will send the email 2FA token in that flow.\n\nModified: src/api/core/two_factor/email.rs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(email-2fa): use device-identifier fallback when no password hash submitted

iOS clients call /api/two-factor/send-email-login with an email and
DeviceIdentifier but without masterPasswordHash or authRequestId after
receiving a 2FA-required response from the token endpoint. The previous
empty else-block allowed any caller to trigger a 2FA email for any
account knowing only the email address.

Replace the empty block with a device-identifier-based fallback:
- Look up the most-recently-active device via find_by_device_for_email2fa.
- Verify the device's associated user email matches the submitted email.
- Log (debug) when the fallback path is exercised for operator visibility.
- Reject with the original error when no device identifier is provided or
  when the device maps to a different account.

Fixes #7568

* Check the pending 2FA login for this user and device

Look up the pending 2FA login for the user and device instead of the
latest one on the device, answer a failed check with the same error and
IP/username log detail as a wrong password, and escape the device id in
the logs.

---------

Co-authored-by: Arunabha-Mukhopadhyay <dkarunabha2006@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-07 00:16:01 +02:00
Timshel
acbf49018f
[web-v2026.7.1] 2FA userVerificationToken for Authenticator, Email and Duo (#7563)
* 2FA using userVerificationToken

* Fix 2FA Yubikeys

* TwoFactor.find_by_user_and_type take enum parameter not i32

* log_user_event take enum parameter not i32

* Fix 2fa webauthn

* Prevent 2FA claims reuse

* 2fa webauthn return keys when deleting

* 2fa reset twofactor_remember

* Reject 2FA verification tokens issued for another provider

The Email and Duo claims only have optional fields, so a userVerificationToken minted for another
provider deserialized into them and was accepted. Each provider's claims now reject unknown fields,
with a test that every token only parses as its own provider.

Also fix the email 2FA login in the Playwright user setup, which used an undefined `mailBuffer`.

---------

Co-authored-by: Timshel <timshel@users.noreply.github.com>
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2026-10-06 23:45:55 +02:00
Tom
b8089e31c2
[Web 2026.9.0] Support new account recovery password payload (#7747)
* Support new account recovery password payload

* Address account recovery review feedback

* Check the account recovery password before sending the recovery email

---------

Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2026-10-06 20:45:12 +02:00
Tom
8647af8f89
[Web 2026.9.0] Support new Emergency Access password payload (#7746)
* Support new emergency access password payload

* Apply PR 7747 review changes to emergency access

* Add Playwright test for emergency access takeover
2026-10-06 20:28:51 +02:00
Jogius
c687cacb6b
Fix group import to update groups on data change (#7671)
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2026-10-06 19:29:58 +02:00
Wu Shuwen
8b56926077
docs: fix Playwright test env link (#7739)
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2026-10-06 19:26:09 +02:00
ump45nose
de6d2066b3
docs: fix "runnning" typo in playwright README (#7787)
Signed-off-by: yuwk <1729065730@qq.com>
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
2026-10-06 19:25:51 +02:00