# CVE-2026-22850: Koko Analytics vulnerable to arbitrary SQL execution through unescaped analytics export/import and permissive admin SQL import

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.4
- **CVSS:** 8.4 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; User interaction: Required; Scope: Changed (impact reaches other components); Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.74% (percentile 51, 2026-11-26)
- **CWE:** CWE-89
- **Published:** 2026-01-19T16:51:00.394Z
- **Modified:** 2026-06-17T10:20:30.087Z

## Who should check

- Anyone running ibericode koko-analytics \< 2.1.3

## Description

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-\>query 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.

## Affected and fixed versions

- ibericode koko-analytics: \< 2.1.3 (cvelist)

## Mitigation

- Upgrade koko-analytics to 2.1.3 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-22850. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-22850.md
Affected: ibericode koko-analytics < 2.1.3
Fixed in: ibericode koko-analytics 2.1.3

Steps:
1. Search this machine and project for ibericode koko-analytics: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-22850 being exploited?

There is no confirmed exploitation: CVE-2026-22850 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 0.74% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-22850?

High: CVSS 8.4 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2026-22850?

ibericode koko-analytics \< 2.1.3.

### Is there a fix for CVE-2026-22850?

Yes. Fixed in ibericode koko-analytics 2.1.3. Upgrade koko-analytics to 2.1.3 or later.

### How do I check if I'm affected by CVE-2026-22850?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/ibericode/koko-analytics/security/advisories/GHSA-jgfh-264m-xh3q>
- patch: <https://github.com/ibericode/koko-analytics/commit/7b7d58f4a1838c8203cf4e7bb59847c982432119>
- exploit: <https://drive.google.com/file/d/1HdQKf42prwrBUUG2CwbIkccTp2i6HR6d/view?usp=sharing>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-22850>

HTML: <https://flawdb.com/CVE-2026-22850> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-22850>
