Skip to content
Heist/ feed
Back to feed
High

Koko Analytics vulnerable to arbitrary SQL execution through unescaped analytics export/import and permissive admin SQL import

Type: advisorySources: OSV

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

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-22850
Confirmed fixed CVEs
Not specified
Updated in this feed
8 Nov 2026, 03:05 UTC · Revision 1

Source evidence

Koko Analytics vulnerable to arbitrary SQL execution through unescaped analytics export/import and permissive admin SQL import

core-osv · Original source

Published 19 Jan 2026, 16:51 UTC

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

osv:CVE-2026-22850
Complete source record
{
  "id": "ecf45cd28ff156ba23024a6dfaac2c889da5158a6eecf27d28e16a068e9ed55d",
  "url": "https://osv.dev/vulnerability/CVE-2026-22850",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Koko Analytics vulnerable to arbitrary SQL execution through unescaped analytics export/import and permissive admin SQL import",
    "summary": "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 ",
    "evidence": "osv:CVE-2026-22850",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-22850",
      "aliases": [
        "CVE-2026-22850",
        "GHSA-jgfh-264m-xh3q"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/ibericode/koko-analytics",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "cf48b1e6c6e2ae20934285a2d8e4a16d9ff5b011"
                },
                {
                  "fixed": "7b7d58f4a1838c8203cf4e7bb59847c982432119"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:ibericode:koko_analytics:*:*:*:*:*:wordpress:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.1.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "7b7d58f4a1838c8203cf4e7bb59847c982432119"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "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"
          }
        }
      ],
      "modified": "2026-10-28T02:30:53.323100907Z",
      "provider": "osv",
      "references": [
        "https://drive.google.com/file/d/1HdQKf42prwrBUUG2CwbIkccTp2i6HR6d/view?usp=sharing",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22850.json",
        "https://github.com/ibericode/koko-analytics/security/advisories/GHSA-jgfh-264m-xh3q",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-22850",
        "https://github.com/ibericode/koko-analytics/commit/7b7d58f4a1838c8203cf4e7bb59847c982432119"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-89"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/22xxx/CVE-2026-22850.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-22850",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 522057,
  "published_at": "2026-01-19T16:51:00.394+00:00"
}