π‘οΈ Warracker is an open source, self-hostable warranty tracker to monitor expirations, store receipts, files. You own the data, your rules!
Correct stored-XSS reporter credit to humidnhefty
Omega (QA)ccf9e2823643
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 58352bf..da90970 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -39,7 +39,7 @@- _Files: `backend/auth_routes.py`, `backend/auth_utils.py`- **Insecure direct file access via `/api/files/` fixed (reported by Malik Abdullah):** the legacy `/api/files/<path>` route served any uploaded document to any logged-in user with no ownership check and no regard for the admin's document-sharing (`global_view_enabled`) setting β while `/api/secure-file/` on the same files correctly returned 403. Verified live: with sharing disabled, a second account downloaded another user's invoice via `/api/files/` (200) while `/api/secure-file/` returned 403. Both routes now share a single `_check_file_authorization()` helper (owner, admin, or global-view setting), so they can no longer drift apart; `/api/files/` also gained the path-traversal guard. With sharing enabled (the default, intentional for family/team instances) cross-user access still works consistently on both routes. Credit: reported via responsible disclosure by [humidnhefty](https://github.com/humidnhefty) (Malik Abdullah, Lupine Security).- _Files: `backend/file_routes.py`-- **Stored XSS via warranty fields fixed (reported by lazymaster101 and the CSCE 413 Texas A&M team):** warranty cards rendered `product_name`, `vendor`, `model_number`, `warranty_type`, tag names, serial numbers, and the user display name into `innerHTML` without escaping, so a malicious value (e.g. injected through CSV import) executed JavaScript in every viewer's browser. All user-controlled fields are now HTML-escaped before rendering (quotes included, so attribute contexts are safe too), and `product_url` links now also reject `javascript:`/`data:`/`vbscript:` schemes. Verified with live payloads (`<img onerror>`, `<svg onload>`, attribute breakout, `javascript:` URL, malicious tag name) β all render as inert text. Credit: reported via responsible disclosure by [lazymaster101](https://github.com/lazymaster101) and the CSCE 413 (Texas A&M University) vulnerability-research team β Carrigan Royer, Jayani Singh, Seshadithya Saravanan, Aaditya Srinivasan, Miko Quinones.+- **Stored XSS via warranty fields fixed (reported by humidnhefty and the CSCE 413 Texas A&M team):** warranty cards rendered `product_name`, `vendor`, `model_number`, `warranty_type`, tag names, serial numbers, and the user display name into `innerHTML` without escaping, so a malicious value (e.g. injected through CSV import) executed JavaScript in every viewer's browser. All user-controlled fields are now HTML-escaped before rendering (quotes included, so attribute contexts are safe too), and `product_url` links now also reject `javascript:`/`data:`/`vbscript:` schemes. Verified with live payloads (`<img onerror>`, `<svg onload>`, attribute breakout, `javascript:` URL, malicious tag name) β all render as inert text. Credit: reported via responsible disclosure by [humidnhefty](https://github.com/humidnhefty) and the CSCE 413 (Texas A&M University) vulnerability-research team β Carrigan Royer, Jayani Singh, Seshadithya Saravanan, Aaditya Srinivasan, Miko Quinones.- _Files: `frontend/js/components/warrantyRenderer.js`, `frontend/js/components/claims.js`, `frontend/status.js`_- **Input validations are now enforced and translated:** three new HTTP 400 validations β product name over 255 chars (was an unhandled DB error β HTTP 500), expiration date before purchase date (was silently accepted), and invalid claim status (was silently coerced) β now return a stable machine-readable `code` (`product_name_too_long`, `expiration_before_purchase`, `invalid_claim_status`; claim-status errors also include `valid_statuses`) alongside the English fallback message. The frontend maps those codes to i18n keys via a new `apiErrorMessage()` helper in `ui.js` (used by the add-warranty form, edit modal, and claims toasts), so error toasts render in the user's language instead of always-English. Two new English keys were added (`messages.product_name_too_long`, `messages.invalid_claim_status`) and machine-translated into all 19 non-English locales with `{{statuses}}` placeholder integrity verified. Also removed the now-unused `safeErrorMessage()` helper from `apiService.js`.- _Files: `backend/warranties_routes.py`, `frontend/js/components/ui.js`, `frontend/js/services/apiService.js`, `frontend/js/components/addWarrantyForm.js`, `frontend/js/components/editModal.js`, `frontend/js/components/claims.js`, `locales/*/translation.json`_diff --git a/README.md b/README.mdindex 5b6d080..660c7ac 100644--- a/README.md+++ b/README.md@@ -336,7 +336,7 @@ This project is licensed under the GNU Affero General Public License v3.0 - see* i18next### Security researchers-* [lazymaster101](https://github.com/lazymaster101) and the CSCE 413 (Texas A&M University) vulnerability-research team β Carrigan Royer, Jayani Singh, Seshadithya Saravanan, Aaditya Srinivasan, Miko Quinones β for the responsible disclosure of a stored XSS vulnerability.+* [humidnhefty](https://github.com/humidnhefty) and the CSCE 413 (Texas A&M University) vulnerability-research team β Carrigan Royer, Jayani Singh, Seshadithya Saravanan, Aaditya Srinivasan, Miko Quinones β for the responsible disclosure of a stored XSS vulnerability.* [humidnhefty](https://github.com/humidnhefty) (Malik Abdullah, Lupine Security) β for the responsible disclosure of an authorization bypass on the `/api/files/` document-serving route.