Session fixation in Apache Wicket. org.apache.wicket.authroles.authentication.AuthenticatedWebSession is the authentication base class of Wicket's role-based security module, and its signIn(String, String) method is the entry point through which an application authenticates a session. Возобновление идентификатора сеанса контейнера в этот момент является стандартной защитой от злоумышленника, который исправил идентификатор сеанса в браузере жертвы, и Wicket предоставляет это обновление как org.apache.wicket.SessionchangeSessionId(), документация которого предписывает звонящим вызывать его при входе в систему именно по этой причине. AuthenticatedWebSessionsignIn(String, String) вызывает его внутри охранника, который преуспевает только при первом переходе флага сеанса.
Таким образом, идентификатор сеанса возобновляется при первом входе сеанса и не возобновляется при повторном входе сеанса, который уже подписан в аутентификации. signIn(String, String) возвращает true в любом случае, поэтому ни вызывающий абонент, ни приложение не могут сказать, что обновление не произошло. Приложение подвержено влиянию, когда оно аутентифицируется через AuthenticatedWebSession, что требуется AuthenticatedWebApplication и что использует отправленный UsernamePasswordPanel, и когда сессия, которая уже вошла в систему, может снова аутентифицироваться: подсказка перед чувствительным действием, переключатель учетной записи или просто форма входа, которая остается доступной после входа пользователя. Ничто в модуле не скрывает эту форму от сеанса входа.
Достижение дефекта также требует, чтобы злоумышленник разместил идентификатор сеанса по своему выбору в браузере жертвы. JSESSIONID устанавливается контейнером сервлетов, а не Wicket, поэтому требуется позиция, которую Wicket не предоставляет, например, контроль хоста под тем же регистрируемым доменом или контейнер, сконфигурированный для переноса идентификатора сеанса в URL, и посаженный сеанс должен быть тем, на который злоумышленник уже вошел, потому что сеанс, который еще не вошел, имеет свой идентификатор, обновленный аутентификацией жертвы. Неудачная попытка аутентификации выдает сеанс и закрывает окно. Приложения, которые обновляют идентификатор сеанса в своем собственном коде после успешной аутентификации, не затрагиваются.
В качестве обходного пути возобновите идентификатор сеанса из собственного кода приложения при каждой успешной аутентификации, вызвав SessionchangeSessionId() в конце реализации authenticate(String, String). Эта проблема затрагивает Apache Wicket: от 8.18.0 до 8.19.0, от 9.23.0 до 9.24.0, от 10.9.0 до 10.11.0. Пользователям рекомендуется обновиться до версий 8.20.0, 9.25.0 или 10.12.0, которые исправляют проблему.
Показать оригинальное описание (EN)
Session fixation in Apache Wicket. org.apache.wicket.authroles.authentication.AuthenticatedWebSession is the authentication base class of Wicket's role-based security module, and its signIn(String, String) method is the entry point through which an application authenticates a session. Renewing the container session id at that point is the standard defence against an attacker who has fixed a session id in a victim's browser, and Wicket provides that renewal as org.apache.wicket.Session#changeSessionId(), whose documentation directs callers to invoke it on login for exactly that reason. AuthenticatedWebSession#signIn(String, String) calls it inside a guard that succeeds only on the first transition of the session's signed-in flag. The session id is therefore renewed when a session first signs in, and is not renewed when a session that is already signed in authenticates again. signIn(String, String) returns true either way, so neither the caller nor the application can tell that the renewal did not happen. An application is affected where it authenticates through AuthenticatedWebSession, which AuthenticatedWebApplication requires and which the shipped UsernamePasswordPanel uses, and where a session that is already signed in can authenticate again: a step-up prompt before a sensitive action, an account switch, or simply a sign-in form that stays reachable once the user is signed in. Nothing in the module hides that form from a signed-in session. Reaching the defect also requires an attacker to place a session id of their choosing in the victim's browser. JSESSIONID is set by the servlet container rather than by Wicket, so that needs a position Wicket does not grant, such as control of a host under the same registrable domain or a container configured to carry the session id in the URL, and the planted session has to be one the attacker has already signed in on, because a session that is not yet signed in does have its id renewed by the victim's authentication. An authentication attempt that fails signs the session out and closes the window. Applications that renew the session id in their own code after a successful authentication are not affected. As a workaround, renew the session id from the application's own code on every successful authentication, by calling Session#changeSessionId() at the end of the authenticate(String, String) implementation. This issue affects Apache Wicket: from 8.18.0 through 8.19.0, from 9.23.0 through 9.24.0, from 10.9.0 through 10.11.0. Users are recommended to upgrade to version 8.20.0, 9.25.0 or 10.12.0, which fix the issue.
Характеристики атаки
Последствия
Строка CVSS v4.0