{"id":"CVE-2026-22850","summary":"Koko Analytics vulnerable to arbitrary SQL execution through unescaped analytics export/import and permissive admin SQL import","details":"Koko Analytics is an open-source analytics plugin for WordPress. Versions prior to 2.1.3 are vulnerable to arbitrary SQL execution through unescaped analytics export/import and permissive admin SQL import. Unauthenticated visitors can submit arbitrary path (`pa`) and referrer (`r`) values to the public tracking endpoint in src/Resources/functions/collect.php, which stores those strings verbatim in the analytics tables. The admin export logic in src/Admin/Data_Export.php writes these stored values directly into SQL INSERT statements without escaping. A crafted path such as \"),('999','x');DROP TABLE wp_users;-- breaks out of the value list. When an administrator later imports that export file, the import handler in src/Admin/Data_Import.php reads the uploaded SQL with file_get_contents, performs only a superficial header check, splits on semicolons, and executes each statement via $wpdb-\u003equery with no validation of table names or statement types. Additionally, any authenticated user with manage_koko_analytics can upload an arbitrary .sql file and have it executed in the same permissive way. Combined, attacker-controlled input flows from the tracking endpoint into exported SQL and through the import execution sink, or directly via malicious uploads, enabling arbitrary SQL execution. In a worst-case scenario, attackers can achieve arbitrary SQL execution on the WordPress database, allowing deletion of core tables (e.g., wp_users), insertion of backdoor administrator accounts, or other destructive/privilege-escalating actions. Version 2.1.3 patches the issue.","aliases":["GHSA-jgfh-264m-xh3q"],"modified":"2026-08-12T03:51:25.957243129Z","published":"2026-01-19T16:51:00.394Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-89"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22850.json"},"references":[{"type":"WEB","url":"https://drive.google.com/file/d/1HdQKf42prwrBUUG2CwbIkccTp2i6HR6d/view?usp=sharing"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22850.json"},{"type":"ADVISORY","url":"https://github.com/ibericode/koko-analytics/security/advisories/GHSA-jgfh-264m-xh3q"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22850"},{"type":"FIX","url":"https://github.com/ibericode/koko-analytics/commit/7b7d58f4a1838c8203cf4e7bb59847c982432119"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/ibericode/koko-analytics","events":[{"introduced":"0"},{"fixed":"cf48b1e6c6e2ae20934285a2d8e4a16d9ff5b011"},{"fixed":"7b7d58f4a1838c8203cf4e7bb59847c982432119"}],"database_specific":{"cpe":"cpe:2.3:a:ibericode:koko_analytics:*:*:*:*:*:wordpress:*:*","extracted_events":[{"introduced":"0"},{"fixed":"2.1.3"}],"source":["CPE_RANGE","REFERENCES"]}}],"versions":["2.1.2","2.1.1","2.1.0","2.0.22","2.0.21","2.0.20","2.0.19","2.0.18","2.0.17","2.0.16","2.0.15","2.0.14","2.0.13","2.0.12","2.0.11","2.0.10","2.0.9","2.0.8","2.0.7","2.0.6","2.0.5","2.0.4","2.0.3","2.0.2","2.0.1","2.0.0","1.8.6","1.8.5","1.8.4","1.8.3","1.8.2","1.8.1","1.8.0","1.7.3","1.7.2","1.7.1","1.7.0","1.6.6","1.6.5","1.6.5-dev","1.6.3","1.6.2-trunk","1.6.2","1.6.1-trunk","1.6.1","1.6.0","1.5.5","1.5.4","1.5.3","1.5.2","1.5.1","1.5.0","1.4.5","1.4.4","1.4.3","1.4.2","1.4.1","1.4.0","1.3.14","1.3.13","1.3.12","1.3.11","1.3.10","1.3.9","1.3.8","1.3.7","1.3.6","1.3.5","1.3.4","1.3.3","1.3.2","1.3.1","1.3.0","1.2.2","1.2.1","1.2.0","1.1.2","1.1.1","1.1","1.1.0-alpha","1.0.39","1.0.38","1.0.37","1.0.36","1.0.35","1.0.34","1.0.33","1.0.32","1.0.31","1.0.30","1.0.29","1.0.28","1.0.27","1.0.26","1.0.25","1.0.24","1.0.23","1.0.22","1.0.21","1.0.20","1.0.19","1.0.18","1.0.17","1.0.16","1.0.15","1.0.14","1.0.13","1.0.12","1.0.11","1.0.10","1.0.9","1.0.8","1.0.7","1.0.5","1.0.4","1.0.3","1.0.2","1.0.1","1.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-22850.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H"}]}