/

CVE-2026-82526

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in R2R Vector Index API Endpoint

CVE-2026-82526

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthenticated Arbitrary SQL Execution and Database Compromise

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

R2R through version 3.6.6 contains a critical stacked SQL injection vulnerability in the vector index creation endpoint. An unauthenticated attacker may manipulate the index name parameter to execute arbitrary SQL statements, including data definition and data modification operations, when the service uses a PostgreSQL superuser account.

Affected context

The vulnerability occurs in deployments where the R2R vector index creation endpoint is reachable by an attacker and accepts an index name that is incorporated into a PostgreSQL statement. Risk is higher when the endpoint lacks authentication or authorization controls and the application connects to the database with elevated privileges.

Exploit preconditions

  • Attack surface: The vector index creation API endpoint
  • Required access: Network access to the endpoint; authentication may not be required
  • Trigger point: Processing a user-controlled index name during vector index creation
  • Why exploitation is possible: The value is interpolated into a SQL statement without identifier quoting or allowlist validation, allowing statement boundaries and additional SQL operations to be interpreted by the database

Why this happens

The underlying bug is direct interpolation of untrusted input into a SQL statement that expects an identifier. Index names are treated as executable SQL syntax rather than as constrained data values, and the implementation does not apply safe identifier quoting or an allowlist of permitted names. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection.

Potential impact

  • An unauthenticated attacker may execute arbitrary SQL statements
  • Database records may be read, modified, inserted, or deleted
  • Database schema objects may be created, altered, or removed
  • Application data integrity and availability could be affected
  • A PostgreSQL superuser context could increase the scope of database compromise

General mitigation guidance

Mitigation generally focuses on ensuring that identifiers and values cannot be interpreted as unintended SQL syntax.

Common defensive patterns include:

  • Applying strict allowlist validation to index names
  • Using database-library identifier-quoting mechanisms rather than string formatting
  • Separating trusted SQL structure from untrusted input
  • Enforcing authentication and authorization for index-management operations
  • Connecting with a dedicated database role that has only the privileges required by the service
  • Restricting database network exposure and monitoring schema-changing activity

How teams detect issues like this

Organizations can look for this issue through:

  • Static analysis rules that flag string interpolation or concatenation in SQL construction
  • Code review checks for dynamic identifiers and missing identifier-quoting APIs
  • API security testing of administrative and index-management endpoints
  • Database audit logs showing unexpected DDL, DML, or schema changes
  • Policy enforcement requiring parameterized queries, validated identifiers, and least-privilege database roles
  • Neutral automated review tools that identify unsafe SQL construction patterns

Sources

SourceLink
github.comgithub.com/SciPhi-AI/R2R/issues/2309
vulncheck.comvulncheck.com/advisories/r2r-sql-injection-via-vector-index-creation-endpoint

Frequently asked

questions

Yes, when the vector index creation endpoint is network-accessible and does not require effective authentication or authorization. Exploitability depends on deployment exposure and endpoint controls.

The described issue may be exploitable without authentication, provided the attacker can reach the affected endpoint and submit an index name.

Treat index names as identifiers, not SQL fragments. Validate them against a strict allowlist and use the database driver's safe identifier-quoting mechanism, while avoiding direct string interpolation.

Combine parameterized database access with secure identifier handling, endpoint authorization, least-privilege database accounts, code review, static analysis, and database activity monitoring.

Find out what's already
exploitable in your codebase.