mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-09 16:52:32 +08:00
fix: V-001 security vulnerability
Automated security fix generated by Orbis Security AI
This commit is contained in:
parent
fce0398470
commit
ea86d843de
@ -72,7 +72,13 @@ class InternalRoutes:
|
||||
|
||||
def get_app(self):
|
||||
if self._app is None:
|
||||
self._app = web.Application()
|
||||
self._app = web.Application(middlewares=[self._local_only_middleware])
|
||||
self.setup_routes()
|
||||
self._app.add_routes(self.routes)
|
||||
return self._app
|
||||
|
||||
@web.middleware
|
||||
async def _local_only_middleware(self, request, handler):
|
||||
if request.remote not in ('127.0.0.1', '::1'):
|
||||
raise web.HTTPForbidden(reason="Internal endpoints are only accessible from localhost")
|
||||
return await handler(request)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user