Skip to main content
mySites.guru
NewIntroducing Preflight: see what a Joomla extension or WordPress plugin zip contains before you install itSee how it works

Joomla 6.2.0 SMTP OAuth2 Credentials Leak, Two Core Flaws Fixed in 6.2.1

Joomla 6.2.0 SMTP OAuth2 Credentials Leak, Two Core Flaws Fixed in 6.2.1

Joomla 6.2.0 added OAuth 2.0 authentication for SMTP, and with it an SMTP OAuth2 credentials leak in Joomla core: two separate ways for the mail account’s tokens to leave the site. Joomla 6.2.1, released on 24 November 2026, fixes both. Our code review found them the day after 6.2.0 came out, and we reported them privately to the Joomla Security Strike Team (JSST) the same day.

A site is exposed only if it runs Joomla 6.2.0 and its global mailer is SMTP with SMTP Authentication set to OAuth 2.0. Joomla 5.4 does not have the feature, although 5.4.11 came out on the same day and the advisories print Joomla’s standard solution line, “Upgrade to version 5.4.11, 6.2.1”. We know of no evidence that either flaw was exploited.

AdvisoryWhich tokenWho could get itNeeds
20261147Access token, plus the mail account addressA mail server named by someone in the Administrator groupPer Template Mail Settings on, then any triggered mail
20261146Refresh tokenAnything able to read a Super User's Global Configuration pageA Super User opening Global Configuration

Which of Your Joomla Sites Are Still on 6.2.0?

The fix is a version update, so the first job is finding the sites that have not had it. The Joomla version check in mySites.guru flags every connected site that is behind the latest release in its branch, and the bulk upgrade tool updates the selected sites in one pass, keeping each Joomla site inside its major series. Our guide to mass upgrading Joomla and WordPress sites walks through it.

Joomla CMS Version Must Be Up-to-date

mySites.guru checks every connected site for this automatically and flags it the moment it appears. It runs as part of the full audit on every connected site.

The check reports the Joomla version. It does not read a site’s mail settings, so deciding which 6.2.0 sites use OAuth 2.0 for SMTP is still your call.

How Joomla Sends Mail With OAuth 2.0

OAuth 2.0 for SMTP arrived in Joomla 6.2.0, released on 13 October 2026, through pull request #48290. You switch it on under System, Global Configuration, Server, Mail, with Mailer set to SMTP and SMTP Authentication set to “OAuth 2.0”.

As Joomla’s user manual explains, the site no longer stores the mail account’s password. The provider returns a long-lived refresh token, and Joomla uses it to request short-lived access tokens for SMTP. That makes two secrets, and each flaw leaked a different one.

20261147: A Joomla Mail Template Sends the Token Elsewhere

Advisory 20261147, CVE-2026-129384, reads: “Mail templates with an own SMTP host could send the global SMTP OAuth2 token to a host chosen by a non super user.” It is the worse of the two, because the token leaves the server and goes to a machine somebody else picked.

In 6.2.0, MailerFactory builds the mailer from Global Configuration and calls useSmtp() with the OAuth token provider as its seventh argument. MailTemplate::send() (MailTemplate.php:324) then calls useSmtp() again with the template’s own host and six arguments, so no provider. The second call reaches lines 568 to 571 of Mail.php:

        if ($oauthTokenProvider) {
            $this->AuthType = 'XOAUTH2';
            $this->setOAuth($oauthTokenProvider);
        }

With no provider passed, that block is skipped. The host changes, but AuthType stays XOAUTH2 and the provider from the first call stays attached. The check at Mail.php:573-577 accepts a host, a username and XOAUTH2 with no password, and PHPMailer then authenticates to the template’s host with AUTH XOAUTH2 and gives it the bearer token.

What that host receives comes from MailOAuth2TokenProvider::getOauth64(), which returns the base64 of user=<address>\001auth=Bearer <access token>\001\001. That is the address of the mail account and a working access token, requested fresh if the triggered mail needs one. The refresh token is not sent.

