Skip to main content

Decidim Admin CVE-2026-45376

MEDIUM
SQL Injection (CWE-89)
2026-07-13 https://github.com/decidim/decidim GHSA-jvqq-cvh4-xm37
5.5
CVSS 3.1 · Vendor: https://github.com/decidim/decidim
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain or compromise organization admin credentials
  2. Delivery
    Authenticate to Decidim admin panel
  3. Exploit
    Craft time-based SQL payload in `term` parameter
  4. Execution
    Send GET /admin/organization/users with injected pg_sleep fragment
  5. Persist
    Measure response-time delta to confirm blind SQL execution
  6. Impact
    Iteratively query PostgreSQL via timing oracle to exfiltrate sensitive data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires an active, authenticated session holding the organization administrator role in Decidim - anonymous users, regular participants, and space-level administrators cannot access GET /admin/organization/users. The PostgreSQL pg_trgm extension must be present and enabled on the database, as the vulnerable similarity() function calls depend on it; however, Decidim's standard installation procedure enables pg_trgm by default, so this is not a meaningful barrier in practice. The endpoint must be reachable over the network, which is consistent with AV:N in the CVSS vector. Limiting factors are the elevated privilege requirement (PR:H) and the insider/compromised-account threat model: this vulnerability cannot be triggered without possessing or obtaining an organization admin credential. No verbose database error output is required because the attack relies entirely on time-based blind inference via pg_sleep, removing any dependency on error-based SQL injection techniques.

Impact

The vendor-assigned CVSS 6.8 vector (AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N) accurately reflects the high privilege barrier: only organization administrators can reach the vulnerable endpoint, which sharply limits opportunistic exploitation. S:C with C:H is justified because the injected SQL executes under the application's PostgreSQL role, which may have read access to tables beyond the organization user relation, enabling cross-schema data exfiltration. The CVSS A:N metric appears inconsistent with the advisory's explicit note that repeated pg_sleep payloads can degrade availability by exhausting database-backed request threads; this analysis rates availability as low rather than none. No EPSS score is provided, and the vulnerability is absent from CISA KEV, indicating no confirmed widespread in-the-wild exploitation. However, the advisory supplies a step-by-step reproduction procedure and a working SQL payload, meaning any organization admin with hostile intent or a compromised admin session has a confirmed exploitation path. The realistic threat is insider risk or post-credential-compromise lateral movement rather than mass exploitation.

Exploit ScenarioDerived

An organization administrator authenticates to a Decidim instance, then sends a crafted GET request to /admin/organization/users?term=slpleak%20%27%29%2C%20COALESCE%28%28SELECT%201%20FROM%20pg_sleep%2821%29%29%2C0%29%29%20-- with an Accept: application/json header. The server returns HTTP 200 after approximately 21 additional seconds compared to a baseline request, confirming that the pg_sleep(21) subquery was executed inside PostgreSQL's ORDER BY evaluation. The attacker then constructs iterative bitwise queries against the same endpoint to exfiltrate data from any table readable by the application's database role, extracting secrets such as session tokens or user credentials without triggering any database error responses.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 13, 2026

Blind SQL injection in decidim-admin's organization user search endpoint allows authenticated organization administrators to execute arbitrary PostgreSQL expressions inside an ORDER BY clause via the term query parameter. The flaw spans decidim-admin versions prior to 0.30.9, 0.31.5, and 0.32.0, and is exploitable using time-based payloads such as pg_sleep that return HTTP 200 while leaking data through measurable response-time deltas. No public exploit tool is identified at time of analysis and the vulnerability is not in CISA KEV, but the advisory provides working reproduction steps with a concrete payload, confirming practical exploitability.

RemediationAI

