You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: a possible delivery is resent because webhook classification reads error.code, and a transient DNS failure blocks permanently #896
This card was previously the duplicate of #897. The two findings are the same; #896 is now the live card and #897 is closed as its duplicate. The full record is below.
Summary
Two defects in the notification webhook failure classification, in main today. Neither is a leak or an authz break; each writes a wrong delivery outcome into notification_outbox.
MEDIUM — a send that may have reached the destination is resent automatically
Expected: the row is unknown and the machine never claims it again. docs/security.md says "A send that may have reached the destination is unknown and is never replayed automatically."
Actual: isAmbiguousWebhookFailure() reads record.code from the top-level error (src/lib/webhook.ts:167-172). Undici rejects with TypeError: fetch failed and puts the socket code on error.cause.code; the predicate is false, postWebhook classifies it retry (:129-136), and the outbox sends again on the next pass.
LOW — a transient DNS failure blocks permanently
Expected: a resolver failure is retry.
Actual: every rejection from assertSafeWebhookUrl becomes blocked (src/lib/webhook.ts:113-118), including the resolution failures at :46-50 and the zero-address case at :76-79. blocked is terminal, so the notification is lost until a human notices it on /admin/notifications.
Fix
Read error.cause.code as well as error.code for the ambiguous set; keep the existing top-level TimeoutError/AbortError check.
Throw a distinct refusal only from the policy checks (scheme, credentials, allowlist, private/reserved address) and classify only that as blocked; a resolver failure (lookup throws, zero addresses) stays retry.
Red test
fetch rejects with Object.assign(new TypeError('fetch failed'), { cause: { code: 'ECONNRESET' } }) → unknown, and the next delivery pass does not claim it.
Keep the existing top-level TimeoutError → unknown.
Scope
src/lib/webhook.ts, test/notificationOutbox.test.ts, one security changelog fragment, and one clarifying clause in docs/security.md if blocked stops being the catch-all. T2. No schema change, no new config key.
Duplicate of #897 — closed as duplicate, nothing deleted, both bodies stay readable.
Both cards describe the same two defects in the webhook failure classification, opened three minutes apart from the same Security review of #847:
#897 (04:50:05Z, 5,590 B) carries the fuller record: the MEDIUM at src/lib/webhook.ts:165-172 where Undici puts ECONNRESET/EPIPE/UND_ERR_SOCKET on error.cause so a possible delivery is resent, breaking docs/security.md:436-437, plus the LOW at :113-118 where every assertSafeWebhookUrl failure becomes blocked.
#896 (this card, 04:47:17Z, 2,805 B) holds the same finding in shorter form.
The live card to work is #897; its evidence and Claims-verified-against pin are the ones a Dev must check. Rule going forward, recorded here so it is not repeated: Security checks for an existing card on the same defect before filing a new one, and a duplicate is closed as duplicate of #<n> with the reason, never deleted.
Reopened. The duplicate closure was a Lead triage decision, not the owner's. #897 remains the fuller card; if the owner agrees it is a duplicate, the owner closes it. No dispatch.
Activity
HugoXK commentedon Nov 16, 2026
Written-by: Fledge Platform Lead
Duplicate of
#897— closed as duplicate, nothing deleted, both bodies stay readable.Both cards describe the same two defects in the webhook failure classification, opened three minutes apart from the same Security review of
#847:#897(04:50:05Z, 5,590 B) carries the fuller record: the MEDIUM atsrc/lib/webhook.ts:165-172where Undici putsECONNRESET/EPIPE/UND_ERR_SOCKETonerror.causeso a possible delivery is resent, breakingdocs/security.md:436-437, plus the LOW at:113-118where everyassertSafeWebhookUrlfailure becomesblocked.#896(this card, 04:47:17Z, 2,805 B) holds the same finding in shorter form.The live card to work is
#897; its evidence andClaims-verified-againstpin are the ones a Dev must check. Rule going forward, recorded here so it is not repeated: Security checks for an existing card on the same defect before filing a new one, and a duplicate is closed asduplicate of #<n>with the reason, never deleted.HugoXK commentedon Nov 16, 2026
Written-by: HugoXK
Reopened. The
duplicateclosure was a Lead triage decision, not the owner's. #897 remains the fuller card; if the owner agrees it is a duplicate, the owner closes it. No dispatch.fix: classify a webhook reset on the error cause and retry a resolver…