Summary
CVE-2026-82526 is a critical, unauthenticated SQL injection vulnerability in R2R, an open-source Retrieval-Augmented Generation (RAG) platform maintained by SciPhi-AI. The flaw resides in the vector index creation endpoint, where the client-supplied index name is interpolated directly into a CREATE INDEX statement without identifier quoting or allowlist validation, allowing an attacker to append additional SQL statements that execute with PostgreSQL superuser privileges. The vulnerability carries a CVSS v3.1 base score of 9.8 (Critical) / CVSS v4.0 base score of 9.3 (Critical) and affects R2R through version 3.6.6.
Technical details
- Root cause: The index name parameter accepted by the vector index creation endpoint is embedded via string formatting into a
CREATE INDEXSQL statement without identifier quoting, sanitization, or allowlist validation (CWE-89: Improper Neutralization of Special Elements used in an SQL Command). - Trigger conditions: An attacker sends a crafted index name containing a semicolon-separated payload to the vector index creation endpoint; because the value is not quoted or validated, the database executes the injected statements as additional SQL commands (stacked queries).
- Attack vector: Network-based, unauthenticated, no user interaction required, low attack complexity (CVSS AV:N/AC:L/PR:N/UI:N).
- Impact: Because the underlying database connection operates with PostgreSQL superuser privileges, successful exploitation allows arbitrary DDL and DML execution — enabling full read/write access to stored data (including embedded documents and vectors), data destruction, and potential further compromise of the host database, resulting in complete loss of confidentiality, integrity, and availability.
Affected software
- SciPhi-AI R2R: all versions 0 through 3.6.6 (semantic versioning)
- Git
mainbranch up to and including commit9c5a94d151f90876bd7eb860f300a8fd662dc481 - Includes default Docker deployments (e.g.,
sciphiai/r2r:latest) built from the affected commit range
Severity
- CVSS v3.1 Base Score: 9.8 (Critical) —
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS v4.0 Base Score: 9.3 (Critical) —
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Mitigation and recommended actions
- Immediate: No fixed release has been published beyond the affected 3.6.6 baseline at the time of writing. Monitor the SciPhi-AI R2R repository for a patched release and upgrade as soon as one is available.
- If no patch is available:
- Restrict network access to R2R deployments (especially the vector index creation endpoint) to trusted internal networks only; do not expose the API directly to the internet.
- Enforce authentication on all API endpoints and avoid configurations that map unauthenticated requests to a privileged/superuser database account.
- Apply strict input validation/allowlisting (e.g.,
[A-Za-z0-9_]+) on any client-supplied identifier used to build index names, and use parameterized queries or PostgreSQL’squote_identfunction rather than raw string interpolation. - Run the underlying PostgreSQL database connection used by R2R with least-privilege credentials rather than superuser rights, to limit the blast radius of any injection.
- Deploy a web application firewall (WAF) or reverse proxy rule to detect and block anomalous characters (e.g., semicolons, SQL keywords) in index-name or filter parameters until a vendor patch is applied.
- Monitor database logs for unexpected DDL statements or stacked queries originating from the R2R application account.

