Недостаточная экспирация сеанса в Apache Wicket. org.apache.wicket.protocol.ws.WebSocketSettingsnewWebSocketRequest() оборачивает запрос на обновление WebSocket в org.apache.wicket.protocol.ws.api.ServletRequestCopy, который хранится на протяжении всего времени соединения и используется для создания каждого запроса. Копирование запроса является преднамеренным и документируется как таковое, потому что контейнер перерабатывает запрос на обновление после завершения рукопожатия. Контейнерная сессия копируется вместе с ней, в org.apache.wicket.protocol.ws.api.HttpSessionCopy удерживая атрибуты сессии, как они стояли, когда соединение было открыто.
Эта вторая копия не нужна, потому что сессия, в отличие от запроса, не отбрасывается в конце запроса. Каждый кадр после этого решает свой сеанс Wicket через ISessionStorelookup(), который читает его из копии, поэтому соединение отделяется от сеанса живого контейнера до тех пор, пока оно остается открытым. Таким образом, завершение сеанса через контейнер не приводит к прекращению соединения.
After an idle timeout, an HttpSession#invalidate() call made from a filter or from a security framework, a container-managed logout, or a session replacement, the connection goes on resolving the org.apache.wicket.Session instance that existed when it was opened, together with that session's attributes and, for applications built on wicket-auth-roles, the signed-in state held on that same instance, so an authorization decision taken inside a WebSocket callback is taken against an identity that has already been revoked. Копия также является тем, через что пишет соединение: SessioninvalidateNow(), выданный изнутри обратного вызова WebSocket, аннулирует копию и оставляет сеанс контейнера действительным, а атрибуты сеанса, установленные над соединением, записываются в копию, а не в сеанс. An application is affected where it uses Wicket's native WebSocket support on pages or shared resources that require an authenticated session, and where sessions are ended by the container rather than by Wicket. SessioninvalidateNow(), и AuthenticatedWebSessioninvalidate() и signOut(), которые вызывают его, остаются эффективными для WebSocketBehavior на странице: они очищают менеджер страниц, и соединение больше не может решить страницу, для которой оно было открыто. WebSocketResource таким образом не ограничен, потому что фрейм, называющий ресурс, подается против одноразовой страницы и никогда не консультируется с менеджером страниц, поэтому такое соединение также переживает собственный выход Wicket's.
Некоторые контейнеры сами закрывают соединения WebSocket, когда сеанс HTTP, под которым они были открыты, разрушается, и в этом случае соединение заканчивается независимо от того, что это свойство контейнера, а не Wicket. Приложения, которые не используют встроенную поддержку WebSocket, не затрагиваются. Эта проблема затрагивает Apache Wicket: от 8.0.0 до 8.19.0, от 9.0.0 до 9.24.0, от 10.0.0 до 10.11.0.
Старые, неподдерживаемые релизы от 6.0.0 также затронуты. Пользователям рекомендуется обновиться до версий 8.20.0, 9.25.0 или 10.12.0, которые исправляют проблему.
Показать оригинальное описание (EN)
Insufficient session expiration in Apache Wicket. org.apache.wicket.protocol.ws.WebSocketSettings#newWebSocketRequest() wraps the WebSocket upgrade request in an org.apache.wicket.protocol.ws.api.ServletRequestCopy, which is kept for the life of the connection and used to build the request for every frame that arrives on it. Copying the request is deliberate and is documented as such, because the container recycles the upgrade request once the handshake is over. The container session is copied along with it, into an org.apache.wicket.protocol.ws.api.HttpSessionCopy holding the session attributes as they stood when the connection was opened. That second copy is not necessary, because a session, unlike a request, is not discarded at the end of a request. Every frame afterwards resolves its Wicket session through ISessionStore#lookup(), which reads it out of the copy, so the connection is detached from the live container session for as long as it stays open. Ending the session through the container therefore does not end the connection. After an idle timeout, an HttpSession#invalidate() call made from a filter or from a security framework, a container-managed logout, or a session replacement, the connection goes on resolving the org.apache.wicket.Session instance that existed when it was opened, together with that session's attributes and, for applications built on wicket-auth-roles, the signed-in state held on that same instance, so an authorization decision taken inside a WebSocket callback is taken against an identity that has already been revoked. The copy is also what the connection writes through: a Session#invalidateNow() issued from inside a WebSocket callback invalidates the copy and leaves the container session valid, and session attributes set over the connection are written to the copy rather than to the session. An application is affected where it uses Wicket's native WebSocket support on pages or shared resources that require an authenticated session, and where sessions are ended by the container rather than by Wicket. Session#invalidateNow(), and AuthenticatedWebSession#invalidate() and #signOut() which call it, remain effective for a WebSocketBehavior on a page: they clear the page manager, and the connection can then no longer resolve the page it was opened for. A WebSocketResource is not limited in that way, because a frame naming a resource is served against a throwaway page and never consults the page manager, so such a connection outlives Wicket's own sign-out as well. Some containers close WebSocket connections themselves when the HTTP session they were opened under is destroyed, in which case the connection ends regardless; that is a property of the container rather than of Wicket. Applications that do not use the native WebSocket support are not affected. This issue affects Apache Wicket: from 8.0.0 through 8.19.0, from 9.0.0 through 9.24.0, from 10.0.0 through 10.11.0. Older, unsupported releases from 6.0.0 onwards are also affected. Users are recommended to upgrade to version 8.20.0, 9.25.0 or 10.12.0, which fix the issue.
Характеристики атаки
Последствия
Строка CVSS v4.0