alleyinteractive / wp-alleyvate

Defaults for WordPress sites by Alley.
GNU General Public License v2.0
18 stars 2 forks source link

Add nonce to wp-login #49

Closed mboynes closed 9 months ago

mboynes commented 1 year ago

Description

wp-login.php doesn't have a nonce. Ideally, this would be a proper nonce that is only usable once (stored in the object cache or the database), even though that would add overhead to the login process and require the page to be uncached.

Here is a plugin that provides a reasonable starting point.

Use Case

Nonces are a best practice for forms. In addition to preventing CSRF attacks, they can help mitigate brute-force attacks by at least slowing them down. Further, since WordPress-focused bot networks don't expect there to be a nonce, adding nonces is low-hanging fruit that will instantly protect against the most common attacks.

anubisthejackle commented 10 months ago

After discussing this in Slack, it seems we have a path forward using: