Vulnerabilities in pkg:gem/decidim-admin

PACKAGE
Advisory Identifier: GHSA-jvqq-cvh4-xm37
Advisory Summary

CVE-2026-45376 is a MODERATE (CVSS 6.8) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Decidim libraries in the RubyGems ecosystem. The issue involves admin user search allows sql injection through similarity-based sorting. Remediation is available by upgrading affected packages to version 0.30.9, 0.31.5, 0.32.0.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/decidim-admin

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/decidim-admin. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-jvqq-cvh4-xm37 CVE-2026-45376 MODERATE Decidim: Admin user search allows SQL injection through similarity-based sorting
GHSA-rx9f-5ggv-5rh6 CVE-2024-32034 MODERATE Decidim::Admin vulnerable to cross-site scripting (XSS) in the admin activity log
GHSA-529p-jj47-w3m3 CVE-2024-27095 MODERATE Decidim cross-site scripting (XSS) in the admin panel
GHSA-w3q8-m492-4pwp CVE-2023-48220 MODERATE Possibility to circumvent the invitation token expiry period

CVE-2026-45376 at a Glance

CVE Identifier CVE-2026-45376
GHSA Identifier GHSA-jvqq-cvh4-xm37
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Decidim
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-45376

To remediate this vulnerability, upgrade all affected Decidim dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

decidim-admin fixed: 0.30.9
Upgrade decidim-admin to 0.30.9
decidim-admin fixed: 0.31.5
Upgrade decidim-admin to 0.31.5
decidim-admin fixed: 0.32.0
Upgrade decidim-admin to 0.32.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for decidim-admin

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-45376, inspect your project dependencies for Decidim:

inspect dependencies for decidim-admin

