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
fix(node): harden native loader allowlist and simplify loader-hooks surface
Security fixes from consolidated code review of the native HTTP ESM loader:
- gate registration itself on the MF_NODE_NATIVE_LOADER kill switch so
module.register() is never called when disabled
- share one in-flight ack per origin in allowOrigin() so concurrent callers
cannot resolve before the hooks thread applied the allowlist update
- reject HTTP redirects in the hooks-thread fetch so an allowlisted origin
cannot redirect module source to an un-allowlisted target
- bound the hooks fetch (30s abort) and allowlist acks (10s rejection) so a
broken port fails loudly instead of hanging the process
Cleanup: reuse RemoteEntryExports from @module-federation/runtime/types,
drop the always-true state.enabled flag, fold state.ts into protocol.ts,
type the hooks with @types/node module hook types, stop re-exporting
test-only helpers, resolve the CJS register hooksUrl via defaultHooksUrl(),
share the log prefix constant, warn when smoke tests skip on missing dist,
and fix a stale comment in the node-esm-host example.
0 commit comments