CVE-2021-30151: Sidekiq Cross-Site Scripting Vulnerability
MODERATECVE-2021-30151 is a MODERATE (CVSS 6.1) 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 cross-site scripting in sidekiq. Remediation is available by upgrading affected packages to version 5.2.0, 6.2.1.
CVE-2021-30151 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2021-30151
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.
Upgrade sidekiq to 5.2.0
Upgrade sidekiq to 6.2.1
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-2021-30151, 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 5.2.0), 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
CVE-2021-30151 Affected Sidekiq Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
sidekiq
|
RubyGems |
< 5.2.0
|
5.2.0
|
|
sidekiq
|
RubyGems |
≥ 6.0.0
< 6.2.1
|
6.2.1
|
References
Frequently Asked Questions
What is CVE-2021-30151?
Which Sidekiq versions are affected?
What version fixes CVE-2021-30151?
Is sidekiq affected?
What is the CVSS score of CVE-2021-30151?
What CWE is associated with CVE-2021-30151?
How can I check RubyGems dependencies for CVE-2021-30151?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-grh7-935j-hg6w",
"modified" : "2023-01-24T15:03:47Z",
"published" : "2021-10-06T17:47:17Z",
"aliases" : [ "CVE-2021-30151" ],
"summary" : "Cross-site Scripting in Sidekiq",
"details" : "Sidekiq through 5.1.3 and 6.x through 6.2.0 allows XSS via the queue name of the live-poll feature when Internet Explorer is used.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "sidekiq"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.2.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "sidekiq"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-30151"
}, {
"type" : "WEB",
"url" : "https://github.com/mperham/sidekiq/issues/4852"
}, {
"type" : "WEB",
"url" : "https://github.com/mperham/sidekiq/commit/64f70339d1dcf50a55c00d36bfdb61d97ec63ed8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mperham/sidekiq"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2022/03/msg00015.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-10-06T16:52:11Z",
"nvd_published_at" : "2021-04-06T06:15:00Z"
}
}