WP Manifestindependent plugin directory

Install

Download CF-Access-Login.zip From the 1.0.1 release on GitHub, Jan 19, 2025

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/domkirby/cf-access-login/releases/download/1.0.1/CF-Access-Login.zip
Updates itself. It ships its own updater (Plugin Update Checker), so new versions appear under Dashboard → Updates.

Login to WordPress with Cloudflare Access Token

This WordPress plugin allows you to login to WordPress using a Cloudflare Access JSON Web Token (JWT). It works for websites that are protected by Cloudflare Access to require additional authentication to the WordPress admin area.

Installation

Download the latest Release ZIP from this repo and upload it to your site. Be sure to download CF-Access-Login.zip and not the source code zip, as this will ensure the folder is named correctly once you install it to WordPress.

The plugin will use the stable branch to check for released updates and is auto updater compatible.

Use

If you do not protect your WordPress site with Cloudflare Access, this plugin will do you no good!

This plugin works by searching for a user matching the email claim in the JWT with a matching user's email in WordPress. If no such user exists, the login will fail as it does not create users for you.

WARNING: I recommend that you maintain an account for which you know the password so that you can access your site in the event of a Cloudflare, Plugin, or other failure.

Configuration

This plugin is simple to configure. Once activated, a new options page will be created under "Settings" in the WordPress admin menu.

Configure the following options:

  • Cloudflare Team Name. This is the name of your team as presented in the domain used for logging in. For example, if your team domain is contoso.cloudflareaccess.com, then your team name would be contoso (without the .cloudflareaccess.com part)

  • App Audience ID. This is the AUD tag displayed in your Cloudflare app and is a string such as dc52e74361d1df510a0ef83eb6e3dfd42e78420820...

  • Auto Redirect Setting. This setting will automatically redirect wp-login.php to /wp-admin to trigger your Access application rule.

  • Logout from Cloudflare on WordPress Logout. Recommended to be ENABLED. This setting will automatically log you out of CF Access when you sign out out of WordPress. If you leave it off, your token will simply log you right back into WordPress. This may be desired behavior for some, so the option is there.

The settings screen

All other authentication options are handled by Cloudflare.

Issues

If you find an issue, please open a detailed issue on this repo. Pull requests are welcome!

Releases

12 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
1.0.1 latest
Jan 19, 2025 1 year ago
CF-Access-Login.zip
16
Jan 19, 2025 1 year ago
CF-Access-Login.zip
3
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
Jan 19, 2025 1 year ago
tag only
—
B grade

Security

CF Access Login 1.0.1 · audited by WP Registry

Medium-severity findings.

1 medium
Audited release
1.0.1
Findings
1
Worst severity
medium
Content hash
c98add8ee89782dfd4eecd48…

Findings

  • medium TypeError when Cloudflare JWT email has no WordPress user

    dos

    After JWT::decode and audience/issuer checks succeed, try_login does get_user_by('email', $jwt->email) then immediately reads $user->ID. If no matching user exists, $user is false and PHP 8+ throws TypeError/Error. The catch blocks only handle UnexpectedValueException and Exception, so the Error propagates and aborts the request on wp-login.php / wp-admin entry points whenever a valid CF Access token is present for an unknown email. Observable consequence: denial of service of the login/admin bootstrap for that visitor (and noisy fatals in logs). Separately, elseif ($user_id = 0) uses assignment not comparison and is dead code.

    CF-Access-Login.php:214-252

    Recommendation

    Guard with if ( ! $user ) { return; } (or handle missing user without fatal). Catch Throwable if retries are needed. Fix elseif ($user_id === 0).

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.