lidofinance / lidofinance/validator-ejector

A stalled webhook error body bypasses the timeout and blocks exit processing

Open
#190 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
16
Forks
19
Avg merge
1d 20h
Merged PRs (30d)
7

Description

Locations

Summary

A webhook response can bypass WEBHOOK_ABORT_TIMEOUT_MS by sending non-success headers and leaving its body unfinished. The pending request blocks subsequent exits and polling cycles.

Root cause

The webhook places notOkError() outside abort(). Once node-fetch returns response headers, abort() clears its timer; notOkError() then awaits extractErrorBody() without a deadline.

  • Retries require a rejection, which the pending body read never produces.
  • The job runner retains its lock until the handler settles.

Impact

A malfunctioning webhook or proxy can turn one incomplete error response into a daemon-wide interruption of required validator exits, even if subsequent requests would succeed. Processing resumes only when the response finishes, the connection fails, or the operator restarts the daemon. This is a medium-severity temporary core delivery DoS.

Scenario

  1. The daemon dispatches an approved exit to its configured webhook.
  2. The endpoint promptly sends HTTP 500 headers and a partial JSON body, then leaves the connection open.
  3. The abort timer is cleared before error-body parsing finishes.
  4. The configured timeout expires without rejection, retry, or an exit-error metric update.
  5. Later validators remain unprocessed, and subsequent polling callbacks skip the locked job.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with validator-ejector/src/services/webhook-caller/service.ts:23-27 and the abort and error-body paths in validator-ejector/src/lib/request/middlewares.ts:113-117 and 135-140. Trace how a non-success response with an unfinished body interacts with WEBHOOK_ABORT_TIMEOUT_MS, retries, metrics, and the job lock. Done means the stalled response cannot block later exits or polling cycles and timeout handling resumes as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.