Upgrade the decidim-admin gem to the patched release for your branch: version 0.30.9 for 0.30.x deployments, 0.31.5 for 0.31.x deployments, or 0.32.0 for 0.32.x deployments. The patch (https://github.com/decidim/decidim/pull/16668) removes the vulnerable GET /admin/organization/users REST endpoint entirely and replaces the admin autocomplete with a GraphQL API call, eliminating the raw SQL interpolation path. If an immediate gem upgrade is not feasible, the vendor recommends auditing all organization administrator accounts and revoking admin roles from any untrusted or non-essential users, reducing the set of principals who can reach the endpoint; note that this is an access-control mitigation, not a code fix, and the injection remains in the codebase. A WAF or reverse proxy rule blocking requests to the path /admin/organization/users with a term parameter containing single-quote characters could provide a secondary layer, but risks breaking legitimate autocomplete functionality and should be tested thoroughly before deployment.

Affected Packages

rubygems decidim-admin fix: 0.30.9, 0.31.5, 0.32.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in rubygems

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Decidim is an open-source participatory democracy platform built on Ruby on Rails with PostgreSQL as its database backend. The affected component is the decidim-admin RubyGem (pkg:rubygems/decidim-admin). The vulnerability (CWE-89) originates in Decidim::Admin::OrganizationController#users, which passes params[:term] through Ruby string interpolation directly into Arel.sql() calls that construct ORDER BY expressions using PostgreSQL's similarity() function from the pg_trgm extension. Although ActiveRecord::Base.sanitize_sql_array is invoked, it receives an already-assembled SQL string rather than a parameterized template, so it cannot substitute bind variables and provides no protection. A single-quote embedded in term terminates the intended string literal and allows the attacker to inject arbitrary SQL into the sort expression. The fix in PR #16668 removes the vulnerable GET /admin/organization/users REST endpoint entirely, replacing the frontend autocomplete with a GraphQL API call that never constructs raw SQL from user input.

Know when PostgreSQL gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/decidim/decidim) PRIMARY 5.5 MEDIUM
AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:L
vuln.today AI 7.6 HIGH

Network-accessible admin-only endpoint (AV:N/PR:H); scope changes to other PostgreSQL tables via application role (S:C/C:H); low availability added for timing-based resource exhaustion noted in advisory (A:L).

3.1 AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:L
4.0 AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/decidim/decidim).

CVSS VectorVendor: https://github.com/decidim/decidim

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
Low

Lifecycle Timeline

1
CVSS changed
Jul 31, 2026 - 23:22 NVD
6.8 (MEDIUM) 5.5 (MEDIUM)

DescriptionCVE.org

The admin organization user search uses the untrusted term value inside raw SQL ORDER BY expressions. Because the value is interpolated before Rails sanitization is applied, a crafted search string is executed by PostgreSQL as part of the sort expression.

Technical description

The vulnerable endpoint is exposed as GET /admin/organization/users in decidim-admin/config/routes.rb:

ruby
resource :organization, only: [:edit, :update], controller: "organization" do
  member do
    get :users
  end
end

That route reaches Decidim::Admin::OrganizationController#users, which forwards the current organization's available users into search:

ruby
def users
  search(current_organization.users.available)
end

Inside search, the attacker-controlled source is params[:term]:

ruby
if (term = params[:term].to_s).present?

The query has two branches. In both branches, the WHERE predicates use bind parameters and are not the injection sink. The vulnerability is in the subsequent .order(Arel.sql(...)) calls, where the untrusted value is interpolated directly into SQL string literals.

Nickname branch:

ruby
nickname = term.delete("@")
relation.where("nickname LIKE ?", "#{nickname}%")
  .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("similarity(nickname, '#{nickname}') DESC")))

Name/email branch:

ruby
relation.where("name ILIKE ?", "%#{term}%").or(
  relation.where("email ILIKE ?", "%#{term}%")
)
  .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("GREATEST(similarity(name, '#{term}'), similarity(email, '#{term}')) DESC")))
  .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("(similarity(name, '#{term}') + similarity(email, '#{term}')) / 2 DESC")))

This use of sanitize_sql_array does not make the code safe. The interpolation happens first, so Rails receives an already-built SQL string rather than a statement with bind placeholders. As a result, a quote in term can terminate the intended string literal and inject attacker-controlled SQL into the ORDER BY expression.

