Skip to content

🛡️ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!

Changelog: record the security audit Low fixes

Omega (QA)d60f2dfbdadd
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f633ea0..b848160 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,24 @@
- _Files: `frontend/status.js`, `frontend/js/components/notes.js`, `frontend/style.css`, `backend/statistics_routes.py`_
- **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`, and `DB_POOL_WAIT_SECONDS`. The defaults match the previous pool size, so existing installs see no change unless they set them.
- _Files: `backend/auth_utils.py`, `backend/db_handler.py`_
+- **Security hardening, sign-in and password reset:** 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.
+ - _Files: `backend/auth_routes.py`, `tests/test_auth_enumeration_reset.py`_
+- **Security hardening, 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.
+ - _Files: `backend/oidc_handler.py`, `tests/test_oidc_userinfo_subject.py`_
+- **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_FILE` setting 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 unless `TRUST_PROXY_HEADERS` is 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 need `TRUST_PROXY_HEADERS=true` or the proxy address is recorded instead.
+ - _Files: `backend/config.py`, `backend/__init__.py`, `tests/test_secret_key_config.py`, `tests/test_proxy_and_framing.py`_
+- **Security hardening, 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: `backend/file_routes.py`, `backend/statistics_routes.py`, `backend/warranties_routes.py`, `tests/test_error_disclosure.py`_
+- **Security hardening, 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.
+ - _Files: `backend/file_routes.py`, `backend/warranties_routes.py`, `tests/test_file_access.py`, `tests/test_tag_ownership.py`, `tests/test_file_deletion.py`_
+- **Security hardening, 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.
+ - _Files: `backend/file_routes.py`, `backend/paperless_access.py`, `tests/test_paperless_lows.py`, `tests/test_paperless_security.py`, `tests/mock_paperless.py`_
+- **Security hardening, 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.
+ - _Files: `backend/warranties_routes.py`, `tests/test_photo_url.py`_
+- **Security hardening, 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.
+ - _Files: `frontend/js/components/tagManager.js`, `frontend/script.js`, `frontend/settings-new.js`, `tests/test_xss_regressions.py`_
+- **Security hardening, 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.
+ - _Files: `backend/admin_routes.py`, `tests/test_apprise_audit.py`_
## 1.0.6 - 2026-11-10