Browser notifier follow-up: push only to public addresses, show no reply body, and retire withdrawn subscriptions #216
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#216
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #209, from the 2026-09-15 code audit. Three things in the Browser notifier are wrong as shipped.
1. Push goes through the connection client and echoes the reply
plugins/browser/__init__.py:85-97); onlyhttps://is checked (webpush.py:196).api.client(webpush.py:212-216), soPOSTULO_CONNECTIONS_ALLOW_PRIVATEgoverns it.webpush.py:241-245).test()returns that text, andConnectionTestViewshows it and stores it withrecord_test.tests/test_browser_notifier.pyswitches private destinations on just so the fake push service resolves, which hides the problem.Fix: a push service is always public, so use
public_only_client(follow_redirects=False). Report only the status code in errors. Stub DNS in the tests instead of turning the switch on, and add a test that a private endpoint is refused with the switch on.2. A withdrawn subscription is retried forever
webpush.pushraisesPushFailed(gone=True)on 404/410.send()leaves an inbox copy and re-raises;notifications/service.pyonly records the error..goneis read only bytest().Fix: on
gone, drop the subscription secret and switch the connection to Only while Postulo is open (or disable it). Leave an inbox notice saying why and how to allow notifications again.3. Reply text in
last_errorWhatever the fix for 1,
record_testandconnection.last_errorshould never hold a remote body. Check the other notifiers for the same pattern.