For example, a payload such as slpleak '), COALESCE((SELECT 1 FROM pg_sleep(21)),0)) -- produces a fragment equivalent to:

sql
GREATEST(similarity(name, 'slpleak '), COALESCE((SELECT 1 FROM pg_sleep(21)),0)) --'), similarity(email, 'slpleak '), COALESCE((SELECT 1 FROM pg_sleep(21)),0)) --')) DESC

The injected subquery is therefore evaluated by PostgreSQL as SQL, not treated purely as data. Because the sink is in ORDER BY, the endpoint can still return a normal 200 OK response while exposing the issue through measurable timing differences.

Source-to-sink chain:

  • Source: params[:term]
  • Propagation: term = params[:term].to_s
  • Sink: .order(Arel.sql(... "#{term}" ...)) and .order(Arel.sql(... "#{nickname}" ...))
  • Effect: attacker-controlled SQL is executed inside the database sort expression

Reproduction steps:

  1. Authenticate as an organization admin.
  2. Ensure the search returns at least one row for the chosen payload. For a deterministic test, create a temporary

user whose name, email, or nickname matches the probe string.

  1. Send a control request to GET /admin/organization/users?term=test with Accept: application/json and record the response time.
  2. Send a payload request such as GET /admin/organization/users?term=slpleak%20%27%29%2C%20COALESCE%28%28SELECT%201%20FROM%20pg_sleep%2821%29%29%2C0%29%29%20-- with Accept: application/json.
  3. Observe that the endpoint still responds successfully, but the response time increases by approximately the sleep

interval, demonstrating time-based SQL execution in the ORDER BY clause.

Impact

  • Exploitation requires an authenticated admin session, which limits exposure but does not remove the underlying SQL injection risk.
  • An authenticated admin can inject arbitrary SQL expressions into the query's ORDER BY clause and use timing differences as a blind SQL oracle.
  • The injection happens inside a database expression, so the effect is not inherently limited to sorting the current organization user relation. Depending on the privileges of the application's PostgreSQL role, an attacker may be able to infer data from other tables readable by that role.
  • The issue remains exploitable even without verbose database errors because time-based payloads such as pg_sleep provide a reliable blind side channel.
  • Repeated long-running payloads can also be used to degrade availability by tying up database-backed requests.

Patches

See https://github.com/decidim/decidim/pull/16668

Workarounds

Review your administrator accesses and not give access to untrustworthy users

Reference

OWASP SQL Injection

Credits

This issue was discovered in a security audit organized by the Decidim Association and made by Radically Open Security against Decidim financed by NGI.

Threat Intelligence Overview

EPSS Score
0.3%
Top 73% exploitable
Prevalence
Low
niche open-source civic tech platform, limited enterprise footprint
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium
NVD CVE.org EPSS GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

Affected Products (CPE)CVE.org

pkg:rubygems/decidim-admin
pkg:rubygems/decidim-admin
pkg:rubygems/decidim-admin
CVE-2025-1094 HIGH POC
8.1 Feb 13

PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl

CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2013-1899 MEDIUM POC
6.5 Apr 04

Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re

CVE-2026-20253 CRITICAL POC
9.8 Jun 10

Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.

CVE-2026-9586 CRITICAL POC
9.3 Jul 17

Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar

CVE-2017-7546 CRITICAL
9.8 Aug 16

PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow

CVE-2015-1352 MEDIUM POC
5.0 Mar 30

The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t

CVE-2024-10553 CRITICAL POC
9.8 Mar 20

A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra

CVE-2019-9193 HIGH POC
7.2 Apr 01

In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve

CVE-2026-40887 CRITICAL POC
9.1 Apr 14

Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the

CVE-2022-24760 CRITICAL POC
10.0 Mar 12

Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot

CVE-2025-56157 CRITICAL POC
9.8 Dec 18

Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy