Bun

Bun issue (Nov 27): Bun File Slicing Response Connection Reset and Descriptor Leak in 1.4.4 and 1.4.5

medium

Is it fixed? Not yet.

Ongoing since Nov 27, 13:50 UTC. First reported Nov 27, 13:50 UTC.

What happened

Bun versions 1.4.4 and 1.4.5 on Linux x64 suffer from bugs where returning a sliced file response opened via a file descriptor sends the incorrect Content-Length followed by a connection reset, and file descriptors opened via Bun.file(fd) are never closed after response completion.

What caused it?

Under active investigation. No report has identified a root cause yet.

No verified workaround yet

None of the linked reports describe a mitigation. This page updates when one appears.

Outage timeline

  1. Investigating(current)
  2. Workaround available(upcoming)
  3. Resolved(upcoming)
  1. First report on GitHub issue

    new Response(Bun.file(fd).slice(a, b)) sends the whole file's Content-Length, then resets the connection

    Source

Reports of this outage

2 reports · 2 GitHubShow
  1. [1]
    GitHub First report
    new Response(Bun.file(fd).slice(a, b)) sends the whole file's Content-Length, then resets the connection(opens GitHub issue in a new tab)

    What version of Bun is running? Bun 1.4.4 and 1.4.5 What platform is your computer? Linux x64 What steps can reproduce the bug? Repro: serve a 1 MB file three ways: a slice of a file opened by descriptor (fd); the whole file by descriptor; a slice of a file opened by path. const file = mode === "path-slice" ? Bun.file(path) : Bun.file(fd); return new Response(mode === "fd-whole" ? file : file.slice(1000, 11_000)); What is the expected behavior? Expected: fd-slice sends Content-Length: 10000…

    by gbahrani 0upvotes 1comments

  2. [2]
    GitHub
    there's no way to know when a file response has finished, and a Bun.file(fd) descriptor is never closed(opens GitHub issue in a new tab)

    What version of Bun is running? 1.4.4 and 1.4.5 What platform is your computer? Linux x64 What steps can reproduce the bug? Repro: return new Response(Bun.file(fd)) for a 20 MB file, then check afterwards. What is the expected behavior? req.signal fires only when the connection is aborted, never when the response completes. The completion callbacks Bun has are internal. The server API has no per-response "finished" hook. server.pendingRequests is a process-wide count. Bun never closes a…

    by gbahrani 0upvotes 0comments92% match

Bun issue FAQ

What happened in the Bun issue, and why?

Ongoing since Nov 27, 13:50 UTC. No cause has been published yet; this page adds it once the vendor or a report explains it.

What is affected by the Bun issue?

Bun (versions: 1.4.4, 1.4.5).

When did the Bun issue start and end?

It started Nov 27, 13:50 UTC and is still ongoing (2 h 41 min so far). This page updates as it develops.

How do I get alerts for Bun?

Subscribe to the Bun RSS feed for every new Bun incident, or connect an AI assistant to WhatBrokeToday over MCP and ask whether Bun is down. Bun feed

Where does this information come from?

WhatBrokeToday collects public status pages, developer community reports and security advisories, groups the ones about the same problem, and links every report under Evidence on this page. This one has 2 reports from 1 independent source.