Skip to content

Commit 06e510b

Browse files
Security: Silent Exception Swallowing in Server Request Handler Factory (#12332)
Signed-off-by: Trần Bách <45133811+barttran2k@users.noreply.github.com> Co-authored-by: Sam Bull <git@sambull.org>
1 parent ce5fada commit 06e510b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

aiohttp/web_server.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,11 @@ def __call__(self) -> RequestHandler[_Request]:
123123
for k, v in self._kwargs.items()
124124
if k in ["debug", "access_log_class"]
125125
}
126-
return RequestHandler(self, loop=self._loop, **kwargs)
126+
handler = RequestHandler(self, loop=self._loop, **kwargs)
127+
handler.logger.warning(
128+
"Failed to create request handler with custom kwargs %r, "
129+
"falling back to filtered kwargs. This may indicate a "
130+
"misconfiguration.",
131+
self._kwargs,
132+
)
133+
return handler

0 commit comments

Comments
 (0)