Who could do it

A Super User is not required. The Mail Templates component needs core.manage to open and core.edit to edit a template. Its access.xml defines only core.admin and its default rules are empty, so both permissions inherit from the root. On a default install core.manage is granted to the Administrator group, and core.edit to Manager (which Administrator inherits) and Editor. So by default it takes a member of the Administrator group. A Manager cannot open the component.

What had to be true first

Three conditions, all of them needed:

  • The global mailer is SMTP with OAuth 2.0
  • A Super User has switched on “Per Template Mail Settings” in the Mail Templates options. It is off by default and changing it needs core.admin
  • A template is set to use its own mail settings, with the mailer set to SMTP, its own SMTP Host, and SMTP Authentication on

Then a mail from that template has to be sent. The password reset mail (com_users.password_reset) goes through MailTemplate, and anyone who knows a user’s email address can request a reset from the front-end login page.

The fix in Joomla 6.2.1

Mail.php now clears the OAuth2 state whenever useSmtp() is called without a provider:

        if ($oauthTokenProvider) {
            $this->AuthType = 'XOAUTH2';
            $this->setOAuth($oauthTokenProvider);
        } elseif ($this->AuthType === 'XOAUTH2') {
            // The mailer was configured for OAuth2 before, the token must not be used for another SMTP configuration
            $this->AuthType = '';
            $this->oauth    = null;
        }

A new unit test, testUseSmtpWithoutProviderResetsOauth2, covers it.

20261146: The Refresh Token in Joomla’s Config Page HTML

Advisory 20261146, CVE-2026-129383, reads: “The SMTP OAuth2 refresh token was rendered into the HTML source of the global configuration form.” The cause is one field at line 680 of administrator/components/com_config/forms/application.xml in 6.2.0:

		<field
			name="smtp_oauth2_refresh_token"
			type="hidden"
			readonly="true"
		/>

The hidden field layout (layouts/joomla/form/field/hidden.php:58) prints the stored value straight into the page as value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>".

Global Configuration needs core.admin, so only a Super User loads that page. The exposure is to whatever else can read it: a stored cross-site scripting payload running in the page, a browser extension, a saved or cached copy, or a screen share with the page source open. The refresh token is the more valuable of the two credentials, because it is long-lived and can be used to get new access tokens.

In 6.2.1 the hidden field is deleted. The OAuth2 Token button is now told only true or false: whether a token exists.

How Severe Are the Two Joomla OAuth2 Flaws?

Both CVE records, published on 24 November 2026, score 6.3 Medium on the same vector and credit Phil Taylor as the finder. Each advisory page shows Impact High, Severity Low and Probability Low instead. Our own assessment before the records appeared was 5.9 for the mail template flaw and 5.7 for the refresh token.

6.3CVSS 4.0

Mail template SMTP override sends the OAuth2 access token

MediumJoomla CNA, CVE record published 24 November 2026

CVE-2026-129384. The receiving server gets a working access token for the site's mail account, along with the account's address, so the record puts the larger effect on the connected mail account (SC:H and SI:H) and a Low one on the Joomla site. Privileges Required is High: on a default install it takes the Administrator group. The vector does not count the Per Template Mail Settings option, which a Super User must already have switched on.

CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:H/SI:H/SA:N
Joomla 6.2.0 onlyAdministrator group, no Super User neededPer Template Mail Settings must be onAccess token, not the refresh token
What does this mean?

CVSS 4.0 scores how severe a flaw is, from 0 (no impact) to 10 (critical). Each pair of letters in the string above is one metric; here is what this one's says.

How it is reached

AV:N
Network: Reachable across the internet
AC:L
Low: Nothing to work around, it just works
AT:N
None: Works against any affected install
PR:H
High: Needs an account with elevated rights
UI:N
None: Nobody has to be tricked into anything

