CSIRTS // UNIFIED SECURITY ADVISORY FEEDSYS ● ONLINE · POWERED BY INTELFUSIONS.COM

GHSA-jvqq-cvh4-xm37: Decidim: Admin user search allows SQL injection through similarity-based sorting

mediumCVSS 6.8CVE-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 '),

Details

Source
GitHub Security Advisories (INTL · database · site)
Severity
medium — CVSS 6.8
Published
2026-07-13
Last updated
2026-07-13
Exploitation
Not in CISA KEV at last sync

Original advisory: https://github.com/advisories/GHSA-jvqq-cvh4-xm37

Exploitation outlook

EPSS (FIRST.org) estimates each CVE’s probability of exploitation in the next 30 days — here is the CSIRTS.com read on those numbers.

Referenced CVEs

CVECSIRTS overviewExternal
CVE-2026-45376coverage & exploitation statusNVD · CVE.org

Same CVEs, other sources

How other CERTs, PSIRTs and databases cover the vulnerabilities in this advisory.

More from GitHub Security Advisories