# CVE-2026-22850: SQL injection in koko-analytics

> Attackers can execute arbitrary SQL via unescaped tracking data or malicious imports, enabling database destruction or admin account creation in Koko Analytics.

- **Severity:** High 8.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 19 Jan 2026
- **Updated:** 20 Jan 2026
- **Also known as:** GHSA-jgfh-264m-xh3q

## What is CVE-2026-22850?

CVE-2026-22850 is a high-severity SQL injection vulnerability in ibericode koko-analytics, published on 19 Jan 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-89 (Improper Neutralization of Special Elements used in an SQL Command)

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

It affects 1 product.


Products: Ibericode Koko Analytics.

## How do I fix CVE-2026-22850?

No fix has been published for CVE-2026-22850 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-22850 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-22850 exists.

## Other vulnerabilities in ibericode koko-analytics

- [CVE-2024-8662](https://insights.sbomify.com/CVE-2024-8662/): Koko Analytics <= 1.3.12 - Reflected Cross-Site Scripting (medium 6.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-22850 and fix it if it is affected.

What it is: CVE-2026-22850 is a high-severity SQL injection vulnerability in ibericode koko-analytics, published on 19 Jan 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-22850 exists.

Affected product: ibericode koko-analytics. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-22850/ (Markdown: https://insights.sbomify.com/CVE-2026-22850/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-22850
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-22850
- OSV: https://osv.dev/vulnerability/CVE-2026-22850

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-22850/
Summaries are generated and may contain mistakes; the official description above is the record.