What it does to the site

VC:L
Low: Some data can be read
VI:N
None: Nothing can be altered
VA:N
None: The site stays up

What it does beyond the site

SC:H
High: Data on other systems can be read
SI:H
High: Other systems can be altered
SA:N
None: Other systems stay up
6.3CVSS 4.0

Refresh token rendered in Global Configuration HTML

MediumJoomla CNA, CVE record published 24 November 2026

CVE-2026-129383. The refresh token is long-lived and can be used to get new access tokens, so the record puts the larger effect on the connected mail account (SC:H and SI:H) and a Low one on the Joomla site. Privileges Required is High because only a Super User loads the page. The vector does not count the need for something else to read that page.

CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:H/SI:H/SA:N
Joomla 6.2.0 onlyOnly a Super User loads the pageRefresh tokenNeeds something else reading the page
What does this mean?

CVSS 4.0 scores how severe a flaw is, from 0 (no impact) to 10 (critical). Each pair of letters in the string above is one metric; here is what this one's says.

How it is reached

AV:N
Network: Reachable across the internet
AC:L
Low: Nothing to work around, it just works
AT:N
None: Works against any affected install
PR:H
High: Needs an account with elevated rights
UI:N
None: Nobody has to be tricked into anything

What it does to the site

VC:L
Low: Some data can be read
VI:N
None: Nothing can be altered
VA:N
None: The site stays up

What it does beyond the site

SC:H
High: Data on other systems can be read
SI:H
High: Other systems can be altered
SA:N
None: Other systems stay up

A Masked Field Beside a Hidden Token

OAuth keeps the mail password off the web server, but the secret has only moved from a password to a token. A refresh token that can keep getting new access tokens deserves the same handling the password got.

Two fields sit beside the refresh token: smtppass at line 620 and smtp_oauth2_client_secret at line 639. Both are type="password" with lock="true", and the password layout sets $value = '' when a field is locked, so their values never reach the HTML. The lock attribute only exists on the password field type, so the hidden field had no such protection. A masked field is wasted when the matching token sits in a hidden input beside it.

What Should You Do on a Joomla 6.2.0 Site?

Update first, then treat the tokens as possibly exposed if the site used OAuth 2.0 for SMTP on 6.2.0. Updating does not invalidate a token that has already leaked.

  1. Update. Move every Joomla 6.2.0 site to 6.2.1.

  2. Check the mail templates. Run the query below and confirm every SMTP host is a mail server you recognise.

  3. Revoke at the provider. For Microsoft, an admin goes to Entra ID, Users, the user, then Revoke sessions. For Google, revoke the app's access on the account.

    Do this before reissuing. Microsoft does not revoke old refresh tokens when they are used to fetch new access tokens.

  4. Reissue. In Global Configuration, click the Reissue OAuth2 Token button, then Validate Token beside it to check the new one.

Reissuing gives Joomla a new token. Do not count on it to revoke the old one, which is why the provider comes first. Microsoft’s refresh tokens last 90 days by default. Google allows up to 100 refresh tokens per account per client ID, and a refresh token stops working when the user revokes the app’s access, or changes their password if the token has Gmail scopes.

Check Joomla mail templates for an unfamiliar SMTP host

This read-only query lists every mail template that has its own SMTP host. Replace #__ with the site’s table prefix:

SELECT template_id, language, params
FROM #__mail_templates
WHERE params LIKE '%smtphost%';

The smtphost value in params should be a mail server you recognise. A row that has one is not malicious in itself, and localhost is the form’s default.

A third advisory in the same release is close to ours but was not our report. Advisory 20261148, CVE-2026-129385, is credited to the Joomla Security Strike Team, was reported on 14 November 2026 and affects Joomla 4.0.0 to 5.4.10 and 6.0.0 to 6.2.0: “Mail templates with an own SMTP host could send the global SMTP credentials to a host chosen by a non super user.”

