@fastify/middie versions 9.3.1 and earlier do not register inherited middleware directly on child plugin engine instances. When a Fastify application registers authentication middleware in a parent scope and then registers child plugins with @fastify/middie, the child scope does not inherit the parent middleware. This allows unauthenticated requests to reach routes defined in child plugin scopes, bypassing authentication and authorization checks. Upgrade to @fastify/middie 9.3.2 to fix this issue. There are no workarounds.
https://github.com/fastify/middie/security/advisories/GHSA-72c6-fx6q-fr5w
https://github.com/fastify/fastify-express/security/advisories/GHSA-hrwm-hgmj-7p9c