Executive brief
A vulnerability in a popular PHP file upload library, used by the Joomla! K2 extension and other web applications, allows attackers to bypass security filters. By uploading a malicious file disguised with a specific extension, an attacker can take complete control of the web server. This could lead to the theft of sensitive customer data, website defacement, or a total service outage.
Technical details
An unrestricted file upload vulnerability (CWE-434) exists in verot.net class.upload.php before 1.0.3 and 2.x before 2.0.4. The library's security filter, which renames dangerous file types to .txt, omits the '.phar' extension from its regex-based blacklist. A remote, unauthenticated attacker can exploit this by uploading a PHP Archive (PHAR) file containing malicious code. If the web server is configured to execute .phar files, the attacker can achieve arbitrary remote code execution. This library is notably used in the Joomla! K2 extension (up to version 2.10.1). Patches are available in versions 1.0.3 and 2.0.4.
Affected products
- verot.net class.upload.php < 1.0.3, >= 2.0.0, < 2.0.4
- Joomla! K2 <= 2.10.1
Timeline
- 2019-12-04: disclosed: NVD publication date
- 2020-01-16: advisory: GitHub Advisory published
References
- https://github.com/getk2/k2/commit/d1344706c4b74c2ae7659b286b5a066117155124
- https://github.com/verot/class.upload.php/commit/5a7505ddec956fdc9e9c071ae5089865559174f1
- https://github.com/verot/class.upload.php/commit/db1b4fe50c1754696970d8b437f07e7b94a7ebf2
- https://github.com/jra89/CVE-2019-19576
- https://github.com/verot/class.upload.php/compare/1.0.2...1.0.3