Phoca Gallery 6.1.7 fixes a stored XSS in YouTube video links

On 19 November 2026 Phoca released Phoca Gallery 6.1.7, and the release notes open with “This is a security release.” Phoca’s announcement says what was fixed: “Fixed stored XSS in YouTube links: the video ID is now strictly validated and the embed URL is escaped on output”. It comes exactly one month after Phoca Gallery 6.1.6 fixed a stored XSS in the EXIF data of the same Joomla extension.
For a site running the gallery, the change means this: a YouTube link saved on a gallery image could hold more than a video ID, and Phoca Gallery wrote whatever it held into the page. Anyone who then opens that item runs the link author’s script in their own browser, on your site. The fix is on offer to Joomla 6 sites only. The flaw is CVE-2026-129418, which the Joomla CNA scores 7.5 High.
TL;DR
- Phoca Gallery 3.1.0 to 6.1.6 takes the video ID out of a YouTube link without validating it and writes it straight into the embed markup
- A crafted link breaks out of the HTML attribute and runs as script for anyone who opens that gallery item, including a logged-in administrator
- To plant one, an attacker needs back-end rights to edit gallery images, or the front-end YouTube upload feature, which is off by default
- 6.1.7 fixes it, and only on the Joomla 6 line. The releases Phoca’s update feed offers to Joomla 5 (5.1.3), Joomla 4 (4.5.5) and Joomla 3 (3.2.8) are all affected, with no patched successor
- Updating to 6.1.7 also defuses a malicious link already stored, because the stored value is re-validated every time it is rendered
- The flaw is CVE-2026-129418, scored CVSS 4.0 7.5 High by the Joomla CNA. There is no GitHub security advisory
- A site that updated to 6.1.6 for last month’s EXIF flaw is still exposed to this one
CVE-2026-129418Stored XSS through a Phoca Gallery YouTube video link
HighJoomla CNA
A crafted YouTube link saved on a gallery item runs script in the browser of anyone who opens that item, in the context of your site. That can hijack a logged-in session, including an administrator's.
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/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:P
- Present: Needs a particular deployment or race to line up
- PR:L
- Low: Any logged-in account will do
- UI:P
- Passive: Someone has to visit a page
What it does to the site
- VC:H
- High: Everything the site holds can be read
- VI:H
- High: Data and files can be altered at will
- VA:L
- Low: The site slows or stutters
What it does beyond the site
- SC:N
- None: Other systems keep their data
- SI:N
- None: Other systems keep their integrity
- SA:N
- None: Other systems stay up
The score is the Joomla CNA’s, from the CVE record published on 19 November 2026, and its vector treats the vulnerable configuration as a precondition (AT:P). Phoca’s announcement does not name a reporter; the CVE record credits Łukasz Rybak. The flaw is not in the CISA KEV catalogue (checked 19 November 2026).
How a YouTube link becomes script in Phoca Gallery for Joomla
Phoca Gallery lets a gallery item have a YouTube video attached to it. The link is stored with the image in a videocode column, and when the item is shown the extension turns that link into an embedded player. The code that does it is the PhocaGalleryYoutube class in admin/libraries/phocagallery/youtube/youtube.php.
Before 6.1.7, the getCode() method treated everything after the first = in the link as the video ID, or everything after youtu.be/ for the short form. Nothing checked that the result looked like a YouTube ID. The one test on the link was PhocaGalleryUtils::isURLAddress(), a regular expression that accepts any text after the host and path, quote marks included. A strip_tags() call removed HTML tags, which does nothing about quotes.
displayVideo() then joined that “ID” directly into the player markup:
// Phoca Gallery 6.1.6 and earlier, in displayVideo()
<iframe src="//www.youtube.com/embed/'.$code.'" ...>
// Phoca Gallery 6.1.7, in outline
// 1. isValidCode(): exactly 11 characters of A-Z, a-z, 0-9, underscore or hyphen
// 2. htmlspecialchars() on the ID before it is written into an https embed URL
A link whose “ID” contains a quote mark closes the src attribute early, and the browser reads the rest of it as more of the page. Text the extension treated as eleven harmless characters is parsed as markup, with your site’s origin, for whoever is looking at the item.
It is stored rather than reflected. The link sits in the database and is rendered in two places: the image detail view, and, on Phoca Gallery 4.4.x and later, the PhotoSwipe lightbox markup in the category view, where it is written into a data-video attribute. Releases before 4.4 used the older <object> and <embed> Flash markup with the same raw ID in it. Nothing in the page URL shows a visitor that the item is different from any other.
Who can plant a link, and who it fires on
Two kinds of account can save a YouTube link on a gallery item:
- Any back-end user who can edit Phoca Gallery images. The video code field on the image form is saved with
filter="raw", so what is typed is what is stored. - A front-end user with YouTube upload available to them. This route needs a lot to be in place: the YouTube upload option switched on (it is off by default,
youtube_upload = 0), front-end upload displayed, a user with upload rights on that category and a user folder, PHP curl, and a YouTube API key configured, because the import asks the YouTube API for the video’s details.
The CVE record describes the front-end route, “users with frontend upload permission”. The back-end field stores the same raw value and is rendered by the same code, so both routes count.
The person it fires on needs nothing. Anyone who opens the item gets the script, and when that person is a logged-in administrator, their session can then be used. On a site where content editors manage the gallery and an administrator reviews it, that is a path from a gallery editor’s account to an administrator’s session.
What Phoca Gallery 6.1.7 changes on a Joomla site
6.1.7 rewrites the YouTube handling around one rule: a YouTube ID is exactly 11 characters of A-Z, a-z, 0-9, underscore or hyphen, and anything else is rejected. A new isValidCode() method enforces it, and the rest of the class now goes through that check.
getCode()parses the link withparse_urland accepts onlyyoutu.be,youtube.comandyoutube-nocookie.comhosts (with awww.,m.ormusic.prefix stripped), in the/watch?v=,/embed/,/v/,/shorts/and/live/shapesdisplayVideo()derives and validates the ID again from the stored value on every render, escapes it withhtmlspecialchars, and uses https for the embedimportYtb()stores a canonicalhttps://www.youtube.com/watch?v=link built from the validated ID in place of the raw input, and appliesrawurlencodeto the values it sends in the YouTube API request- The title and description that come back from the YouTube API have their markup removed with
strip_tagsbefore they are saved - TLS certificate verification is no longer forced off for the YouTube import. The old code had a line,
$ssl = 0;, that overrode theyoutube_api_sslsetting
Phoca’s changelog lists four items under Security, among them “Fixed unvalidated YouTube video ID being used in the thumbnail file name”, plus one ordinary fix for the front-end YouTube upload redirect failing with a 404 after the item was saved.
The update also defuses links that are already stored
For a site that may already have been targeted, the second bullet is the useful one. Because displayVideo() validates on every render, and not only when a link is saved, a crafted link stored before the update stops working the moment 6.1.7 is installed. The code comment says as much: rows saved before the fix may contain attacker-controlled data. The old link stays in the videocode column, but it no longer reaches the page as markup.
That is the right way to fix a stored flaw. A fix that only validates new input leaves every site to hunt through its own history, and most never will. Validating at the point of output cleans up the past as a side effect of installing the update.
6.1.7 is also the first Phoca Gallery release whose manifest and installation XML point Joomla at a changelog, changelog6.xml, so the Joomla 6 update screen can show what changed before you apply it. For a security release that is a welcome addition.
Which Phoca Gallery versions for Joomla are affected?
Phoca Gallery 3.1.0 up to and including 6.1.6. The same unvalidated ID goes into the embed markup in 3.1.0, 3.1.5, 3.2.3, 4.1.2, 4.3.4, 4.4.3, 4.5.5, 5.1.3 and 6.1.6, so every release line in that range is affected. Phoca Gallery 3.0.2 has no YouTube support, so the range starts at 3.1.0.
The CVE record for CVE-2026-129418 lists a narrower range, 4.2.0 to 6.1.6. The same code is in 3.1.0 to 4.1.x, so those older builds are affected too, and mySites.guru flags them. Act on 3.1.0 to 6.1.6.
Phoca maintains one release line per Joomla generation, and only the Joomla 6 line received the fix:
| Joomla version | Newest Phoca Gallery the updater offers | Has the YouTube XSS fix? |
|---|---|---|
| Joomla 6 | 6.1.7 | Yes |
| Joomla 5 | 5.1.3 | No |
| Joomla 4 | 4.5.5 | No |
| Joomla 3 | 3.2.8 | No |
The table comes from Phoca’s update manifest, which matches each Joomla generation to one release on a targetplatform pattern. 6.1.7 is described as a native Joomla 6 extension, and there is no backport on the 3.x, 4.x or 5.x lines.
Joomla 3, 4 and 5 sites have no fixed Phoca Gallery release
Joomla’s updater can only offer what the vendor’s feed offers, and it discards any offered version that is not higher than the one installed. For Phoca Gallery on an older Joomla, that produces two different failures:
- A site on the 3.x, 4.x or 5.x line is offered 3.2.8, 4.5.5 or 5.1.3. All three are affected, so a site owner can apply every update on the screen in good faith and still be exposed.
- A Joomla 4 or 5 site already running a 6.x build is offered a lower version than it has. Joomla shows no update at all, and the site looks current while it runs 6.1.6 or older.
Across the Joomla sites mySites.guru monitors with an affected Phoca Gallery, about 57% are on the 6.x line and can take 6.1.7, on Joomla 6 through the normal updater. About 43% are on 3.x, 4.x or 5.x builds that have no fixed release. Most of those are old 4.x builds, and roughly a third of all affected installs are on 4.x releases older than 4.5.0.
Last month’s EXIF flaw had a published range that started at 4.5.0, so those sites were outside it and had no reason to act. The YouTube flaw reaches back to 3.1.0, and they are inside it.
An empty update list is not proof you are patched
On Joomla 3, 4 and 5, Phoca Gallery can show no available update while running an affected version, or offer an update that is itself affected. Read the installed Phoca Gallery version number yourself and compare it with 6.1.7.
What to do on each Joomla version
- Joomla 6: update Phoca Gallery to 6.1.7 through the normal Joomla updater, then confirm the version number. Stored links are neutralised by the update itself.
- Joomla 5 and Joomla 4: the 5.1.3 and 4.5.5 releases the updater offers do not fix this. Take a backup, then try the 6.x package from the GitHub release by hand, on a copy of the site first, since 6.1.7 is described as a native Joomla 6 extension. If it will not install or run, the choices are to move the site to Joomla 6 or to remove the gallery.
- Joomla 3: there is no fixed release and none is offered. Either the component goes or the site moves to a Joomla version that has one.
- If you cannot update yet, on any version: switch off front-end YouTube upload in Phoca Gallery’s options, restrict who can edit gallery images in the back end, and review the YouTube links on existing items. A normal link ends at the video ID. Anything after the ID that does not belong in a YouTube URL, quote marks especially, is the thing to look for.
- On any version, ask who had access: this is stored XSS, so the question is who could have saved a link. Review which accounts could edit gallery images, and which could upload from the front end if YouTube upload was ever enabled. Treat an administrator who opened a suspect item as having a session that may have been used.
See which of your sites are still on Joomla 3, 4 or 5
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.
How mySites.guru flags Phoca Gallery on your Joomla sites
The Phoca Gallery version on its own does not tell you what to do. You need the Joomla version beside it, because that decides whether the updater will deliver 6.1.7, whether you are testing a package by hand, or whether the site has no route to a fix at all.
mySites.guru holds both for every connected Joomla site. We added Phoca Gallery 3.1.0 to 6.1.6 to our vulnerability database on the day of the release, so every connected site running an affected version is flagged on its dashboard, with the Joomla version on the same screen. The full list of Phoca Gallery rules is on the Phoca Gallery page of the Joomla Vulnerability Database. For an agency, that turns one vendor announcement into a sorted work list without logging in to a single site. The Joomla 6 sites can be updated in one batch with the mass updater. What is left is the short list that needs a decision: the Joomla 4 and 5 sites for a manual package or a migration plan, and the Joomla 3 sites where the gallery has to be weighed against the risk. Those are client conversations, and it is better to start them with a list than to find out which sites were affected after one of them is defaced.
The same view works across a portfolio of Joomla sites of any size, and the next time a vendor releases a fix for one Joomla line only, the flag appears the same way. The vulnerability alerts, the version audit and the mass updater are part of every subscription.
Two Joomla gallery flaws a month apart
Phoca Gallery 6.1.6, released on 19 October 2026, fixed CVE-2026-102786, a stored XSS through a photo’s EXIF data that the Joomla CNA scored 8.6 High, with a range of 4.5.0 to 6.1.5. The YouTube embed code was unchanged in that release. A site that updated to 6.1.6 and considered the gallery dealt with has been exposed to this second flaw the whole time, and needs 6.1.7.
The two flaws have the same root: a value the extension thought of as data, written into an HTML attribute without being checked or escaped. EXIF looked like camera output. A YouTube link looks like configuration, a setting an editor pastes in once, and that is why no one reviews it as input. But a field that accepts text from a user and prints it on a page is input, whatever the label on the form says, and a video link field deserves the same suspicion as a comment box.
The distribution problem is familiar too. The Phoca Cart product filter SQL injection, the Phoca Cart download IDOR and the Phoca Download upload flaw were all fixed on the current Joomla line while older lines kept a version number that looked current, and so was Phoca Commander 6.1.5, a second round of fixes for the same file actions. Phoca is quick with the fix each time, and 6.1.7’s validate-on-render approach is better than most. The gap is in who receives it. If you still run Joomla 3, where Phoca’s extensions stand on Joomla 3 is the wider question to answer before the next release.
Phoca Gallery 6.1.6 fixes a stored XSS hidden in a photo's EXIF dataRead the full postTimeline
Phoca Gallery 6.1.6 fixes an EXIF stored XSS
The release fixed CVE-2026-102786 in the photo info view. The YouTube embed code was unchanged in it.
Phoca releases Phoca Gallery 6.1.7 as a security release
It fixes the YouTube link stored XSS on the Joomla 6 line. There is no 3.x, 4.x or 5.x release.
Joomla CNA publishes CVE-2026-129418
Scored 7.5 High, with an affected range of 4.2.0 to 6.1.6.
mySites.guru flags every affected site
Phoca Gallery 3.1.0 to 6.1.6 is added to the vulnerability database, so connected Joomla sites are flagged on their dashboards.
Further Reading
- Phoca Gallery version 6.1.7 has been released - Phoca's announcement, with the changelog for the security release.
- CVE-2026-129418 at cve.org - the CVE record, with the CNA's score and affected range.
- Phoca Gallery 6.1.7 on GitHub - the security release, with the package download for a manual install.
- Phoca Gallery update manifest - the feed that decides which Phoca Gallery each Joomla version is offered.
- Phoca Gallery changelog6.xml - the changelog file Joomla reads to show what changed in a 6.x release.
- Phoca Gallery in the mySites.guru Joomla Vulnerability Database - every Phoca Gallery rule we hold, with the affected ranges.
- CWE-79: Improper Neutralization of Input During Web Page Generation - the weakness class a stored XSS belongs to.
- OWASP Cross Site Scripting Prevention Cheat Sheet - why data inside an HTML attribute needs its own escaping rules.