It covers the ordinary SMTP username and password. A blank value in a template used to fall back to the global one, and from 6.2.1 the host, username and password are no longer taken from Global Configuration when a template overrides the mail settings. Sites on password SMTP should update and run the template query above too.

The same release also closes the Joomla API authorisation flaw we reported.

Joomla 6.2.1 and 5.4.11 Fix 58 Security Issues, Four CriticalRead the full post

To see which of your own Joomla sites are behind the current release, run a free audit.

Timeline

  1. Joomla 6.2.0 is released with OAuth 2.0 for SMTP

  2. We report both flaws privately to the JSST

    Found by code review of 6.2.0 the day after its release.

  3. The JSST agrees the mail template flaw is valid

    Ticket 282811, the same day.

  4. Joomla 6.2.1 is released with the fixes

    Advisories 20261147 and 20261146 are published, crediting Phil Taylor.

Further Reading

Frequently Asked Questions

Which Joomla versions are affected by the SMTP OAuth2 credentials leak?
Only Joomla 6.2.0, and only when the global mailer is SMTP with SMTP Authentication set to OAuth 2.0. Joomla 5.4 does not have the feature. Both flaws are fixed in Joomla 6.2.1.
Does the mail template flaw leak the OAuth2 refresh token?
No. Advisory 20261147 leaks the short-lived access token and the address of the mail account, sent to the SMTP host named in a mail template. The refresh token is the subject of the other advisory, 20261146, where it was printed into the HTML source of the Global Configuration form.
Who could exploit the Joomla mail template OAuth2 flaw?
Someone in the Administrator group on a default install, with no Super User rights needed. A Super User must first have switched on Per Template Mail Settings in the Mail Templates options, which is off by default. The Manager group alone cannot open the Mail Templates component.
Who could read the refresh token in Global Configuration?
Only a Super User can load Global Configuration, so the exposure is to anything else able to read that page: a stored cross-site scripting payload running in it, a browser extension, a saved or cached copy, or a screen share with the page source open.
Does updating to Joomla 6.2.1 make a leaked token safe?
No. The update stops the leak, but a token that already left the site still works until the provider says otherwise. Revoke the grant at the mail provider first, then use the Reissue OAuth2 Token button in Global Configuration to get a new one.
My Joomla site uses SMTP with a username and password. Is it affected?
Not by these two flaws. A related advisory, 20261148, credited to the Joomla Security Strike Team, covers ordinary SMTP credentials sent to a mail template's own host on Joomla 4.0.0 to 5.4.10 and 6.0.0 to 6.2.0. Update to 5.4.11 or 6.2.1 and check your mail templates.
Were the Joomla OAuth2 flaws exploited?
We know of no evidence that either was exploited. Our code review of Joomla 6.2.0 found both, and they were reported privately to the Joomla Security Strike Team.
EU icon: AI MODIFIEDWritten and edited by a human, with AI assistance. Our approach to AI

What our users say

Sascha Langguth
Sascha Langguthlangguth.info
★★★★★

I've been managing Joomla websites professionally for over 20 years, and mySites.guru has become an indispensable part of my workflow. It saves me an incredible amount of time managing client websites, makes security and updates effortless, and gives me confidence that everything is under control. During the last two weeks especially, I honestly don't know how I would have managed without it. What makes the experience even better is Phil's outstanding support. Fast, knowledgeable, and always helpful—it's clear that the product is built by someone who truly understands the needs of web professionals. Highly recommended for anyone managing Joomla or WordPress websites. Thanks, Phil, for creating such an excellent tool!

Read more reviews
Jet de Jager
Jet de JagerBiographix

Phil's attention to continually improve website management / security is on a different level.

Read more reviews

Read all 312 reviews →

Get an email when the next post is published

Ready to Take Control?

One free audit of one site · no card · about 2 minutes to connect

Get Your Free Site Audit