GHSA-CXF7-QRC5-9446
Vulnerability from github – Published: 2022-03-01 22:22 – Updated: 2022-03-10 15:56
VLAI
Summary
Remote shell execution vulnerability in image_processing
Details
Impact
When 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:
ImageProcessing::Vips.apply({ system: "echo EXECUTED" })
#>> EXECUTED
This method is called internally by Active Storage variants, so Active Storage is vulnerable as well.
Patches
The vulnerability has been fixed in version 1.12.2 of image_processing.
Workarounds
If 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:
operations = params[:operations]
.map { |operation| [operation[:name], *operation[:value]] }
.select { |name, *| name.to_s.include? %w[resize_to_limit strip ...] } # sanitization
ImageProcessing::Vips.apply(operations)
Severity
9.8 (Critical)
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "image_processing"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.12.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-24720"
],
"database_specific": {
"cwe_ids": [
"CWE-20",
"CWE-78"
],
"github_reviewed": true,
"github_reviewed_at": "2022-03-01T22:22:26Z",
"nvd_published_at": "2022-03-01T23:15:00Z",
"severity": "CRITICAL"
},
"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#\u003e\u003e 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\u0027re processing based on user input, it\u0027s 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```",
"id": "GHSA-cxf7-qrc5-9446",
"modified": "2022-03-10T15:56:28Z",
"published": "2022-03-01T22:22:26Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Remote shell execution vulnerability in image_processing"
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…