Vulnerabilities in pkg:gem/image_processing
PACKAGECVE-2022-24720 is a CRITICAL (CVSS 9.8) remote shell execution vulnerability vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Image processing libraries in the RubyGems ecosystem. The issue involves remote shell execution vulnerability in image_processing. Remediation is available by upgrading affected packages to version 1.12.2.
pkg:gem/image_processing
Vulnerability advisories affecting package pkg:gem/image_processing. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-cxf7-qrc5-9446 | CVE-2022-24720 | CRITICAL | Remote shell execution vulnerability in image_processing |
CVE-2022-24720 at a Glance
Security Impact
CVSS: 9.8
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:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-24720
To remediate this vulnerability, upgrade all affected Image processing 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 image_processing to 1.12.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for image_processing
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-24720, inspect your project dependencies for Image processing:
inspect dependencies for image_processing
Analyze the terminal output to locate any version of Image processing in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.12.2), 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Image processing, 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-2022-24720 Affected Image processing Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
image_processing
|
RubyGems |
< 1.12.2
|
1.12.2
|
References
Frequently Asked Questions
What is CVE-2022-24720?
Which Image processing versions are affected?
What version fixes CVE-2022-24720?
Is image_processing affected?
What is the CVSS score of CVE-2022-24720?
What CWE is associated with CVE-2022-24720?
How can I check RubyGems dependencies for CVE-2022-24720?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cxf7-qrc5-9446",
"modified" : "2022-03-10T15:56:28Z",
"published" : "2022-03-01T22:22:26Z",
"aliases" : [ "CVE-2022-24720" ],
"summary" : "Remote shell execution vulnerability in image_processing",
"details" : "### Impact\n\nWhen using the `#apply` method from image_processing to apply a series of operations that are coming from unsanitized user input, this allows the attacker to execute shell commands:\n\n```rb\nImageProcessing::Vips.apply({ system: \"echo EXECUTED\" })\n#>> EXECUTED\n```\n\nThis method is called internally by Active Storage variants, so Active Storage is vulnerable as well.\n\n### Patches\n\nThe vulnerability has been fixed in version 1.12.2 of image_processing.\n\n### Workarounds\n\nIf you're processing based on user input, it's highly recommended that you always sanitize the user input, by allowing only a constrained set of operations. For example:\n\n```rb\noperations = params[:operations]\n .map { |operation| [operation[:name], *operation[:value]] }\n .select { |name, *| name.to_s.include? %w[resize_to_limit strip ...] } # sanitization\n\nImageProcessing::Vips.apply(operations)\n```",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "image_processing"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.12.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/janko/image_processing/security/advisories/GHSA-cxf7-qrc5-9446"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24720"
}, {
"type" : "WEB",
"url" : "https://github.com/janko/image_processing/commit/038e4574e8f4f4b636a62394e09983c71980dada"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/janko/image_processing"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/image_processing/CVE-2022-24720.yml"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2022/dsa-5310"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-78" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-01T22:22:26Z",
"nvd_published_at" : "2022-03-01T23:15:00Z"
}
}