CVE-2026-45376
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 '),
⚡ Watch CVE-2026-45376
Get an email if CVE-2026-45376 is added to CISA KEV, gains public exploit code, or a new advisory cites it — max one per day, one-click unsubscribe.
Exploitation outlook
- Low exploitation risk0.34% 30-day exploitation probability — currently an unlikely target, but scores change as exploit code circulates. Riskier than 27% of all EPSS-scored CVEs.
Advisory coverage (2)
External references
Embed the live status
— this badge updates automatically when the KEV or exploit status changes. How to embed it →
[](https://www.csirts.com/cve/CVE-2026-45376)