⚙️ Release 1.0.7 – Required Database Credentials, PKCE Sign-In, and Security Hardening
Version 1.0.7 is the security-hardening release. It completes the remediation of the internal security audit, removes the built-in database credential defaults announced in 1.0.5, adds PKCE (S256) for OIDC sign-in, and updates Authlib and Apprise. One breaking change: database credentials must now be set explicitly. Installs relying on the built-in defaults will not start until they are set, see Upgrading below.
🔑 Database Credentials
- Database credential defaults removed (#221, by Nam0101): the built-in defaults for
DB_USER,DB_PASSWORD,DB_ADMIN_USER, andDB_ADMIN_PASSWORDare gone, completing the deprecation announced in 1.0.5. The app, the migration runner, and the permissions script now stop with a clear message naming any missing required credential instead of falling back to known credentials.DB_USERandDB_PASSWORD(or aDATABASE_URLcontaining a username and password, now also honored by the Docker entrypoint readiness probe andfix_permissions.py) are required.DB_ADMIN_USERandDB_ADMIN_PASSWORDare optional with no built-in defaults: if both are omitted, existing installs upgrade without adding unused variables and fresh installs skip creating the optional PostgreSQL admin role; if only one is set, startup stops naming the missing counterpart so no role is ever created with a blank or default password. Both shipped Compose files, both env examples, and the Unraid template leave both admin variables commented out or optional with no prefilled defaults. - Database connections released earlier and the pool hardened (#297, by joaoalves03): authentication held a database connection, with its transaction open, for the whole request, so every authenticated request used two connections and the idle one could pin a pooler connection until the response was sent, stalling requests behind PgBouncer under load. The connection is now released before the route runs. The pool also moved to a locking pool, waits for a free connection instead of failing at once, returns each connection exactly once to the pool it came from, discards broken connections, and rebuilds itself if it was closed. New settings:
DB_POOL_MAX,DB_POOL_MIN, andDB_POOL_WAIT_SECONDS. The defaults match the previous pool size, so existing installs see no change unless they set them.
🔐 Sign-In and OIDC
- PKCE (S256) for OIDC sign-in (#288, suggested by John in Discord): the OIDC authorization code flow now uses PKCE when the identity provider supports it. At startup Warracker reads the provider discovery document, and if it advertises S256 in
code_challenge_methods_supported, the client is registered with PKCE enabled, so the authorization code is bound to a verifier only Warracker holds. Providers that do not advertise S256 keep the existing plain flow, and if the discovery document cannot be read at startup, sign-in continues without PKCE and a warning is logged. Nothing changes in the OIDC settings screens, and existing provider configurations need no changes. - Sign-in and password reset hardened: login no longer answers faster for unknown usernames than for wrong passwords, because the password check now runs unconditionally against a dummy hash when no stored hash exists, and an OIDC-only account attempting a local login gets the same invalid-credentials answer instead of a server error. Password reset tokens are now stored as hashes rather than in plain text, so a database copy alone cannot be used to reset accounts, and reset links now expire after 1 hour instead of 24. Reset links issued before this upgrade stop working, since accepting both forms would keep the old plain text values usable.
- OIDC subject check: when the identity provider returns a userinfo response whose subject differs from the verified ID token subject, sign-in is now refused instead of trusting the userinfo claims for the email, name, and groups. A userinfo response with no subject at all is still accepted, with a warning logged, since some providers omit it.
- OIDC-only mode enforced: the
oidc_only_modesetting was read by the login screen but ignored by the backend, so with only-mode on, a local login to an OIDC-only account failed with a server error, a password reset minted it a local password from nothing, and local registration stayed open. The backend now refuses local sign-in and local registration while only-mode is on, mints no reset token for an OIDC-managed account, and refuses reset completion for one. Local accounts can still request a reset under only-mode, for use if the mode is later turned off. Installs that rely on local sign-in while only-mode is on lose local access until an OIDC admin turns the mode off or theOIDC_ONLY_MODEvariable is set to false. - OIDC login without URL tokens: the SSO callback delivered the full 24 hour token in the redirect URL, where it persisted in browser history. The callback now stores a short-lived single-use code (60 seconds, only its hash stored) and redirects with it, and the frontend exchanges the code for the token over POST. Each code is deleted on first use, and the service worker cache name was bumped so browsers fetch the new redirect page. A user with a stale cached redirect page sees one failed sign-in attempt after the upgrade, then it works.
- Email changes require the current password: changing the account email in settings needed only a session token, so a stolen session could move the account to an attacker address and then take it over with a password reset to the new address. An email change now requires the current password, and a notice goes to the old address. Accounts with no local password (single sign-on) cannot change their email here; an administrator changes it instead. The separate change-email route already required the password and now sends the old-address notice too.
- Token revocation: an issued token stayed valid after logout, password change, and password reset, because the session table was written but never read for authentication and tokens carried no id. Tokens now carry a per-login id stored as the session row, and authentication refuses a token whose session row is gone. Logout deletes all sessions for the user, password change deletes all sessions except the current one, and password reset completion deletes them all. Tokens minted before this upgrade carry no id and stay valid until their 24 hour expiry.
- Auth rate limiting: the auth surface had no rate limiting: rapid failed logins drew no response, and repeated reset requests minted a token per request. Login now allows 10 failures per address and username pair in 5 minutes, then answers 429, and a successful login clears the count. Password reset requests are capped at 5 per email address per hour, with a capped request answering exactly like an unknown address and minting no token. The limiter is in memory per worker, so an install running two workers allows twice the budget to a distributed attacker. Registration is not limited.
- First-user race fixed: ten concurrent first registrations all succeeded and left two owners, because each checked the user count before any of them had committed. Registration and OIDC provisioning now take a database advisory lock before the user-count check, so exactly one becomes owner and admin. The lock is held only for the count and insert, never during password hashing, and releases at commit or rollback.
- SSO login fixed: the single-use code exchange added for OIDC sign-in used
awaitinside a plain (non-async) page-load callback, so the whole login redirect script failed to parse and sign-in through an identity provider stalled at "Authenticating, please wait..." with no error shown. The callback is now async, so the code exchange runs, the token and user info are stored, and sign-in completes. The no-params fallback redirect to the login page works again too.
🛡️ Security Hardening
- Deployment secrets and headers: a generated secret key is now written to the upload folder, which survives container recreation, instead of the working directory, and an existing key is migrated forward on first start. A new
SECRET_KEY_FILEsetting names an explicit key file location. If no key can be read or written anywhere, startup now stops with a clear message instead of falling back to a publicly known default key. The session cookie now gets the Secure flag automatically when the deployment's own public URL uses https, so plain HTTP installs keep working and HTTPS installs get the protection without a config change. Every response now carries a framing protection header, and forwarded headers are only honored from local and private-network peers unlessTRUST_PROXY_HEADERSis set, so a spoofed forwarded address can no longer be stored as the login IP when the app is directly exposed. Deployments behind a proxy on a public address needTRUST_PROXY_HEADERS=trueor the proxy address is recorded instead. - Error responses: Paperless search and tag failures, statistics failures, and file-save failures no longer return raw exception text to the client, which could disclose the internal Paperless host and port, API paths, and on-disk file paths. The full detail is still logged server side, and the client gets a short message naming the failed step, including a distinct message when Paperless rejects the credentials.
- Files and tags: documents served through the UI route are no longer cached by browsers for a year and now carry the same no-store and no-sniff headers as the secure route. Linking tags to a warranty now requires owning the tag, so one user's tag ids can no longer be attached to another user's warranty. File deletion now honors the configured upload folder instead of a hardcoded path, and bytes still referenced by another row or another column are kept when one reference is deleted or replaced.
- Paperless sharing: an upload in flight can no longer be claimed by another user linking its pending id, because the uploader now reclaims any ownership claim recorded after the upload started, while claims predating the upload are untouched. A duplicate upload no longer reveals another user's document id, and searching and linking by title now answers identically whether the document is missing or belongs to someone else. The Paperless tag list is now scoped to the documents the requesting user can see, instead of returning every tag on the instance, and the search page size forwarded to Paperless is capped at 100.
- Photo by URL: the address guard now also rejects NAT64 translation addresses and other translation wrappers embedding a private IPv4, which previously passed the public-address check. The fetch now has a total deadline (60 seconds by default, tunable with
PHOTO_FETCH_TIMEOUT_SECONDS) covering redirects and the body read, so a server dripping data slowly can no longer hold a fetch open indefinitely. - Rendering: tag names and colors are now escaped everywhere they render, in the tag picker, the selected-tag chips, Manage Tags, and the legacy tag renders, and the shared escaping helper now escapes quotes in every definition, so a quote in a tag name can no longer break out of an input value. The Settings Paperless debug, test-connection, and test-upload displays now escape the server-controlled strings they show, so a hostile Paperless reason phrase renders as text instead of markup.
- Apprise audit trail: Apprise test notifications and custom notifications now write an entry to the admin audit log, including whether per-request URLs were used and whether the send succeeded. The entries record only the URL schemes and the count, never hosts, paths, credentials, or notification content, since Apprise URLs embed secrets.
- Cross-origin requests: the API no longer reflects any Origin with credentials support when Flask is exposed directly. Cross-origin API calls with a Bearer token keep working exactly as before, but no credentials are honored cross-origin unless the operator names the allowed origins in the new
CORS_ALLOWED_ORIGINSsetting (a comma separated list). The shipped setup serves the frontend from the same origin, so existing installs need no change. - Response headers: every response now carries a Content-Security-Policy and a Referrer-Policy, from Flask for API responses and direct serving, and from nginx for the pages it serves. The policy keeps the app's own third-party calls working (the Buy Me a Coffee button, the version checker's GitHub fetch, and the Unsplash page background) while blocking plugins, foreign framing, and off-origin form submissions, and the referrer policy sends the full URL only to the same origin.
- Notification emails: the HTML part of expiration emails now escapes the recipient's first name and the product names, so markup typed into a name or product renders as text in the mailbox instead of live HTML. The plain text part is unchanged.
- Owner-role repair endpoint fixed: the admin endpoint for manually fixing the owner role returned a 500 error for every caller, because it imported its helper from the wrong module, and the error body disclosed the internal error text. It now imports the helper from where it lives and answers successfully, and failures return a generic message with the detail kept in the server log.
- Settings and audit trail: the settings endpoint now accepts only the known setting keys, so unknown keys in a request are ignored and named in the response instead of persisting silently. Audit entries for settings changes now mask the Apprise URLs value, which embeds credentials in the URL itself and previously landed in cleartext in the audit log; entries written before this upgrade still hold the old values. Ownership transfers now write an audit entry naming both accounts, where previously the change left no trace.
- Wizard summary: the Add Warranty summary step now builds its serial number list as text instead of markup, so a serial number typed with HTML in it renders as text instead of executing when the summary step opens.
- CSV import integrity and cost: one bad row used to abort the whole import transaction, so the commit at the end rolled everything back while the API still reported the rows imported before the failure. Each row now runs under its own savepoint, so a failed row is confined to itself and the reported counts are accurate. Duplicate renaming also restarted its suffix search at 1 for every row, so a same-name import re-checked every earlier suffix per row and a 5,000 row import ran for over 12 minutes; the search now resumes where the last row left off, and the same 5,000 row shape finishes in seconds with identical renaming.
- Paperless search and cleanup: the Paperless search response passed the upstream
allarray (the ids of every matching document instance-wide) and thepreviousURL (carrying the internal Paperless host) through to non-admin users, even when their own filtered result set was empty. Both are now stripped for non-admins. Cleanup of invalid Paperless references also treated any Paperless error as "document gone", so an outage unlinked live references. The handler now distinguishes exists, gone, and unknown, and cleanup only unlinks on gone; unreachable documents are left in place and reported as skipped. - Paperless documents without URL tokens: opening a Paperless document put the full token in the URL, where it persisted in browser history and in the service worker cache. Both document-open flows now fetch with the token in the Authorization header and open a blob URL instead. The API still accepts a token in the query string for direct links pasted into a browser.
- CSV export formulas: exported CSV carried formula-leading values with quoting only, so a spreadsheet app evaluated them on import. Values whose first non-space character is =, +, -, @, tab, or carriage return now get a tab prefix, which keeps them inert in the spreadsheet and is stripped by the importer, so a re-imported export round-trips to the stored value.
- CSV and claim dates: the importer and the claim endpoints accepted anything the date parser would read, so "03/04/2024" silently became March 4 (month-first). Only ISO YYYY-MM-DD and named-month dates are accepted now (15 Mar 2024, 15 March 2024, Mar 15, 2024, March 15, 2024, and the comma-less variants). Anything else, including ambiguous numeric dates, is rejected with an error naming the accepted formats. Imports that relied on flexible numeric dates need their dates rewritten.
🐛 Fixes
- Stray 401 after logout, fixed: the dashboard loads warranties in two requests, the main list and then the archived list merged into the All view. If logout happened while the first request was in flight, the second request went out after the token was cleared and drew a 401. No error was visible to the user, only a stray failed request in the network log. The list loader now re-checks authentication after the first request resolves and stops instead of fetching or rendering for a logged-out user.
- Status page detail now honors global view: with global view on, a plain user could see another user's warranty row on the status page but expanding it failed, because the detail endpoint restricted non-admins to their own warranties and ignored the global view setting, so no detail panel or Edit button appeared. The endpoint now follows the same rule as the warranty list: with global view enabled and not restricted to admins, any authenticated user may view any warranty. With global view off, or restricted to admins, non-owners are still turned away as before. Editing another user's warranty remains owner and admin only.
- Total Value popover no longer hides behind the charts: clicking the Total Value card opens a popover explaining how the total is calculated, but the pie chart painted over it on both desktop and mobile, hiding part of the text. The card's hover lift creates a stacking context that trapped the popover below the charts section, no matter how high the popover's own z-index was set. The card now carries its own z-index, so the popover renders above the charts.
- Edit button greyed out for warranties you cannot edit: now that the status page detail panel opens for another user's warranty under global view, its Edit button no longer promises an edit that fails on save. For a viewer who is neither the owner nor an admin, the button renders greyed out and disabled and does nothing on click. Owners and admins keep a working Edit button. The same disabled state applies to the Edit Warranty button in the notes modal, which opens from warranty cards. The main page cards already showed no Edit button for other users' warranties, so they are unchanged, and the server side restriction on editing is unchanged.
- Status page Edit button now opens the edit modal: on the status page the Edit button threw a ReferenceError and the modal never opened, for owners and admins alike, because the edit form calls a serial-number helper that only exists on pages loading the main app module tree. The status page now loads just that helper module, so the modal opens. Opening it also exposed a second failure in the same flow: a warranty with an exact expiration date and no duration opened with the duration method selected and all-zero duration, which the save validation refuses, so the method detection now infers the exact-date method from zero duration plus an expiration date, matching the main page edit modal. An edit started from the status page saves through the existing endpoint and refreshes the status table afterwards. The notes modal Edit Notes button is now disabled for viewers who are neither the owner nor an admin, matching the Edit Warranty button there, because notes save through the same ownership-gated endpoint and previously failed on save.
- Offline caching fixed on plain static hosting: the service worker precached two files that do not exist, and because the install cached everything atomically, one missing file rolled back the whole batch and left offline caching silently empty. The dead entries are gone, and the install now caches each file on its own, logging a warning for any file that fails instead of voiding the rest.
- Hebrew display name added to the language list: the language list endpoint returned a display name for every supported language except Hebrew, so Hebrew showed up without a name in language pickers. It now returns 'עברית', matching the other 19 languages.
🐳 Docker
- Docker image no longer logs a startup permission error: Gunicorn 26 tried to write to the home directory on startup, but the container process had no home set, so every start logged a Permission denied error for /root/.gunicorn. The app still started and worked, the error was only log noise. The gunicorn process now runs with HOME set to /home/warracker, so the error is gone.
- Cleaner Docker startup logs: the startup banner check and Docker
HEALTHCHECKpolled Nginx before Gunicorn finished booting, which logged transientconnect() failed (111: Connection refused)Nginx errors on every normal container start (and causedDISABLE_NGINX=truecontainers to fail the port-80 healthcheck), and supervisord logged every lifecycle line twice becausenodaemon=trueandlogfile=/dev/stdoutboth wrote to stdout. Both checks now verify Gunicorn (127.0.0.1:5000/api/health) before probing Nginx (skipping the port-80 probe whenDISABLE_NGINX=true), andsupervisord.confsetslogfile=/dev/null, keeping startup logs clean and single-printed. - Deployment config cleanups: the root Compose file no longer mounts a
backend/init.sqlfile that does not exist (it was deleted long ago while the mount remained), and the shipped nginx configuration now suppresses the version number in error pages and the Server header.
The Docker Build workflow now also runs end-to-end smoke tests against the built image: compose validation, a default stack boot with health, banner, version header, secret-key permissions, nginx headers, API CRUD, and JWT persistence across container recreation, a DATABASE_URL-only boot with no password leak in logs, DISABLE_NGINX mode, and fail-closed startup. The smoke tests caught the gunicorn HOME error above before this release shipped.
📦 Dependencies
- Authlib 1.9.5 and Apprise 2.2.0 (#291, #256): Authlib moves from 1.9.2 to 1.9.5, three upstream security releases: 1.9.3 refuses form_post responses to non-http(s) redirect URIs in the implicit and hybrid grants, 1.9.4 fixes ID-JAG user resolution for multi-tenant providers, and 1.9.5 completes the fix for CVE-2026-114615 by refusing public keys and certificates as HMAC secrets. Warracker uses Authlib as an OIDC client rather than an authorization server, so these are taken as auth-stack hygiene alongside the new PKCE support. Apprise moves from 1.13.1 to 2.2.0, a major release carrying the upstream security fix GHSA-cfp4-m43r-v9q4 and a dozen new notification services. Behavior changes in Apprise 2 that touch notifications:
notify()returns a detailed result object instead of True/False/None, deliveries to multiple targets run in parallel by default, and retries are tracked per target. Warracker reads the result the same way it always has, sent only when every target was delivered to, and the handler now coerces the result to a plain bool, so test, custom, and expiration notifications behave identically for callers. The deprecated Apprise options removed in 2.0 were not in use.
Upgrading: back up (database + uploads volume), pull the new image, recreate the container. Migrations run automatically on startup, including migration 055, the new OIDC login codes table. Read the breaking changes before you pull:
- Database credentials are now required. Set
DB_USERandDB_PASSWORDin.env(or aDATABASE_URLcontaining a username and password). The admin pair,DB_ADMIN_USERandDB_ADMIN_PASSWORD, is optional: omit both and no admin role is created; set only one and startup stops naming the missing one. Installs that relied on the built-in defaults must set the values first or the container stops with a clear message naming what is missing. - Password reset links issued before this upgrade stop working. Reset tokens are now stored as hashes and expire after 1 hour. Request a fresh link after upgrading.
- Tokens minted before this upgrade stay valid until their 24 hour expiry. Logout, password change, and password reset now revoke sessions, but a token issued before the upgrade carries no session id and cannot be revoked early.
- One failed SSO sign-in after the upgrade is expected for some users. The service worker cache name was bumped so browsers fetch the new redirect page; a user with a stale cached redirect page sees one failed sign-in attempt, then it works.
- OIDC-only mode now actually enforces itself. Installs relying on local sign-in while only-mode is on lose local access until an OIDC admin turns the mode off or
OIDC_ONLY_MODEis set to false. - CSV imports that relied on flexible numeric dates need their dates rewritten. Only ISO YYYY-MM-DD and named-month dates are accepted now.
Thanks to joaoalves03 for the database pool hardening (#297), Nam0101 for the database credential work (#221), and John in Discord for suggesting PKCE (#288).