mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-11-14 10:06:06 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e03151d307 |
||
|
|
644ddfa000 |
||
|
|
df1e918c79 |
||
|
|
258b7f0254 |
||
|
|
a8de8c7820 |
||
|
|
d2d1294098 |
||
|
|
730048e3c6 |
||
|
|
1430a64547 |
||
|
|
7c82fbed0c |
||
|
|
d28c8339fb |
||
|
|
5ad0c6d41a |
||
|
|
17b159beff |
||
|
|
904b80115d |
||
|
|
82fc47e83e |
||
|
|
286499781a |
69 changed files with 5866 additions and 1040 deletions
|
|
@ -396,6 +396,7 @@
|
||||||
## Note that clients cache the /api/config endpoint for about 1 hour and it could take some time before they are enabled or disabled!
|
## Note that clients cache the /api/config endpoint for about 1 hour and it could take some time before they are enabled or disabled!
|
||||||
##
|
##
|
||||||
## The following flags are available:
|
## The following flags are available:
|
||||||
|
## - "fill-assist-targeting-rules": Enable Fill Assist targeting rules in the browser extension. (Browser >= 2026.6.0)
|
||||||
## - "pm-5594-safari-account-switching": Enable account switching in Safari. (Safari >= 2026.2.0)
|
## - "pm-5594-safari-account-switching": Enable account switching in Safari. (Safari >= 2026.2.0)
|
||||||
## - "pm-32413-multi-client-password-management": Enable changing the master password directly in the client. (Desktop/Extension >= 2026.4.0)
|
## - "pm-32413-multi-client-password-management": Enable changing the master password directly in the client. (Desktop/Extension >= 2026.4.0)
|
||||||
## - "ssh-agent-v2": Enable newer SSH agent support. (Desktop >= 2026.2.1)
|
## - "ssh-agent-v2": Enable newer SSH agent support. (Desktop >= 2026.2.1)
|
||||||
|
|
@ -410,6 +411,10 @@
|
||||||
## - "biometrics-sdk-ipc": Enable biometric unlock over the SDK IPC framework (Desktop >= 2026.9.0, Browser >= 2026.9.0)
|
## - "biometrics-sdk-ipc": Enable biometric unlock over the SDK IPC framework (Desktop >= 2026.9.0, Browser >= 2026.9.0)
|
||||||
## - "windows-native-credential-sync": Register the desktop app as a passkey provider in Windows, so passkeys in the vault can be used by other apps and browsers.
|
## - "windows-native-credential-sync": Register the desktop app as a passkey provider in Windows, so passkeys in the vault can be used by other apps and browsers.
|
||||||
## Requires the Microsoft Store (appx) build of the desktop app. Stable releases up to and including 2026.9.1 lack the required plugin registration, so it has no effect there yet.
|
## Requires the Microsoft Store (appx) build of the desktop app. Stable releases up to and including 2026.9.1 lack the required plugin registration, so it has no effect there yet.
|
||||||
|
## - "macos-native-credential-sync": Enable the desktop app as a passkey provider on macOS, so passkeys in the vault can be used by other apps and browsers.
|
||||||
|
## - "pm-27278-v2-password-registration": Register new accounts with v2 encryption. (Web >= 2026.6.4, Desktop/Browser/CLI >= 2026.7.0, Android >= 2026.4.1, iOS >= 2026.5.1)
|
||||||
|
## - "enable-account-encryption-v2-jit-password-registration": Give SSO users who set their master password on their first login v2 encryption. (Web >= 2026.1.1, Desktop/Browser/CLI >= 2026.1.0, Android >= 2026.4.1, iOS >= 2026.6.0)
|
||||||
|
## These two flags can't be undone: a v2 account stays v2, and it can only log in from clients that are 2026.10.1 or newer (2026.10.2 for the desktop app), so the versions above are only enough to create one.
|
||||||
# EXPERIMENTAL_CLIENT_FEATURE_FLAGS=
|
# EXPERIMENTAL_CLIENT_FEATURE_FLAGS=
|
||||||
|
|
||||||
## Require new device emails. When a user logs in an email is required to be sent.
|
## Require new device emails. When a user logs in an email is required to be sent.
|
||||||
|
|
@ -496,6 +501,15 @@
|
||||||
## KNOW WHAT YOU ARE DOING!
|
## KNOW WHAT YOU ARE DOING!
|
||||||
# ORG_GROUPS_ENABLED=false
|
# ORG_GROUPS_ENABLED=false
|
||||||
|
|
||||||
|
## EXPERIMENTAL FEATURE: Custom roles
|
||||||
|
## Enables the Custom member role with granular permissions for organizations.
|
||||||
|
## This is still being developed: only the permissions this version enforces can be granted.
|
||||||
|
## This is enforced by the server and is unrelated to EXPERIMENTAL_CLIENT_FEATURE_FLAGS.
|
||||||
|
## Disabling it again keeps the stored Custom roles and permissions, but they grant nothing until it is re-enabled.
|
||||||
|
## Disabled by default because this is an experimental feature!
|
||||||
|
## KNOW WHAT YOU ARE DOING!
|
||||||
|
# EXPERIMENTAL_CUSTOM_ROLES=false
|
||||||
|
|
||||||
## Increase secure note size limit (Know the risks!)
|
## Increase secure note size limit (Know the risks!)
|
||||||
## Sets the secure note size limit to 100_000 instead of the default 10_000.
|
## Sets the secure note size limit to 100_000 instead of the default 10_000.
|
||||||
## WARNING: This could cause issues with clients. Also exports will not work on Bitwarden servers!
|
## WARNING: This could cause issues with clients. Also exports will not work on Bitwarden servers!
|
||||||
|
|
|
||||||
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
|
|
@ -4,3 +4,4 @@
|
||||||
/.github/ISSUE_TEMPLATE/** @dani-garcia @BlackDex
|
/.github/ISSUE_TEMPLATE/** @dani-garcia @BlackDex
|
||||||
/.github/workflows/** @dani-garcia @BlackDex
|
/.github/workflows/** @dani-garcia @BlackDex
|
||||||
/SECURITY.md @dani-garcia @BlackDex
|
/SECURITY.md @dani-garcia @BlackDex
|
||||||
|
/THREAT_MODEL.md @dani-garcia @BlackDex
|
||||||
|
|
|
||||||
43
.github/workflows/build.yml
vendored
43
.github/workflows/build.yml
vendored
|
|
@ -57,7 +57,23 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
- name: "Install dependencies Ubuntu"
|
- name: "Install dependencies Ubuntu"
|
||||||
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends openssl build-essential libmariadb-dev-compat libpq-dev libssl-dev pkg-config
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y --no-install-recommends openssl build-essential libmariadb-dev-compat libpq-dev libssl-dev pkg-config
|
||||||
|
|
||||||
|
# Pass the MariaDB client library to mysqlclient-sys through its environment variables.
|
||||||
|
# When it finds the library with pkg-config, its build script makes cargo rerun it whenever
|
||||||
|
# anything in the library directory changes, and the install above changes that directory on
|
||||||
|
# every run. So every MySQL build recompiled mysqlclient-sys, diesel and diesel_migrations,
|
||||||
|
# even with a cached build. Cargo compares environment variables by their value instead.
|
||||||
|
lib_dir="$(pkg-config --variable=libdir mysqlclient)"
|
||||||
|
version="$(pkg-config --modversion mysqlclient)"
|
||||||
|
{
|
||||||
|
echo "MYSQLCLIENT_NO_PKG_CONFIG=1"
|
||||||
|
echo "LIBMARIADB_NO_PKG_CONFIG=1"
|
||||||
|
echo "MYSQLCLIENT_LIB_DIR=${lib_dir}"
|
||||||
|
echo "MYSQLCLIENT_VERSION=${version}"
|
||||||
|
} | tee -a "${GITHUB_ENV}"
|
||||||
# End Install dependencies
|
# End Install dependencies
|
||||||
|
|
||||||
# Checkout the repo
|
# Checkout the repo
|
||||||
|
|
@ -118,22 +134,19 @@ jobs:
|
||||||
# Use a custom prefix-key to force a fresh start. This is sometimes needed with bigger changes.
|
# Use a custom prefix-key to force a fresh start. This is sometimes needed with bigger changes.
|
||||||
# Like changing the build host from Ubuntu 20.04 to 22.04 for example.
|
# Like changing the build host from Ubuntu 20.04 to 22.04 for example.
|
||||||
# Only update when really needed! Use a <year>.<month>[.<inc>] format.
|
# Only update when really needed! Use a <year>.<month>[.<inc>] format.
|
||||||
prefix-key: "v2025.09-rust"
|
prefix-key: "v2026.11-rust"
|
||||||
|
# Only save caches on main to save cache space.
|
||||||
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
# End Enable Rust Caching
|
# End Enable Rust Caching
|
||||||
|
|
||||||
# Run cargo tests
|
# Run cargo tests
|
||||||
# First test all features together, afterwards test them separately.
|
# First test all features together, afterwards test them separately.
|
||||||
- name: "test features: sqlite,mysql,postgresql,enable_mimalloc,s3"
|
# enable_mimalloc and unsafe_test_mode are additive, so we test them once here.
|
||||||
|
- name: "test features: sqlite,mysql,postgresql,enable_mimalloc,s3,unsafe_test_mode"
|
||||||
id: test_sqlite_mysql_postgresql_mimalloc_s3
|
id: test_sqlite_mysql_postgresql_mimalloc_s3
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
run: |
|
run: |
|
||||||
cargo test --profile ci --features sqlite,mysql,postgresql,enable_mimalloc,s3
|
cargo test --profile ci --features sqlite,mysql,postgresql,enable_mimalloc,s3,unsafe_test_mode
|
||||||
|
|
||||||
- name: "test features: sqlite,mysql,postgresql,enable_mimalloc"
|
|
||||||
id: test_sqlite_mysql_postgresql_mimalloc
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
run: |
|
|
||||||
cargo test --profile ci --features sqlite,mysql,postgresql,enable_mimalloc
|
|
||||||
|
|
||||||
- name: "test features: sqlite,mysql,postgresql"
|
- name: "test features: sqlite,mysql,postgresql"
|
||||||
id: test_sqlite_mysql_postgresql
|
id: test_sqlite_mysql_postgresql
|
||||||
|
|
@ -162,11 +175,11 @@ jobs:
|
||||||
|
|
||||||
|
|
||||||
# Run cargo clippy, and fail on warnings
|
# Run cargo clippy, and fail on warnings
|
||||||
- name: "clippy features: sqlite,mysql,postgresql,enable_mimalloc,s3"
|
- name: "clippy features: sqlite,mysql,postgresql,enable_mimalloc,s3,unsafe_test_mode"
|
||||||
id: clippy
|
id: clippy
|
||||||
if: ${{ !cancelled() && matrix.channel == 'rust-toolchain' }}
|
if: ${{ !cancelled() && matrix.channel == 'rust-toolchain' }}
|
||||||
run: |
|
run: |
|
||||||
cargo clippy --profile ci --features sqlite,mysql,postgresql,enable_mimalloc,s3
|
cargo clippy --profile ci --features sqlite,mysql,postgresql,enable_mimalloc,s3,unsafe_test_mode
|
||||||
# End Run cargo clippy
|
# End Run cargo clippy
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -185,7 +198,6 @@ jobs:
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
env:
|
env:
|
||||||
TEST_DB_M_S3: ${{ steps.test_sqlite_mysql_postgresql_mimalloc_s3.outcome }}
|
TEST_DB_M_S3: ${{ steps.test_sqlite_mysql_postgresql_mimalloc_s3.outcome }}
|
||||||
TEST_DB_M: ${{ steps.test_sqlite_mysql_postgresql_mimalloc.outcome }}
|
|
||||||
TEST_DB: ${{ steps.test_sqlite_mysql_postgresql.outcome }}
|
TEST_DB: ${{ steps.test_sqlite_mysql_postgresql.outcome }}
|
||||||
TEST_SQLITE: ${{ steps.test_sqlite.outcome }}
|
TEST_SQLITE: ${{ steps.test_sqlite.outcome }}
|
||||||
TEST_MYSQL: ${{ steps.test_mysql.outcome }}
|
TEST_MYSQL: ${{ steps.test_mysql.outcome }}
|
||||||
|
|
@ -197,13 +209,12 @@ jobs:
|
||||||
echo "" >> "${GITHUB_STEP_SUMMARY}"
|
echo "" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|Job|Status|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|Job|Status|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|---|------|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|---|------|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|test (sqlite,mysql,postgresql,enable_mimalloc,s3)|${TEST_DB_M_S3}|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|test (sqlite,mysql,postgresql,enable_mimalloc,s3,unsafe_test_mode)|${TEST_DB_M_S3}|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|test (sqlite,mysql,postgresql,enable_mimalloc)|${TEST_DB_M}|" >> "${GITHUB_STEP_SUMMARY}"
|
|
||||||
echo "|test (sqlite,mysql,postgresql)|${TEST_DB}|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|test (sqlite,mysql,postgresql)|${TEST_DB}|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|test (sqlite)|${TEST_SQLITE}|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|test (sqlite)|${TEST_SQLITE}|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|test (mysql)|${TEST_MYSQL}|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|test (mysql)|${TEST_MYSQL}|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|test (postgresql)|${TEST_POSTGRESQL}|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|test (postgresql)|${TEST_POSTGRESQL}|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|clippy (sqlite,mysql,postgresql,enable_mimalloc,s3)|${CLIPPY}|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|clippy (sqlite,mysql,postgresql,enable_mimalloc,s3,unsafe_test_mode)|${CLIPPY}|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "|fmt|${FMT}|" >> "${GITHUB_STEP_SUMMARY}"
|
echo "|fmt|${FMT}|" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "" >> "${GITHUB_STEP_SUMMARY}"
|
echo "" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
echo "Please check the failed jobs and fix where needed." >> "${GITHUB_STEP_SUMMARY}"
|
echo "Please check the failed jobs and fix where needed." >> "${GITHUB_STEP_SUMMARY}"
|
||||||
|
|
|
||||||
166
.github/workflows/sdk-live-tests.yml
vendored
Normal file
166
.github/workflows/sdk-live-tests.yml
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
||||||
|
name: SDK live tests
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
|
# Runs the live-server end-to-end tests of bitwarden/sdk-internal against this branch, see tools/sdk-live-tests/run.sh.
|
||||||
|
# By default it tests the latest @bitwarden/sdk-internal on npm, which the SDK publishes for every commit to its main
|
||||||
|
# branch, with the e2e tests from that commit. A manual run can name an npm version instead, or a branch, tag or commit
|
||||||
|
# to build the SDK from. It runs daily, by hand, and on changes to the test seeder or the runner.
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# 04:15 UTC, off the top of the hour, when GitHub may delay or drop scheduled runs
|
||||||
|
- cron: "15 4 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
sdk_npm_version:
|
||||||
|
description: "Version of @bitwarden/sdk-internal on npm to test (empty for the latest)"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
sdk_ref:
|
||||||
|
description: "Or a branch, tag or commit of bitwarden/sdk-internal to build and test (slower)"
|
||||||
|
required: false
|
||||||
|
default: ""
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- ".github/workflows/sdk-live-tests.yml"
|
||||||
|
- "src/api/test_seeder.rs"
|
||||||
|
- "tools/sdk-live-tests/**"
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sdk-live-tests:
|
||||||
|
name: SDK live tests
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
timeout-minutes: 90
|
||||||
|
env:
|
||||||
|
# Less to compile and link, and a smaller cache. Panics still show file and line.
|
||||||
|
CARGO_PROFILE_DEV_DEBUG: "0"
|
||||||
|
steps:
|
||||||
|
- name: "Install dependencies Ubuntu"
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential libssl-dev pkg-config
|
||||||
|
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
# A published package (npm) or a build from a git ref (git), and the sdk-internal commit to check out
|
||||||
|
- name: "Pick the SDK"
|
||||||
|
id: sdk
|
||||||
|
env:
|
||||||
|
NPM_VERSION: ${{ inputs.sdk_npm_version }}
|
||||||
|
GIT_REF: ${{ inputs.sdk_ref }}
|
||||||
|
run: |
|
||||||
|
if [[ -n "${NPM_VERSION}" && -n "${GIT_REF}" ]]; then
|
||||||
|
echo "::error::Give an npm version or a git ref, not both"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ -n "${GIT_REF}" ]]; then
|
||||||
|
{
|
||||||
|
echo "source=git"
|
||||||
|
echo "ref=${GIT_REF}"
|
||||||
|
} >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "SDK: bitwarden/sdk-internal \`${GIT_REF}\`, built from source" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
spec="${NPM_VERSION:-latest}"
|
||||||
|
if [[ ! "${spec}" =~ ^[0-9A-Za-z.+-]+$ ]]; then
|
||||||
|
echo "::error::That is not an npm version or tag"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
manifest="$(curl -fsS --retry 3 "https://registry.npmjs.org/@bitwarden%2Fsdk-internal/${spec}")"
|
||||||
|
version="$(jq -r .version <<< "${manifest}")"
|
||||||
|
commit="$(jq -r .gitHead <<< "${manifest}")"
|
||||||
|
if [[ ! "${commit}" =~ ^[0-9a-f]{40}$ ]]; then
|
||||||
|
echo "::error::@bitwarden/sdk-internal@${version} doesn't name the commit it was built from"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
{
|
||||||
|
echo "source=npm"
|
||||||
|
echo "version=${version}"
|
||||||
|
echo "ref=${commit}"
|
||||||
|
} >> "${GITHUB_OUTPUT}"
|
||||||
|
echo "SDK: @bitwarden/sdk-internal ${version} from npm, e2e tests at ${commit}" >> "${GITHUB_STEP_SUMMARY}"
|
||||||
|
|
||||||
|
- name: "Checkout sdk-internal"
|
||||||
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
|
with:
|
||||||
|
repository: bitwarden/sdk-internal
|
||||||
|
ref: ${{ steps.sdk.outputs.ref }}
|
||||||
|
path: sdk-internal
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
# Each checkout pins its own toolchain in rust-toolchain.toml. The SDK's is only needed to build it.
|
||||||
|
- name: "Install toolchains"
|
||||||
|
env:
|
||||||
|
SDK_SOURCE: ${{ steps.sdk.outputs.source }}
|
||||||
|
run: |
|
||||||
|
rustup toolchain install
|
||||||
|
if [[ "${SDK_SOURCE}" == git ]]; then
|
||||||
|
cd sdk-internal
|
||||||
|
rustup toolchain install
|
||||||
|
rustup target add wasm32-unknown-unknown
|
||||||
|
rustup component add rust-src
|
||||||
|
fi
|
||||||
|
|
||||||
|
# One cache per SDK source, so that neither restores the other's.
|
||||||
|
# Only save caches on main to save cache space.
|
||||||
|
- name: "Cache Rust builds"
|
||||||
|
if: ${{ steps.sdk.outputs.source == 'npm' }}
|
||||||
|
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||||
|
with:
|
||||||
|
key: sdk-live-tests-npm
|
||||||
|
add-job-id-key: false
|
||||||
|
workspaces: ". -> target"
|
||||||
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
|
||||||
|
- name: "Cache Rust builds (with the SDK)"
|
||||||
|
if: ${{ steps.sdk.outputs.source == 'git' }}
|
||||||
|
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||||
|
with:
|
||||||
|
key: sdk-live-tests-sdk-build
|
||||||
|
add-job-id-key: false
|
||||||
|
workspaces: |
|
||||||
|
. -> target
|
||||||
|
sdk-internal -> target
|
||||||
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
|
||||||
|
- name: "Setup Node"
|
||||||
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||||
|
with:
|
||||||
|
node-version-file: sdk-internal/.nvmrc
|
||||||
|
|
||||||
|
# Where the SDK's build would put it
|
||||||
|
- name: "Download the SDK package"
|
||||||
|
if: ${{ steps.sdk.outputs.source == 'npm' }}
|
||||||
|
env:
|
||||||
|
SDK_VERSION: ${{ steps.sdk.outputs.version }}
|
||||||
|
SDK_COMMIT: ${{ steps.sdk.outputs.ref }}
|
||||||
|
run: |
|
||||||
|
# npm checks the tarball against the registry's checksum
|
||||||
|
tarball="$(npm pack "@bitwarden/sdk-internal@${SDK_VERSION}" --pack-destination "${RUNNER_TEMP}" --json | jq -r '.[0].filename')"
|
||||||
|
package_dir=sdk-internal/crates/bitwarden-wasm-internal/npm
|
||||||
|
tar -xzf "${RUNNER_TEMP}/${tarball}" --strip-components=1 -C "${package_dir}"
|
||||||
|
if [[ "$(cat "${package_dir}/VERSION")" != "${SDK_COMMIT}" ]]; then
|
||||||
|
echo "::error::The package's VERSION doesn't match its commit ${SDK_COMMIT}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: "Run the SDK live tests"
|
||||||
|
env:
|
||||||
|
SDK_SOURCE: ${{ steps.sdk.outputs.source }}
|
||||||
|
run: |
|
||||||
|
args=(--sdk-dir sdk-internal)
|
||||||
|
if [[ "${SDK_SOURCE}" == npm ]]; then
|
||||||
|
args+=(--skip-sdk-build)
|
||||||
|
fi
|
||||||
|
tools/sdk-live-tests/run.sh "${args[@]}"
|
||||||
|
|
||||||
|
- name: "Upload logs"
|
||||||
|
if: ${{ !cancelled() }}
|
||||||
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||||
|
with:
|
||||||
|
name: sdk-live-tests-logs
|
||||||
|
path: target/sdk-live-tests/**/*.log
|
||||||
|
|
@ -14,9 +14,8 @@ extend-ignore-re = [
|
||||||
# In SMTP it's called HELO, so ignore it
|
# In SMTP it's called HELO, so ignore it
|
||||||
"(?i)helo_name",
|
"(?i)helo_name",
|
||||||
"Server name sent during.+HELO",
|
"Server name sent during.+HELO",
|
||||||
# COSE Is short for CBOR Object Signing and Encryption, ignore these specific items
|
# COSE Is short for CBOR Object Signing and Encryption
|
||||||
"COSEKey",
|
"(?i)cose",
|
||||||
"COSEAlgorithm",
|
|
||||||
# Ignore this specific string as it's valid
|
# Ignore this specific string as it's valid
|
||||||
"Ensure they are valid OTPs",
|
"Ensure they are valid OTPs",
|
||||||
# This word is misspelled upstream
|
# This word is misspelled upstream
|
||||||
|
|
|
||||||
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -6270,6 +6270,7 @@ dependencies = [
|
||||||
"rustls",
|
"rustls",
|
||||||
"semver",
|
"semver",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_cbor_2",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"subtle",
|
"subtle",
|
||||||
"svg-hush",
|
"svg-hush",
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,9 @@ oidc-accept-string-booleans = ["openidconnect/accept-string-booleans"]
|
||||||
# Currently only used to enable rusts official ip support
|
# Currently only used to enable rusts official ip support
|
||||||
unstable = []
|
unstable = []
|
||||||
|
|
||||||
|
# Enables special test mode features. This should NEVER be enabled in production
|
||||||
|
unsafe_test_mode = ["dep:serde_cbor_2"]
|
||||||
|
|
||||||
[target."cfg(unix)".dependencies]
|
[target."cfg(unix)".dependencies]
|
||||||
nix = { version = "0.31.3", features = ["fs"] }
|
nix = { version = "0.31.3", features = ["fs"] }
|
||||||
# Logging
|
# Logging
|
||||||
|
|
@ -107,7 +110,7 @@ serde = { version = "1.0.229", features = ["derive"] }
|
||||||
serde_json = "1.0.154"
|
serde_json = "1.0.154"
|
||||||
|
|
||||||
# A safe, extensible ORM and Query builder
|
# A safe, extensible ORM and Query builder
|
||||||
diesel = { version = "2.3.14", features = ["chrono", "r2d2", "numeric"] }
|
diesel = { version = "2.3.14", features = ["chrono", "r2d2", "numeric", "64-column-tables"] }
|
||||||
diesel_migrations = "2.3.2"
|
diesel_migrations = "2.3.2"
|
||||||
|
|
||||||
derive_more = { version = "2.1.1", features = [
|
derive_more = { version = "2.1.1", features = [
|
||||||
|
|
@ -157,6 +160,7 @@ yubico_ng = { version = "1.0.0", default-features = false }
|
||||||
webauthn-rs = { version = "0.5.5", features = ["danger-allow-state-serialisation", "danger-credential-internals"] }
|
webauthn-rs = { version = "0.5.5", features = ["danger-allow-state-serialisation", "danger-credential-internals"] }
|
||||||
webauthn-rs-proto = "0.5.5"
|
webauthn-rs-proto = "0.5.5"
|
||||||
webauthn-rs-core = "0.5.5"
|
webauthn-rs-core = "0.5.5"
|
||||||
|
serde_cbor_2 = { version = "0.13.0", optional = true }
|
||||||
|
|
||||||
# Handling of URL's for WebAuthn and favicons
|
# Handling of URL's for WebAuthn and favicons
|
||||||
url = "2.5.8"
|
url = "2.5.8"
|
||||||
|
|
|
||||||
59
SECURITY.md
59
SECURITY.md
|
|
@ -1,49 +1,38 @@
|
||||||
Vaultwarden tries to prevent security issues but there could always slip something through.
|
Vaultwarden tries to prevent security issues, but something could always slip through. If you believe you've found a security issue in our application, we encourage you to notify us. We welcome working with you to resolve the issue promptly. Thanks in advance!
|
||||||
If you believe you've found a security issue in our application, we encourage you to
|
|
||||||
notify us. We welcome working with you to resolve the issue promptly. Thanks in advance!
|
|
||||||
|
|
||||||
# Disclosure Policy
|
# Scope
|
||||||
|
|
||||||
- Let us know as soon as possible upon discovery of a potential security issue, and we'll make every
|
Security issues in the current release of Vaultwarden and in the `main` branch (the `testing` image) are in scope. Our [threat model](THREAT_MODEL.md) describes who is trusted with what, what is out of scope, and how we rate severity. Please read it before reporting.
|
||||||
effort to quickly resolve the issue.
|
|
||||||
- Provide us a reasonable amount of time to resolve the issue before any disclosure to the public or a
|
|
||||||
third-party. We may publicly disclose the issue before resolving it, if appropriate.
|
|
||||||
- Make a good faith effort to avoid privacy violations, destruction of data, and interruption or
|
|
||||||
degradation of our service. Only interact with accounts you own or with explicit permission of the
|
|
||||||
account holder.
|
|
||||||
|
|
||||||
# In-scope
|
# How to report a security issue
|
||||||
|
|
||||||
- Security issues in any current release of Vaultwarden. Source code is available at https://github.com/dani-garcia/vaultwarden. This includes the current `latest` release and `main / testing` release.
|
- Let us know as soon as possible upon discovery of a potential security issue, and we'll make every effort to quickly resolve the issue.
|
||||||
|
- Provide us a reasonable amount of time to resolve the issue before any disclosure to the public or a third party. We may publicly disclose the issue before resolving it, if appropriate.
|
||||||
|
- Credit goes on the advisory and needs a GitHub account or email address. Reports of an issue whose fix is already public, from the moment its pull request is opened, are normally not credited.
|
||||||
|
- Vaultwarden is an open source project and does not offer rewards.
|
||||||
|
|
||||||
# Exclusions
|
Vaultwarden has no hosted service. Test only on instances you run yourself, and make a good-faith effort to avoid privacy violations, destruction of data, and interruption or degradation of other people's servers. Only interact with accounts you own or with the explicit permission of the account holder.
|
||||||
|
|
||||||
The following bug classes are out-of scope:
|
|
||||||
|
|
||||||
- Bugs that are already reported on Vaultwarden's issue tracker (https://github.com/dani-garcia/vaultwarden/issues)
|
|
||||||
- Bugs that are not part of Vaultwarden, like on the web-vault or mobile and desktop clients. These issues need to be reported in the respective project issue tracker at https://github.com/bitwarden to which we are not associated
|
|
||||||
- Issues in an upstream software dependency (ex: Rust, or External Libraries) which are already reported to the upstream maintainer
|
|
||||||
- Attacks requiring physical access to a user's device
|
|
||||||
- Issues related to software or protocols not under Vaultwarden's control
|
|
||||||
- Vulnerabilities in outdated versions of Vaultwarden
|
|
||||||
- Missing security best practices that do not directly lead to a vulnerability (You may still report them as a normal issue)
|
|
||||||
- Issues that do not have any impact on the general public
|
|
||||||
|
|
||||||
While researching, we'd like to ask you to refrain from:
|
While researching, we'd like to ask you to refrain from:
|
||||||
|
|
||||||
- Denial of service
|
- Denial of service against servers you do not run. You can still report availability issues you reproduce on your own instance.
|
||||||
- Spamming
|
- Spamming.
|
||||||
- Social engineering (including phishing) of Vaultwarden developers, contributors or users
|
- Social engineering (including phishing) of Vaultwarden developers, contributors or users.
|
||||||
|
|
||||||
Thank you for helping keep Vaultwarden and our users safe!
|
A good report covers one root cause and states the version or commit you tested, the lowest privileges needed, what the attacker gains, any non-default settings, the steps to reproduce it, and whether you ran them or only read the code.
|
||||||
|
|
||||||
|
If you use AI tools, you remain responsible for what you send. Reproduce the issue on your own instance before reporting it, check its scope and severity against our threat model rather than the tool's assessment, and include the requests, responses or logs that show it.
|
||||||
|
|
||||||
# How to contact us
|
# How to contact us
|
||||||
|
|
||||||
- You can contact us on Matrix https://matrix.to/#/#vaultwarden:matrix.org (users: `@danig:matrix.org` and/or `@blackdex:matrix.org`)
|
- You can open a [private vulnerability report](https://github.com/dani-garcia/vaultwarden/security/advisories/new) on GitHub.
|
||||||
- You can send an  to report a security issue.<br>
|
- You can send an  to report a security issue.<br>
|
||||||
If you want to send an encrypted email you can use the following GPG key: 13BB3A34C9E380258CE43D595CB150B31F6426BC<br>
|
If you want to send an encrypted email, you can use the following GPG key: `13BB3A34C9E380258CE43D595CB150B31F6426BC`<br>
|
||||||
It can be found on several public GPG key servers.<br>
|
It can be found on several public GPG key servers.<br>
|
||||||
* https://keys.openpgp.org/search?q=security%40vaultwarden.org
|
- https://keys.openpgp.org/search?q=security%40vaultwarden.org
|
||||||
* https://keys.mailvelope.com/pks/lookup?op=get&search=security%40vaultwarden.org
|
- https://keys.mailvelope.com/pks/lookup?op=get&search=security%40vaultwarden.org
|
||||||
* https://pgpkeys.eu/pks/lookup?search=security%40vaultwarden.org&fingerprint=on&op=index
|
- https://pgpkeys.eu/pks/lookup?search=security%40vaultwarden.org&fingerprint=on&op=index
|
||||||
* https://keyserver.ubuntu.com/pks/lookup?search=security%40vaultwarden.org&fingerprint=on&op=index
|
- https://keyserver.ubuntu.com/pks/lookup?search=security%40vaultwarden.org&fingerprint=on&op=index
|
||||||
|
- You can contact us on Matrix for questions, without vulnerability details: https://matrix.to/#/#vaultwarden:matrix.org (users: `@danig:matrix.org` and/or `@blackdex:matrix.org`).
|
||||||
|
|
||||||
|
Thank you for helping keep Vaultwarden and our users safe!
|
||||||
|
|
|
||||||
148
THREAT_MODEL.md
Normal file
148
THREAT_MODEL.md
Normal file
|
|
@ -0,0 +1,148 @@
|
||||||
|
# Vaultwarden threat model
|
||||||
|
|
||||||
|
To report a security issue, see [SECURITY.md](SECURITY.md).
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Vaultwarden is an unofficial, self-hosted server for the Bitwarden clients, written in Rust. It stores encrypted vaults, handles login, two-factor authentication, organizations, file and text sharing through Send, and emergency access, and provides an admin panel for the operator. It is not affiliated with Bitwarden. The browser, desktop, mobile and CLI clients come from Bitwarden. Our container images include a web vault built from Bitwarden's web client with our own patches.
|
||||||
|
|
||||||
|
## Security expectations
|
||||||
|
|
||||||
|
### Deployment
|
||||||
|
|
||||||
|
We expect a TLS-terminating reverse proxy in front of the server, `DOMAIN` set to its public URL, and an operator who keeps the host secure. This model covers Vaultwarden itself. Third-party software that consumes its output or sits in front of it, such as log parsers and reverse proxies, is the operator's to configure and secure.
|
||||||
|
|
||||||
|
### Encryption
|
||||||
|
|
||||||
|
Clients encrypt vault contents end to end. The server stores and serves ciphertext it cannot decrypt, and it never sees the master password. The server enforces access to data and actions itself, without relying on a client to behave. A few settings rely on the client for part of their effect, listed under [Out of scope](#out-of-scope).
|
||||||
|
|
||||||
|
A member receives the organization key when they are confirmed. Invited and accepted members do not have it. A revoked member who was once confirmed may still have it. Every confirmed member holds the same key for the whole organization, so only the server separates collections.
|
||||||
|
|
||||||
|
The server can read everything that is not end-to-end encrypted, such as user, group, device and organization names, email addresses, who owns what, item types and timestamps, attachment sizes, password hints, the stored master password hash and KDF settings, the TOTP and other 2FA secrets that protect login to the account, API keys, refresh tokens, security stamps, the JWT signing key, and SMTP and push credentials. TOTP secrets that users store in vault items are end-to-end encrypted with the rest of the item.
|
||||||
|
|
||||||
|
Someone who controls the server can also serve a modified web vault, so end-to-end encryption does not protect web vault users from them.
|
||||||
|
|
||||||
|
### Trust
|
||||||
|
|
||||||
|
Registration is open by default (`SIGNUPS_ALLOWED=true`), but many personal and small-team instances turn it off, so holding an account usually implies a minimal level of trust. Account holders are still never trusted with anyone else's data. Members of an organization have some trust in each other.
|
||||||
|
|
||||||
|
| Actor | Can reach | Must not reach |
|
||||||
|
|---|---|---|
|
||||||
|
| Anonymous internet | Login, prelogin, registration, public Send access, icons, the anonymous notifications hub, static files | Any vault, organization or member data; Sends they have no link to; the admin panel; the internal network through outbound requests |
|
||||||
|
| Websites and icon sources | The icon fetcher, through any response, redirect or DNS answer; the server, through cross-site requests from a visitor's browser | The internal network through outbound requests; script on the vault origin; acting through a visitor's session |
|
||||||
|
| Registered user | Their own vault, Sends, devices and settings; organizations they belong to | Another user's data; any other organization; raising their own role or status |
|
||||||
|
| Invited or accepted member | Accepting the invitation, enrolling in account recovery, and the organization's name, public key and policies | Items, collections, the member list, the organization key, any other privileged action before confirmation |
|
||||||
|
| Revoked member | Nothing in that organization | Any organization data from the server, even data they could once read |
|
||||||
|
| Organization User | Items in assigned collections, with `read_only` and `manage` enforced by the server | Other collections, write access to read-only collections, Admin-level metadata |
|
||||||
|
| Organization Manager (a legacy role, shown as Custom in clients) | The above, plus managing collections where they have `manage`. With "Manage all collections" (`access_all`), every collection and full member and group details | Without `access_all`: managing other collections, full member and group details. Always: changing policies or roles |
|
||||||
|
| Organization Admin | All data in that organization, members below Owner (some actions on Managers and Admins are limited to Owners), policies, events, account recovery for enrolled members below Owner | Owners, other organizations, the personal vault of a member who is not enrolled in recovery, the organization API key |
|
||||||
|
| Organization Owner | The whole organization, including account recovery for enrolled members | Other organizations, the personal vault of a member who is not enrolled in recovery |
|
||||||
|
| Organization API key holder (Owner-issued) | Directory import into its own organization | Other organizations, item content, Owners |
|
||||||
|
| Send recipient | One Send, within its limits | Other Sends, access beyond the configured limits, the owner's vault |
|
||||||
|
| Emergency access grantee | After approval or the wait time: the access the grantor configured, which can be full takeover by design | Anything before that, or more than the access the grantor configured |
|
||||||
|
| Admin panel (`ADMIN_TOKEN`) | All users, organizations and settings | No limit once authenticated |
|
||||||
|
| Host operator, database and data folder access | Everything | No limit |
|
||||||
|
| Services the operator configures (SSO provider, SMTP server, push relay, S3 endpoint, Yubico) | What they need for their function | Vault contents |
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
Optional features that operators turn on, other than experimental and beta ones, carry the same expectations as the defaults, such as SSO, organization events, anything needing SMTP (email 2FA, invitations), push, S3 storage, the admin panel, and the MySQL and PostgreSQL backends.
|
||||||
|
|
||||||
|
Some settings remove a protection on purpose, and using them is the operator's choice: `DISABLE_ADMIN_TOKEN`, a plain-text `ADMIN_TOKEN`, `IP_HEADER_TRUSTED_PROXIES=all` on a directly exposed instance, turning off `HTTP_REQUEST_BLOCK_NON_GLOBAL_IPS`, `SSO_DEBUG_TOKENS`, `SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION`, `SSO_PKCE=false`, `SHOW_PASSWORD_HINT`, `SMTP_SECURITY=off`, `SMTP_ACCEPT_INVALID_CERTS`, `SMTP_ACCEPT_INVALID_HOSTNAMES`, `SMTP_DEBUG`, `ALLOWED_IFRAME_ANCESTORS`, `ALLOWED_CONNECT_SRC`, and `LOG_LEVEL` set to `debug` or `trace`. Issues that need one of them are out of scope.
|
||||||
|
|
||||||
|
### Upstream Bitwarden
|
||||||
|
|
||||||
|
Where this document does not cover a behavior, we follow upstream Bitwarden by default.
|
||||||
|
|
||||||
|
## Out of scope
|
||||||
|
|
||||||
|
These are intended behavior or outside this model. Several match upstream Bitwarden.
|
||||||
|
|
||||||
|
- What an admin token holder or the host operator can do, including running code on the server. We expect them to have admin access to the machine.
|
||||||
|
- Organization Owners and Admins reading all organization data, and account recovery of enrolled members.
|
||||||
|
- Organization Managers listing basic member details, such as names and emails. Upstream allows this for all members.
|
||||||
|
- Settings the client applies: `hide_passwords` ("hidden passwords" in the clients), master password reprompt, and organization policies on values the server never sees, such as master password complexity and password generator rules. The client already holds the data.
|
||||||
|
- Bugs in Bitwarden's client code, including in the web vault we bundle, such as CSV formula injection (exports are built in the browser) or a client failing on a malformed stored value. The advisory and CVE for those belong to Bitwarden. Report them through [Bitwarden's HackerOne program](https://hackerone.com/bitwarden/). When the bundled web vault is affected, we ship a security release that references theirs. Bugs that our own web vault patches add are ours.
|
||||||
|
- The server not decrypting or authenticating ciphertext. It holds no key.
|
||||||
|
- `/identity/accounts/prelogin` and `/identity/accounts/prelogin/password` returning KDF settings for any email, with deterministic fake settings for unknown ones.
|
||||||
|
- Login timing not being equalized.
|
||||||
|
- Probing whether an icon is already cached. Setting `ICON_SERVICE` to an external service avoids it.
|
||||||
|
- Download link replay: an attachment token or Send access token being reusable by its holder until it expires (1 and 2 minutes), and object storage presigned URLs that we cannot count or revoke. The holder already has the content.
|
||||||
|
- Short-lived tokens that stay valid after an authorization change elsewhere until they expire, such as an organization API token (1 hour) after its key is rotated. This includes connections the notifications WebSocket accepted before the change, which stay open and carry change notifications and device login requests, not vault data.
|
||||||
|
- The access token in the notifications WebSocket's `access_token` query parameter, which reverse proxies may log. Clients send it that way, and our [hardening guide](https://github.com/dani-garcia/vaultwarden/wiki/Hardening-Guide#access-logs-contain-access_token-parameter) covers redacting it.
|
||||||
|
- A client's tokens staying valid after it logs out. Logging out discards them on that device, as upstream, and deauthorizing sessions or changing the password ends them.
|
||||||
|
- The personal API key skipping 2FA, and working after a password change until the user rotates it. It is a separate credential.
|
||||||
|
- A linked SSO identity still logging in after a master password change, and the SSO provider deciding how long a session lasts (`SSO_AUTH_ONLY_NOT_SESSION` turns that off). The provider manages that credential, and it doesn't unlock the vault.
|
||||||
|
- A revoked or removed member's login session staying valid. It belongs to their own account, and the server checks membership on every request.
|
||||||
|
- A revoked or removed member keeping what their client already synced, and the organization key not being rotated when a member leaves.
|
||||||
|
- Unauthenticated requests to `/api/devices/identifier/<id>/clear-token`. The impact is delayed push delivery.
|
||||||
|
- Limits we leave out or keep simple by design: no cap on the number of items a user stores, no cleanup of attachments reserved but never uploaded, and rate limits kept in memory per process and IP, which reset on restart and are shared by users behind one address.
|
||||||
|
- Log injection. It only affects software that parses our logs, such as Fail2Ban with our community wiki's filters.
|
||||||
|
- Attacks that need a missing or misconfigured reverse proxy, such as one not sending `X-Forwarded-Proto` (it decides the admin cookie's `Secure` flag).
|
||||||
|
- Attacks that need another component to break its own specification, such as a NAT64 translator that forwards the `64:ff9b::/96` prefix to private addresses, against RFC 6052.
|
||||||
|
- Outbound requests to the SSO provider, Yubico server or S3 endpoint the operator configures, which skip the outbound filter and can be on the internal network.
|
||||||
|
- File permissions in the data folder. Host security belongs to the operator.
|
||||||
|
- Attacks that need physical access to a user's device.
|
||||||
|
- Self-exploitation, where someone can only affect their own account, such as self-XSS or weak KDF settings they choose.
|
||||||
|
- Text that users choose showing up in emails or pages, such as an organization, user or device name, as long as it can't cause XSS or modify the page.
|
||||||
|
- Dependency and base image CVEs without a path reachable through Vaultwarden.
|
||||||
|
- Packages, images and deployment templates that we don't publish. Report those to their maintainers.
|
||||||
|
- Missing best practices with no demonstrated impact, such as security headers, `style-src 'unsafe-inline'` (the web vault needs it) or version disclosure, and design recommendations without a concrete issue.
|
||||||
|
- Bugs already reported on our [issue tracker](https://github.com/dani-garcia/vaultwarden/issues).
|
||||||
|
- Experimental and beta features. They are opt-in and outside this model until they are stable.
|
||||||
|
- Issues that only affect outdated versions.
|
||||||
|
|
||||||
|
## Severity
|
||||||
|
|
||||||
|
We rate issues by what the attacker ends up with, such as decrypted data, ciphertext, or the power to change or delete data, and by the access they needed first. An attack that needs no account usually rates higher than one that does. Our ratings can differ from CVSS 3.1, which doesn't translate well to an end-to-end encrypted system. Older advisories may be rated differently.
|
||||||
|
|
||||||
|
Denial of service and resource exhaustion only count if they still apply with a reverse proxy in front. Races, denial of service and resource exhaustion are never rated above Medium.
|
||||||
|
|
||||||
|
Secrets written to logs at the default log level are rated by what they give someone who can read the logs but not the host.
|
||||||
|
|
||||||
|
### Critical
|
||||||
|
|
||||||
|
- Reading another account's data decrypted, with or without an account, such as through script on the vault origin or exposed key material.
|
||||||
|
- Code execution on the server by anyone other than an admin token holder.
|
||||||
|
- Changing released builds or images, including through our CI workflows or their secrets.
|
||||||
|
- Anyone other than the named grantee reaching an emergency access outcome.
|
||||||
|
- With no account: forging login or admin tokens, reading the JWT signing key, reaching the admin panel without the token, or taking over accounts with no action by the victim.
|
||||||
|
|
||||||
|
### High
|
||||||
|
|
||||||
|
- Decrypted reads within the same organization, such as a member reaching collections they are not assigned to.
|
||||||
|
- Changing or deleting another user's or organization's existing data.
|
||||||
|
- Reading another user's server-held secrets, such as their 2FA secrets, API keys, stored master password hash or encrypted user key.
|
||||||
|
- SSRF that returns the response to the attacker.
|
||||||
|
- Escalating within an organization.
|
||||||
|
- Account takeover through SSO.
|
||||||
|
- The named emergency access grantee reaching the outcome early.
|
||||||
|
- Script or a cross-site request acting through an admin panel session.
|
||||||
|
- Script on the vault origin that needs unusual victim interaction.
|
||||||
|
|
||||||
|
### Medium
|
||||||
|
|
||||||
|
- Ciphertext read by someone with no key.
|
||||||
|
- Defeating login brute-force protection.
|
||||||
|
- 2FA bypass that needs the password, such as a remembered device still skipping 2FA after the method is removed.
|
||||||
|
- A refresh token still working after a password change or "Deauthorize sessions".
|
||||||
|
- Getting past an organization policy the server enforces.
|
||||||
|
- Adding data to another user's or organization's space without permission.
|
||||||
|
- Data loss for another user or organization that the attacker cannot reliably trigger or aim.
|
||||||
|
- SSRF where the response is filtered or blind.
|
||||||
|
- Reading a Send that is disabled or expired.
|
||||||
|
- Denial of service that lasts until someone restarts the server or repairs data, from one request with no account in the default configuration.
|
||||||
|
|
||||||
|
### Low
|
||||||
|
|
||||||
|
These may be handled as ordinary hardening.
|
||||||
|
|
||||||
|
- Behavior that differs from upstream Bitwarden with low impact.
|
||||||
|
- Bypassing a non-default limit, such as `USER_ATTACHMENT_LIMIT`.
|
||||||
|
- Metadata across a boundary, such as who is assigned to which collection.
|
||||||
|
- Exceeding a Send's access limits when the attacker already holds the link.
|
||||||
|
- A missing rate limit outside login.
|
||||||
|
- Forging organization audit events.
|
||||||
|
- Other ways to tell whether an email has an account.
|
||||||
|
- Denial of service that lasts until someone acts, from one operation that needs an account or a non-default setting.
|
||||||
|
- Denial of service that lasts only while the attacker keeps going or that recovers by itself, such as a crash the container restarts from.
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
-- A blob-encrypted cipher keeps all of its content in `data`, up to 500,000 characters, so the
|
||||||
|
-- 64 KiB of TEXT is too small. Like upstream, which uses LONGTEXT.
|
||||||
|
ALTER TABLE ciphers MODIFY data LONGTEXT NOT NULL;
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
DROP TABLE IF EXISTS user_signature_key_pairs;
|
||||||
|
|
||||||
|
ALTER TABLE users DROP COLUMN signed_public_key;
|
||||||
|
ALTER TABLE users DROP COLUMN security_state;
|
||||||
|
ALTER TABLE users DROP COLUMN security_version;
|
||||||
14
migrations/mysql/2026-10-09-120000_user_crypto_v2/up.sql
Normal file
14
migrations/mysql/2026-10-09-120000_user_crypto_v2/up.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
ALTER TABLE users ADD COLUMN signed_public_key TEXT;
|
||||||
|
ALTER TABLE users ADD COLUMN security_state TEXT;
|
||||||
|
ALTER TABLE users ADD COLUMN security_version INTEGER;
|
||||||
|
|
||||||
|
CREATE TABLE user_signature_key_pairs (
|
||||||
|
uuid CHAR(36) NOT NULL PRIMARY KEY,
|
||||||
|
user_uuid CHAR(36) NOT NULL UNIQUE,
|
||||||
|
signature_algorithm INTEGER NOT NULL, -- 0 = ed25519, 1 = mldsa44
|
||||||
|
signing_key TEXT NOT NULL,
|
||||||
|
verifying_key TEXT NOT NULL,
|
||||||
|
created_at DATETIME NOT NULL,
|
||||||
|
updated_at DATETIME NOT NULL,
|
||||||
|
FOREIGN KEY (user_uuid) REFERENCES users (uuid) ON DELETE CASCADE
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
-- Dropping the permissions would silently take them away from the Custom members, who would also keep a role (4) the
|
||||||
|
-- versions before this one don't know. So while there are any, this fails on the duplicate key below, before anything
|
||||||
|
-- is dropped: change their role first, or restore the backup taken before the upgrade.
|
||||||
|
-- A failed attempt leaves the temporary table on this connection. Clear it before retrying.
|
||||||
|
DROP TEMPORARY TABLE IF EXISTS custom_role_downgrade;
|
||||||
|
CREATE TEMPORARY TABLE custom_role_downgrade (blocked_by VARCHAR(255) NOT NULL PRIMARY KEY);
|
||||||
|
INSERT INTO custom_role_downgrade VALUES ('Custom members: change their role first, or restore the backup taken before the upgrade');
|
||||||
|
INSERT INTO custom_role_downgrade
|
||||||
|
SELECT 'Custom members: change their role first, or restore the backup taken before the upgrade'
|
||||||
|
FROM users_organizations WHERE atype = 4 LIMIT 1;
|
||||||
|
DROP TEMPORARY TABLE custom_role_downgrade;
|
||||||
|
|
||||||
|
ALTER TABLE users_organizations
|
||||||
|
DROP COLUMN manage_users,
|
||||||
|
DROP COLUMN manage_groups,
|
||||||
|
DROP COLUMN manage_policies,
|
||||||
|
DROP COLUMN create_new_collections,
|
||||||
|
DROP COLUMN edit_any_collection,
|
||||||
|
DROP COLUMN delete_any_collection,
|
||||||
|
DROP COLUMN access_event_logs,
|
||||||
|
DROP COLUMN access_import_export,
|
||||||
|
DROP COLUMN access_reports;
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
-- The granular permissions of the Custom member role. They only take effect on a Custom membership
|
||||||
|
-- (atype 4) while EXPERIMENTAL_CUSTOM_ROLES is enabled, and every existing membership starts without any.
|
||||||
|
-- A single statement, so an interrupted upgrade cannot leave only some of the columns behind.
|
||||||
|
ALTER TABLE users_organizations
|
||||||
|
ADD COLUMN manage_users BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN manage_groups BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN manage_policies BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN create_new_collections BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN edit_any_collection BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN delete_any_collection BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN access_event_logs BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN access_import_export BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
ADD COLUMN access_reports BOOLEAN NOT NULL DEFAULT FALSE;
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
-- Key rotations before this kept the id of the old user key, so every new
|
||||||
|
-- cipher was refused from then on. Stale ids can't be told apart, so clear
|
||||||
|
-- all of them; clients record their current key's id again when it's empty.
|
||||||
|
UPDATE users SET key_id = NULL;
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE users DROP COLUMN v2_upgrade_token;
|
||||||
|
ALTER TABLE users_organizations DROP COLUMN v2_upgrade_token;
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE users ADD COLUMN v2_upgrade_token TEXT;
|
||||||
|
ALTER TABLE users_organizations ADD COLUMN v2_upgrade_token TEXT;
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue