Skip to content

Commit 83da394

Browse files
committed
chore: release 1.9.4 - security audit + mobile responsive overhaul
Rolls up two parallel reviews (mobile UX expert + security audit) into a single targeted release. Security (4 changes): - crypto.timingSafeEqual for API key compare - zip-bomb cap + path-traversal guard in .cbz import parser - Content-Security-Policy + Referrer-Policy headers on web responses - pre-extract ZIP entry-name guard in managed-mode install script Mobile / responsive (1 change, CSS-only): - @media breakpoints at 768/480px, touch-target sizing, iOS-zoom fix, safe-area-inset, area-dropdown viewport-constrained, table column hiding on narrow viewports. Skipped from the review pass after verification: C-Gate password / supervisor token logging (verified safe), SSE auth gate (matches project design where reads are open and writes auth-gated; single-endpoint exception would be inconsistent), CSRF (no cookie auth), HSTS (not behind HTTPS in addon mode), XXE (xml2js defaults safe), rate-limit-per-IP (HA Ingress internal-trust). Full notes in homeassistant-addon/CHANGELOG.md.
1 parent 352f735 commit 83da394

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

homeassistant-addon/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ All notable changes to the C-Gate Web Bridge Home Assistant add-on will be docum
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.9.4] - 2026-05-27
9+
10+
### Security
11+
12+
- **API key comparison is now constant-time** (`crypto.timingSafeEqual`). Removes the timing oracle the previous `===` comparison exposed.
13+
- **`.cbz` import is guarded against zip-bombs**. The parser pre-flights the sum of declared decompressed sizes for every ZIP entry against a 100MB cap (overridable via constructor) before extracting anything, so a small upload cannot blow up RAM. Defence-in-depth path-traversal guard on internal entry names extracted alongside.
14+
- **HTTP security headers** added on every response: `Content-Security-Policy` (locks resource loading to same-origin, killing the common third-party-script XSS payload pattern without breaking the bundled inline UI) and `Referrer-Policy: no-referrer` (prevents leaking the HA Ingress-tokenised URL to any external resource).
15+
- **Managed-mode install pre-flights ZIP entry names** for path-traversal (`..`) or absolute paths via a new `_cgateweb_verify_zip_safe` helper in `cgate-install.sh`. Runs before each `unzip` call. Modern unzip already strips these but the explicit guard makes any future tooling regression visible.
16+
17+
### Mobile / Responsive
18+
19+
- **Web UI is now responsive across all common viewport sizes** for both direct LAN access and HA Companion App (iframe-embedded via HA Ingress). Previously had zero `@media` breakpoints. Includes:
20+
- `viewport-fit=cover` + `env(safe-area-inset-*)` padding for notched phones.
21+
- `font-size: 16px` on all form inputs - eliminates the iOS auto-zoom-on-focus behaviour that previously fired every time a user tapped a label.
22+
- Touch targets enlarged on touch-primary devices (row checkboxes 22×22, buttons min-height 44px) per WCAG 2.5.5 / iOS HIG. Desktop mouse users keep the compact layout.
23+
- `<= 768px`: main labels table becomes horizontally scrollable; Entity ID and "unsaved" columns hide; tab bar tightens; toast spans full width.
24+
- `<= 480px`: Type column also hides; add-row and bulk toolbar stack vertically; header collapses; status bar single-column.
25+
- Area dropdown is constrained to viewport width on narrow screens so it can't shoot off the right edge.
26+
827
## [1.9.3] - 2026-05-27
928

1029
### Fixed

homeassistant-addon/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "C-Gate Web Bridge"
2-
version: "1.9.3"
2+
version: "1.9.4"
33
slug: cgateweb
44
description: "Bridge between Clipsal C-Bus systems and MQTT/Home Assistant"
55
url: "https://github.com/dougrathbone/cgateweb"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cgateweb",
3-
"version": "1.9.3",
3+
"version": "1.9.4",
44
"description": "Node.js bridge connecting Clipsal C-Bus automation systems to MQTT for Home Assistant integration",
55
"keywords": [
66
"cbus",

0 commit comments

Comments
 (0)