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.
| Advisory | Which token | Who could get it | Needs |
|---|---|---|---|
| 20261147 | Access token, plus the mail account address | A mail server named by someone in the Administrator group | Per Template Mail Settings on, then any triggered mail |
| 20261146 | Refresh token | Anything able to read a Super User's Global Configuration page | A 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.
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:NWhat 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
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:NWhat 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.
Update. Move every Joomla 6.2.0 site to 6.2.1.
Check the mail templates. Run the query below and confirm every SMTP host is a mail server you recognise.
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.
Reissue. In Global Configuration, click the Reissue OAuth2 Token button, then Validate Token beside it to check the new one.
Send a test mail. Verify the Joomla email configuration works, or check every site still sends email if you changed several.
Review the Administrator accounts. Look for admin accounts you do not recognise, and force MFA on the privileged ones.
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.
Password SMTP Sites Have a Related Fix
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 postTo see which of your own Joomla sites are behind the current release, run a free audit.
Timeline
Joomla 6.2.0 is released with OAuth 2.0 for SMTP
We report both flaws privately to the JSST
Found by code review of 6.2.0 the day after its release.
The JSST agrees the mail template flaw is valid
Ticket 282811, the same day.
Joomla 6.2.1 is released with the fixes
Advisories 20261147 and 20261146 are published, crediting Phil Taylor.
Further Reading
- Joomla 6.2.1 Security and Bugfix Release - the joomla.org announcement for the release that fixes both flaws.
- Advisory 20261147 - information disclosure in mail template SMTP OAuth2 handling, CVE-2026-129384.
- Advisory 20261146 - information disclosure in global configuration SMTP OAuth2 settings, CVE-2026-129383.
- Advisory 20261148 - the related flaw for ordinary SMTP credentials, credited to the Joomla Security Strike Team.
- SMTP OAuth 2.0 Configuration in Joomla - the Joomla user manual page for the feature.
- Refresh tokens in the Microsoft identity platform - lifetimes and what does and does not revoke a refresh token.
- Using OAuth 2.0 to Access Google APIs - Google's refresh token limits and expiry rules.



