ELSEIF
Your brief EB
227 stories from 89 feeds 170 clusters Refreshed 6 minutes ago next pull 14:21

SECURITY Signal 288

Bun runtime for Vercel Functions now accepts Bun.serve as an entrypoint

Vercel now lets Bun functions start directly with Bun.serve, including route and WebSocket handling.

WHY IT MATTERS

Engineers can deploy a Bun server unchanged, removing the need for an additional framework layer. The direct entrypoint changes how request isolation and connection lifetimes are managed, which has security and cost implications. Understanding the new compute model is essential for budgeting and for securing WebSocket traffic across function instances.

Written by elseif from the cluster below · every claim links back to a source

The three things worth knowing

01

Setting "bunVersion": "1.x" in vercel.json enables the new entrypoint behavior.

02

WebSocket connections are pinned to a single function instance and billed only while active.

03

Cross-instance message coordination requires an external data store, adding a security boundary to manage.

THE READ

What the cluster adds up to.

ORIGINAL ANALYSIS

The runtime update allows a Bun function to be launched with Bun.serve, meaning the same code you run locally can be deployed without wrapping it in a Vercel-specific framework. This includes support for static, dynamic, and wildcard routes defined in a routes map. The change is limited to projects that explicitly opt-in via the bunVersion setting.

From an operations standpoint, developers now configure the runtime by adding a bunVersion field to vercel.json and placing a server.ts file at the project root. The server definition mirrors the local Bun.serve API, so existing Bun scripts can be moved to Vercel with minimal alteration. However, any reliance on framework-provided middleware or security defaults must be re-implemented manually.

Security-wise, WebSocket handling is now part of the function instance, with each connection staying attached to that instance for its entire lifetime. This pinning reduces the surface for cross-instance data leakage but also means that a compromised instance could affect all its active connections. Engineers should therefore enforce strict validation and authentication within the fetch and websocket handlers, and consider using a hardened external store for any shared state.

The billing model switches to active CPU pricing for WebSocket traffic, charging only for the time spent processing messages. Because connections keep an instance alive, long-lived sockets can increase runtime duration and cost, even though idle time is not billed. Teams need to monitor connection durations and possibly implement timeouts to control expenses.

The new entrypoint does not apply to other Vercel runtimes, so mixed-language projects must continue using their existing adapters. Code that previously depended on Vercel's automatic request parsing or security middleware will need to incorporate those capabilities directly. Failure to replicate those safeguards could expose the function to injection or denial-of-service attacks.

Written by elseif from the cluster below · checked for specifics the sources never contained

THE CLUSTER

Same story, 1 feed.

ORDERED BY FIRST SEEN
Vercel Bun runtime for Vercel Functions now accepts Bun.serve as an entrypoint Open ↗