Skip to content

fix(sensitive): keep Ring's push client alive on two-part Web Push headers (ADR-0110) - #1386

Merged
Gerrrt merged 3 commits into
mainfrom
gerrrt/ring-fcm-guard
Nov 10, 2026
Merged

Gerrrt merged 3 commits into
mainfrom
gerrrt/ring-fcm-guard

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

What changed

ring_push_guard gains a second version-gated patch, fcm_patch.py, for firebase_messaging 0.4.5. It reads the dh and salt Web Push header parameters by name. A push it still cannot decrypt is logged and acknowledged instead of shutting down Ring's push client. The new ADR-0110 records the decision, alongside ADR-0101. The changelog, roadmap, stack README, packages README and package comment are updated to match.

Why

ADR-0101's parser patch did not keep Ring events flowing. On trinity, the Ring event.* entities recorded no real event in the recorder's ten days (since 2026-10-31). The log on 2026-11-10 at 00:30 UTC has Unknown error: Incorrect padding, shutting down FcmPushClient.

firebase_messaging 0.4.5 slices crypto-key[3:] by position, and some Ring pushes now carry dh=…; p256ecdsa=… (sdb9696/firebase-messaging#44). The failure comes before the ACK, so FCM resends the push and the client dies again at every login. The upstream fix, sdb9696/firebase-messaging#43, is unreleased.

Refs #1383. Refs #1240: its removal step still waits on python-ring-doorbell#540/#556, and HA 2026.11.1 and dev still pin 0.9.14.

Blast radius

Home Assistant on trinity, sensitive tier only. The patch touches only the Ring push client's message handling, and only when firebase_messaging is 0.4.5. On any other version it logs a warning and patches nothing. If it is wrong, the worst case is the state before this PR: the Ring push client stops. There is no change to the mount, the package list or compose.

  • No change to network segmentation or firewall rules
  • No new port published to a VLAN that could not already reach the service
  • No credential added outside secrets/*.sops.yaml

Verification

Tested in the running ghcr.io/home-assistant/home-assistant:2026.11.1 container, against its own firebase_messaging 0.4.5. Pushes were encrypted with http_ece for a generated key:

== unpatched 0.4.5
vapid: RAISED Error: Incorrect padding
INFO Patched firebase_messaging 0.4.5 FcmPushClient._handle_data_message
== patch applied: True | again: True
vapid: ok, callback={'n': 'vapid'}
plain: ok, callback={'n': 'plain'}
reordered: ok, callback={'n': 'reordered'}
WARNING Dropped a push it could not decrypt (ValueError: data must not be an empty byte string; crypto-key: len=7 params=['dh']; encryption: len=29 params=['salt'])
ALL PASS

The header-parser cases from upstream #43's tests pass as well: unpadded, bare value, reordered, and a missing parameter that raises.

  • make validate passes, with caveats:

    • It was run with /usr/bin first on PATH. The mise python3 on trinity has no PyYAML.
    • Syslog senders first failed on a Docker subnet clash with a short-lived network on the shared host. Rerun on its own, it passed.
    • Skipped locally (no pipx): yamllint, ruff, ansible-lint. I ran ruff 0.17.4 (check . and format --check ., both clean) and yamllint 1.38.0 on the changed package (clean) in containers at the pinned versions. ansible-lint was not run; no Ansible changed.
    • Also skipped by design here: the deployment-checkout unit and timer checks, and the backup-offsite tmpfs case. CI runs these.
  • Deployed to the lab and confirmed working. This needs a Home Assistant restart after merge; Home Assistant: delete ring_push_guard's firebase_messaging patch once firebase-messaging ships the header fix (ADR-0110) #1383 tracks the day of motion events.

  • Docs updated (docs/, service README, or docs/roadmap.md)

🤖 Generated with Claude Code

…aders (ADR-0109)

firebase_messaging 0.4.5 slices the crypto-key and encryption headers by
position, and some Ring pushes now carry `dh=…; p256ecdsa=…`. Decoding
fails with "Incorrect padding", the client shuts down, and the push is
never acknowledged, so it comes back at every login. ADR-0101's parser
patch runs later and never sees it: on trinity no Ring event reached
Home Assistant from 2026-10-31.

ring_push_guard gains fcm_patch.py, gated to firebase_messaging 0.4.5.
It reads dh and salt by name, as sdb9696/firebase-messaging#43 does,
and logs and acknowledges a push it still cannot decrypt instead of
stopping the client. ADR-0109 records it; #1383 tracks the removal.

Refs #1383
Refs #1240

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical error path can log an entire bare crypto-key value when normalization fails, violating the no-key-material logging guarantee.

1 open issue
What changed in this PR

This PR extends ring_push_guard with a version-gated workaround for firebase_messaging 0.4.5, intended to keep Home Assistant’s Ring push receiver running when Web Push headers contain multiple parameters.

Changes:

  • Parse header parameters by name and catch message-handling failures so unreadable pushes can be acknowledged.
  • Apply both patches during setup and bump the component version to 1.1.0.
  • Record ADR-0109 and document each patch’s independent retirement conditions.
File Description
stacks/​sensitive/​README.md Describes both patches and their removal conditions.
stacks/​sensitive/​home-assistant/​packages/​ring_push_guard.yaml Updates comments describing protection and retirement.
stacks/​sensitive/​home-assistant/​packages/​README.md Documents the package’s expanded purpose.
stacks/​sensitive/​home-assistant/​custom_components/​ring_push_guard/​manifest.json Bumps the component version to 1.1.0.
stacks/​sensitive/​home-assistant/​custom_components/​ring_push_guard/​fcm_patch.py Adds header normalization and guarded message handling.
stacks/​sensitive/​home-assistant/​custom_components/​ring_push_guard/​__init__.py Applies both patches during integration setup.
README.md Updates the ADR count to 109.
docs/​roadmap.md Adds the upstream-release gate for retiring the new patch.
docs/​changelog.md Records the push failure and workaround.
docs/​adr/​0109-patch-firebase-messagings-header-parsing-locally-until-upstream-ships-a-fix.md Records the decision, verification, tradeoffs, and retirement plan.

Review effort: Balanced

…_push_guard

_shape logged the text before each segment's first "=" as a parameter
name. For a bare crypto-key value with no "dh=" prefix, that text is the
key itself, so a push that failed before its crypto-key was rewritten
put the whole key in the warning. Segments now log by name only when the
name is a known Web Push parameter, and as "<other>" otherwise.

Refs #1383

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt enabled auto-merge (squash) November 10, 2026 14:38
main took ADR-0109 for the VTech monitor (#1248), so the
firebase_messaging ADR becomes ADR-0110 and the README count 110. Both
2026-11-10 changelog entries are kept under the one date heading.

Refs #1383

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt Gerrrt changed the title fix(sensitive): keep Ring's push client alive on two-part Web Push headers (ADR-0109) fix(sensitive): keep Ring's push client alive on two-part Web Push headers (ADR-0110) Nov 10, 2026
@Gerrrt Gerrrt changed the title fix(sensitive): keep Ring's push client alive on two-part Web Push headers (ADR-0110) fix(sensitive): keep Ring's push client alive on two-part Web Push headers (ADR-0110) Nov 10, 2026
@Gerrrt
Gerrrt merged commit 2289d2c into main Nov 10, 2026
8 of 10 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/ring-fcm-guard branch November 10, 2026 14:58
Gerrrt added a commit that referenced this pull request Nov 10, 2026
…kers (#1390)

#1386 and #1384 both merged an ADR-0110 on 2026-11-10, which fails
check_docs.py's one-ADR-per-number rule on main. The eero ADR landed
second, and 0111 is held by open #1389, so it becomes ADR-0112. Every
current-state reference moves with it, README's ADR count goes to 111,
and a changelog correction entry records the renumbering. The same merges
left two diff3 base-marker lines in docs/changelog.md; they are removed.

Refs #1228.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants