CVE-2026-45376 — Vulnerability in decidim-admin — CVE Details
Decidim: Admin user search allows SQL injection through similarity-based sorting
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.60%). Schedule for your next planned update.
Does your project use an affected decidim-admin version?
Paste your Gemfile.lock to check it for CVE-2026-45376 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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:
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:
def users
search(current_organization.users.available)
end
Inside search, the attacker-controlled source is params[:term]:
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:
nickname = term.delete("@")
relation.where("nickname LIKE ?", "#{nickname}%")
.order(Arel.sql(ActiveRecord::Base.sanitize_sql_array("similarity(nickname, '#{nickname}') DESC")))
Name/email branch:
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:
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:
- Authenticate as an organization admin.
- Ensure the search returns at least one row for the chosen payload. For a deterministic test, create a temporary
user whose
name,email, ornicknamematches the probe string. - Send a control request to
GET /admin/organization/users?term=testwithAccept: application/jsonand record the response time. - 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--withAccept: application/json. - 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 BYclause.
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 BYclause 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_sleepprovide 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.
Advisory Timeline
- First published July 13, 2026 (136 days ago).
- Last revised July 13, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install decidim-admin -v 0.31.5
gem install decidim-admin -v 0.32.0
gem install decidim-admin -v 0.30.9
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (3)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| decidim-admin RubyGems · Affected: 0.31.0, 0.31.0.rc1, 0.31.0.rc2, 0.31.1 (+3 more) | 0.31.5 |
| decidim-admin RubyGems · Affected: 0.32.0.rc1, 0.32.0.rc2, 0.32.0.rc3 | 0.32.0 |
| decidim-admin RubyGems · Affected: 0.0.1, 0.0.1.alpha3, 0.0.1.alpha4, 0.0.1.alpha5 (+156 more) | 0.30.9 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-89SQL InjectionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N
References
Frequently Asked Questions
- What is CVE-2026-45376?
- Decidim: Admin user search allows SQL injection through similarity-based sorting. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.8/10).
- How do I check if my project is affected by CVE-2026-45376?
- CVE-2026-45376 affects decidim-admin. It has a 0.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-45376 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 42.8% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-128084MEDIUM
sqlite3-ruby: Possible SQL query truncation when a string is 4 GiB or larger
- CVE-2024-27095MEDIUM
Decidim cross-site scripting (XSS) in the admin panel
- CVE-2026-115472MEDIUM
Doorkeeper: When using public clients, any client can revoke any access token
- CVE-2024-32034MEDIUM
Decidim::Admin vulnerable to cross-site scripting (XSS) in the admin activity log
- CVE-2023-48220MEDIUM
Possibility to circumvent the invitation token expiry period