miniflare
4.20260730.0 · 30 Jul 2026MIT57.5M / weekRepositoryHomepagenpmAtom feed
3.20250718.3 is the newest release of 3.x.
In short
2 new5 fixed
Security
1 advisory affects 3.20231030.0; 3.20231030.2 fixes them
- HighMiniflare vulnerable to Server-Side Request Forgery (SSRF)GHSA-fwvg-2739-22v7 · 29 Dec 2023Fixed in 3.20231030.2
Release note
Minor Changes
Update to latest
workerd@1.20231030.0Add
unsafeEvalBindingoptionAdd option to leverage the newly introduced
UnsafeEvalworkerd binding API,
such API is used to evaluate javascript code at runtime via the providedevalandnewFunctionmethods.The API, for security reasons (as per the workers docs), is not to be use in production but it is intended for local purposes only such as local testing.
To use the binding you need to specify a string value for the
unsafeEvalBinding, such will be the name of theUnsafeEvalbindings that will be made available in the workerd runtime.For example the following code shows how to set the binding with the
UNSAFE_EVALname and evaluate the1+1string:const mf = new Miniflare({ log, modules: true, script: ` export default { fetch(req, env, ctx) { const two = env.UNSAFE_EVAL.eval('1+1'); return new Response('two = ' + two); // returns 'two = 2' } } `, unsafeEvalBinding: "UNSAFE_EVAL", });
Patch Changes
Reject
Miniflare#readypromise ifMiniflare#dispose()called while waitingAdd
miniflarebinentryMiniflare 3 doesn't include a CLI anymore, but should log a useful error stating this when running
npx miniflare. We had a script for this, but it wasn't correctly hooked up. :facepalm: This change makes sure the requiredbinentry exists.Ensure
Mutexdoesn't report itself as drained if lockedPreviously, Miniflare's
Muteximplementation would report itself as drained
if there were no waiters, regardless of the locked state. This bug meant that
if you called but didn'tawaitMiniflare#setOptions(), future calls toMiniflare#dispatchFetch()(or any other asynchronousMiniflaremethod)
wouldn't wait for the options update to apply and the runtime to restart before
sending requests. This change ensures we wait until the mutex is unlocked before
reporting it as drained.Only output ipv4 addresses when starting
Cleanup temporary directory after shutting down
workerdPreviously on exit, Miniflare would attempt to remove its temporary directory
before shutting downworkerd. This could lead toEBUSYerrors on Windows.
This change ensures we shutdownworkerdbefore removing the directory.
Since we can only clean up on a best effort basis when exiting, it also catches
any errors thrown when removing the directory, in case the runtime doesn't
shutdown fast enough.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.