Analyze the terminal output to locate any version of Decidim in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.30.9), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Decidim, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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. 3. Send a control request to `GET /admin/organization/users?term=test` with `Accept: application/json` and record the response time. 4. 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`. 5. 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](https://decidim.org) and made by [Radically Open Security](https://www.radicallyopensecurity.com/) against Decidim financed by [NGI](https://ngi.eu/).

CVE-2026-45376 Affected Decidim Versions

3 component(s)
Fixed Versions:
0.30.90.31.50.32.0
Product / Package Ecosystem Affected Versions Fixed Version
decidim-admin
RubyGems
< 0.30.9
0.30.9
decidim-admin
RubyGems
≥ 0.31.0.rc1
< 0.31.5
0.31.5
decidim-admin
RubyGems
≥ 0.32.0.rc1
< 0.32.0
0.32.0

References

Frequently Asked Questions

What is CVE-2026-45376?
CVE-2026-45376 is a security vulnerability in Decidim involving Admin user search allows SQL injection through similarity-based sorting under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Decidim versions are affected?
Affected versions include releases prior to 0.30.9, 0.31.5, 0.32.0 across affected packages: decidim-admin.
What version fixes CVE-2026-45376?
Upgrading to 0.30.9, 0.31.5, 0.32.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is decidim-admin affected?
Yes, decidim-admin is affected in releases prior to 0.30.9, 0.31.5, 0.32.0. Upgrade your dependency to 0.30.9, 0.31.5, 0.32.0 or later.
What is the CVSS score of CVE-2026-45376?
CVE-2026-45376 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2026-45376?
CVE-2026-45376 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check RubyGems dependencies for CVE-2026-45376?
Run the dependency tree command: 'inspect dependencies for decidim-admin'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jvqq-cvh4-xm37",
  "modified" : "2026-07-13T16:59:49Z",
  "published" : "2026-07-13T16:59:49Z",
  "aliases" : [ "CVE-2026-45376" ],
  "summary" : "Decidim: Admin user search allows SQL injection through similarity-based sorting",
  "details" : "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.\n\n### Technical description\n \nThe vulnerable endpoint is exposed as GET `/admin/organization/users` in `decidim-admin/config/routes.rb`:\n\n```ruby\nresource :organization, only: [:edit, :update], controller: \"organization\" do\n  member do\n    get :users\n  end\nend\n```\n\nThat route reaches `Decidim::Admin::OrganizationController#users`, which forwards the current organization's available users into `search`:\n\n```ruby\ndef users\n  search(current_organization.users.available)\nend\n```\n\nInside `search`, the attacker-controlled source is `params[:term]`:\n\n```ruby\nif (term = params[:term].to_s).present?\n```\n\nThe 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.\n\nNickname branch:\n\n```ruby\nnickname = term.delete(\"@\")\nrelation.where(\"nickname LIKE ?\", \"#{nickname}%\")\n  .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array(\"similarity(nickname, '#{nickname}') DESC\")))\n```\n\nName/email branch:\n\n```ruby\nrelation.where(\"name ILIKE ?\", \"%#{term}%\").or(\n  relation.where(\"email ILIKE ?\", \"%#{term}%\")\n)\n  .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array(\"GREATEST(similarity(name, '#{term}'), similarity(email, '#{term}')) DESC\")))\n  .order(Arel.sql(ActiveRecord::Base.sanitize_sql_array(\"(similarity(name, '#{term}') + similarity(email, '#{term}')) / 2 DESC\")))\n```\n\nThis 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.\n\nFor example, a payload such as `slpleak '), COALESCE((SELECT 1 FROM pg_sleep(21)),0)) --` produces a fragment equivalent to:\n\n```sql\nGREATEST(similarity(name, 'slpleak '), COALESCE((SELECT 1 FROM pg_sleep(21)),0)) --'), similarity(email, 'slpleak '), COALESCE((SELECT 1 FROM pg_sleep(21)),0)) --')) DESC\n``` \n\nThe 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.\n\nSource-to-sink chain:\n\n* Source: `params[:term]`\n* Propagation: `term = params[:term].to_s`\n* Sink: `.order(Arel.sql(... \"#{term}\" ...))` and `.order(Arel.sql(... \"#{nickname}\" ...))`\n* Effect: attacker-controlled SQL is executed inside the database sort expression\n\nReproduction steps:\n\n1. Authenticate as an organization admin.\n2. Ensure the search returns at least one row for the chosen payload. For a deterministic test, create a temporary\nuser whose `name`, `email`, or `nickname` matches the probe string.\n3. Send a control request to `GET /admin/organization/users?term=test` with `Accept: application/json` and record the response time.\n4. 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`.\n5. Observe that the endpoint still responds successfully, but the response time increases by approximately the sleep\ninterval, demonstrating time-based SQL execution in the `ORDER BY` clause.\n\n### Impact\n\n- Exploitation requires an authenticated admin session, which limits exposure but does not remove the underlying SQL injection risk.\n- An authenticated admin can inject arbitrary SQL expressions into the query's `ORDER BY` clause and use timing differences as a blind SQL oracle.\n- 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.\n- The issue remains exploitable even without verbose database errors because time-based payloads such as `pg_sleep` provide a reliable blind side channel.\n- Repeated long-running payloads can also be used to degrade availability by tying up database-backed requests.\n\n### Patches\n\nSee https://github.com/decidim/decidim/pull/16668 \n\n### Workarounds\n\nReview your administrator accesses and not give access to untrustworthy users\n\n### Reference\n\nOWASP SQL Injection\n\n### Credits\n\nThis issue was discovered in a security audit organized by the [Decidim Association](https://decidim.org) and made by [Radically Open Security](https://www.radicallyopensecurity.com/) against Decidim financed by [NGI](https://ngi.eu/).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "decidim-admin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.30.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "decidim-admin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.31.0.rc1"
      }, {
        "fixed" : "0.31.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "decidim-admin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.32.0.rc1"
      }, {
        "fixed" : "0.32.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/security/advisories/GHSA-jvqq-cvh4-xm37"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/decidim/decidim/pull/16668"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/decidim/decidim"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-13T16:59:49Z",
    "nvd_published_at" : null
  }
}