CVE-2026-48945: K2 Joomla Gallery Upload Remote Code Execution
K2, a popular article management component for Joomla, contains a vulnerability in its gallery upload feature. When users upload ZIP or TAR archives containing images, the system extracts them to a web-accessible directory but only safely renames actual image files (GIF, JPG, JPEG, PNG, WebP). Non-image files—critically, PHP scripts—are extracted with their original names and remain executable. An attacker can upload an archive containing a PHP webshell alongside legitimate images, and then directly access the shell via HTTP to execute arbitrary code on the server.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Weaknesses (CWE)
- CWE-434
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-25 / 2026-06-28
NVD description (verbatim)
The K2 article gallery upload path accepts a zip/tar archive, extracts it under `/media/k2/galleries/<id>/`, and only renames image files (gif/jpg/jpeg/png/webp) to safe names — non-image files (including `.php`) are extracted as-is and remain executable via direct HTTP access.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-48945 is an unrestricted file upload vulnerability (CWE-434) in the K2 gallery upload functionality. The affected code path accepts compressed archives, extracts contents to `/media/k2/galleries/<id>/`, and applies filename sanitization only to recognized image extensions. Non-image files bypass this filter entirely. Since the extraction directory is beneath the web root and directly accessible, any uploaded executable (PHP, HTAccess, etc.) becomes immediately callable via HTTP GET/POST requests, leading to arbitrary code execution under the web server's privilege level.
Business impact
An unauthenticated attacker can upload a malicious PHP file disguised within an archive to gain remote code execution on the Joomla server. This enables full compromise of the website, data exfiltration, malware distribution, defacement, and lateral movement into the internal network. Organizations running K2 galleries without additional upload controls face significant risk of brand damage, compliance violations, customer data loss, and operational downtime.
Affected systems
JoomlaWorks K2 component is affected. The vulnerability exists in the gallery upload handler and impacts any Joomla installation with K2 installed and the gallery feature accessible. Versions prior to the patched release are vulnerable; verify the specific version cutoff against the official JoomlaWorks advisory.
Exploitability
Exploitability is straightforward and requires no authentication or user interaction. An attacker simply crafts a ZIP archive containing a PHP webshell alongside benign image files, uploads it via the gallery feature, and accesses the uploaded PHP file directly. The CVSS score of 5.3 (Medium) reflects the low complexity and network accessibility, though the limited scope and information-disclosure nature of the current vector suggest real-world impact may be higher if combined with other Joomla vulnerabilities.
Remediation
Apply the latest security patch from JoomlaWorks as soon as it is released. The patch should enforce strict file-type validation and whitelist image extensions at upload time, reject non-image files explicitly, or store extracted files outside the web root. Until patching is complete, disable the K2 gallery upload feature or restrict access to trusted administrators only via Joomla ACLs.
Patch guidance
Monitor JoomlaWorks official channels and the Joomla Security Center for K2 update notifications. When available, apply patches immediately through the Joomla extension manager. Verify the patched version in release notes confirms the upload handler now rejects or quarantines non-image files. Test in a staging environment to ensure compatibility with your Joomla version and custom K2 configurations before production deployment.
Detection guidance
Look for .php or other executable files in `/media/k2/galleries/*/` directories that do not match expected image names or timestamps. Monitor web server access logs for HTTP requests to .php files within the k2/galleries path. Implement file integrity monitoring (FIM) on the galleries directory to detect unauthorized file creation. Review recent K2 gallery uploads for unusual archive names or timing. Consider Web Application Firewall (WAF) rules to block direct HTTP access to non-image files under /media/k2/galleries/.
Why prioritize this
Although the CVSS score is Medium, this vulnerability warrants prompt attention because it allows unauthenticated remote code execution, a critical business impact. K2 is widely deployed in Joomla sites; the ease of exploitation and lack of KEV designation suggest it has not yet become a mainstream attack target, but the low barrier to weaponization makes early patching essential to avoid opportunistic compromise.
Risk score, explained
The CVSS 3.1 score of 5.3 is based on network accessibility (AV:N), low attack complexity (AC:L), no privilege requirement (PR:N), no user interaction (UI:N), and unchanged scope (S:U). The impact is limited to confidentiality (C:L) because the vector assesses information disclosure; however, in practice, code execution enables integrity and availability impacts as well, so organizations should treat real-world risk as significantly higher than the base score suggests.
Frequently asked questions
Is K2 the same as Joomla's core component?
No. K2 is a third-party extension developed by JoomlaWorks that adds advanced article and content gallery functionality beyond Joomla's core. It is optional and installed separately; sites using only core Joomla are not affected.
Do all K2 installations have this vulnerability?
Any installation of K2 using the gallery upload feature with an unpatched version is vulnerable. If K2 is installed but the gallery feature is disabled or not used, risk is reduced, but the code path still exists and could be triggered by a future attack.
What if my K2 version is very old?
Older versions are almost certainly vulnerable. Check the JoomlaWorks security advisory for the exact version range affected and upgrade to the patched release immediately. Do not assume a very old version is 'safely' outdated.
Can a WAF rule block this attack?
Yes, a WAF can deny direct HTTP requests to .php files under the /media/k2/galleries/ path, or block file uploads containing non-image extensions in the archive. However, this is a band-aid; patching K2 itself is the correct fix.
This analysis is provided for informational purposes and based on the CVE record as of 2026-06-28. Actual risk and exploitability may vary based on your environment, K2 version, Joomla configuration, and access controls. Always consult the official JoomlaWorks security advisory for definitive patch guidance and version information before taking action. SEC.co makes no warranty regarding the completeness or accuracy of this analysis and disclaims liability for damages resulting from reliance on it. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-48946MEDIUMK2 PHP File Upload RCE – Patch Guidance & Detection
- CVE-2025-40808MEDIUMSIPROTEC 5 File Upload Vulnerability in Siemens Protective Relays
- CVE-2025-59872MEDIUMHCL ZIE for Web File Upload Code Execution Vulnerability
- CVE-2026-10172MEDIUMBdtask Multi-Store Inventory 1.0 Unrestricted File Upload Vulnerability
- CVE-2026-10205MEDIUMUnrestricted File Upload in Metasoft MetaCRM 6.4.0 – Exploit Details & Remediation
- CVE-2026-10806MEDIUMUnrestricted File Upload in mjperpinosa stumasy
- CVE-2026-10807MEDIUMUnrestricted File Upload in mjperpinosa stumasy Profile Image Handler
- CVE-2026-11333MEDIUMUnrestricted File Upload in CollegeManagementSystem Dashboard