Skip to main content
Menu
Advisories

Publisher-authored reset pages can expose Login plugin password-reset credentials

GHSA-277M-9X28-GJQ2Published Updated GitHub

Description

The Login plugin allows a site page to take precedence over its bundled password-reset page. When a victim opens a reset link, the request's username and reset token are available to the rendering context, and the reset template renders the selected page content. A publisher who controls a page at the reset route can therefore cause the victim's browser to disclose the bearer reset credential.

Affected versions

Static review confirms the issue in grav-plugin-login 3.9.8. The credential-to-template assignment first appears in release 1.2.0. The recommended affected range is 1.2.0 through 3.9.8, with historical exploitability not dynamically tested.

Details

Login::getPage() first resolves a site-authored page at the configured route. On reset requests, onTwigSiteVariables() places the URI username and token into Twig variables, and the reset form template renders page content. Twig sandbox restrictions do not make ordinary template variables or allowed request access secret. The reset POST accepts the bearer token as the authorization credential.

Impact

A publisher can obtain another user's password-reset token when that user opens the emailed link. Reuse of that bearer credential can reset the victim's password, including for a more privileged account. This crosses the publisher-to-account trust boundary.

Patches

A patched release is not yet available. The fix must prevent user-authored pages and page bodies from rendering on credential-bearing reset requests; the bundled trusted page/template should be used. A POST nonce may be added as defense in depth.

Credits

Reported by @redwolf1919.

Affected versions

References

GitHub · getgrav/grav