GSD-2022-21831

Vulnerability from gsd - Updated: 2022-03-08 00:00
Details
There is a possible code injection vulnerability in the Active Storage module of Rails. This vulnerability has been assigned the CVE identifier CVE-2022-21831. Versions Affected: >= 5.2.0 Not affected: < 5.2.0 Fixed Versions: 7.0.2.3, 6.1.4.7, 6.0.4.7, 5.2.6.3 Impact ------ There is a possible code injection vulnerability in the Active Storage module of Rails. This vulnerability impacts applications that use Active Storage with the image_processing processing in addition to the mini_magick back end for image_processing. Vulnerable code will look something similar to this: ```ruby <%= image_tag blob.variant(params[:t] => params[:v]) %> ``` Where the transformation method or its arguments are untrusted arbitrary input. All users running an affected release should either upgrade or use one of the workarounds immediately. Workarounds ----------- To work around this issue, applications should implement a strict allow-list on accepted transformation methods or arguments. Additionally, a strict image magick security policy will help mitigate this issue. https://imagemagick.org/script/security-policy.php
Aliases

{
  "GSD": {
    "alias": "CVE-2022-21831",
    "description": "A code injection vulnerability exists in the Active Storage \u003e= v5.2.0 that could allow an attacker to execute code via image_processing arguments.",
    "id": "GSD-2022-21831",
    "references": [
      "https://www.suse.com/security/cve/CVE-2022-21831.html",
      "https://www.debian.org/security/2023/dsa-5372"
    ]
  },
  "gsd": {
    "metadata": {
      "exploitCode": "unknown",
      "remediation": "unknown",
      "reportConfidence": "confirmed",
      "type": "vulnerability"
    },
    "osvSchema": {
      "affected": [
        {
          "package": {
            "ecosystem": "RubyGems",
            "name": "activestorage",
            "purl": "pkg:gem/activestorage"
          }
        }
      ],
      "aliases": [
        "CVE-2022-21831",
        "GHSA-w749-p3v6-hccq"
      ],
      "details": "There is a possible code injection vulnerability in the Active Storage module\nof Rails. This vulnerability has been assigned the CVE identifier\nCVE-2022-21831.\n\nVersions Affected:  \u003e= 5.2.0\nNot affected:       \u003c 5.2.0\nFixed Versions:     7.0.2.3, 6.1.4.7, 6.0.4.7, 5.2.6.3\n\nImpact\n------\nThere is a possible code injection vulnerability in the Active Storage module\nof Rails.  This vulnerability impacts applications that use Active Storage\nwith the image_processing processing in addition to the mini_magick back end\nfor image_processing.\n\nVulnerable code will look something similar to this:\n\n```ruby\n\u003c%= image_tag blob.variant(params[:t] =\u003e params[:v]) %\u003e\n```\n\nWhere the transformation method or its arguments are untrusted arbitrary\ninput.\n\nAll users running an affected release should either upgrade or use one of the\nworkarounds immediately.\n\nWorkarounds\n-----------\nTo work around this issue, applications should implement a strict allow-list\non accepted transformation methods or arguments.  Additionally, a strict image\nmagick security policy will help mitigate this issue.\n\n  https://imagemagick.org/script/security-policy.php\n",
      "id": "GSD-2022-21831",
      "modified": "2022-03-08T00:00:00.000Z",
      "published": "2022-03-08T00:00:00.000Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://groups.google.com/g/rubyonrails-security/c/n-p-W1yxatI"
        }
      ],
      "schema_version": "1.4.0",
      "severity": [
        {
          "score": 9.8,
          "type": "CVSS_V3"
        }
      ],
      "summary": "Possible code injection vulnerability in Rails / Active Storage"
    }
  },
  "namespaces": {
    "cve.org": {
      "CVE_data_meta": {
        "ASSIGNER": "support@hackerone.com",
        "ID": "CVE-2022-21831",
        "STATE": "PUBLIC"
      },
      "affects": {
        "vendor": {
          "vendor_data": [
            {
              "product": {
                "product_data": [
                  {
                    "product_name": "https://github.com/rails/rails",
                    "version": {
                      "version_data": [
                        {
                          "version_value": "7.0.2.3, 6.1.4.7, 6.0.4.7, 5.2.6.3"
                        }
                      ]
                    }
                  }
                ]
              },
              "vendor_name": "n/a"
            }
          ]
        }
      },
      "data_format": "MITRE",
      "data_type": "CVE",
      "data_version": "4.0",
      "description": {
        "description_data": [
          {
            "lang": "eng",
            "value": "A code injection vulnerability exists in the Active Storage \u003e= v5.2.0 that could allow an attacker to execute code via image_processing arguments."
          }
        ]
      },
      "problemtype": {
        "problemtype_data": [
          {
            "description": [
              {
                "lang": "eng",
                "value": "Code Injection (CWE-94)"
              }
            ]
          }
        ]
      },
      "references": {
        "reference_data": [
          {
            "name": "https://github.com/advisories/GHSA-w749-p3v6-hccq",
            "refsource": "MISC",
            "url": "https://github.com/advisories/GHSA-w749-p3v6-hccq"
          },
          {
            "name": "[debian-lts-announce] 20220903 [SECURITY] [DLA 3093-1] rails security update",
            "refsource": "MLIST",
            "url": "https://lists.debian.org/debian-lts-announce/2022/09/msg00002.html"
          },
          {
            "name": "https://security.netapp.com/advisory/ntap-20221118-0001/",
            "refsource": "CONFIRM",
            "url": "https://security.netapp.com/advisory/ntap-20221118-0001/"
          },
          {
            "name": "DSA-5372",
            "refsource": "DEBIAN",
            "url": "https://www.debian.org/security/2023/dsa-5372"
          }
        ]
      }
    },
    "github.com/rubysec/ruby-advisory-db": {
      "cve": "2022-21831",
      "cvss_v3": 9.8,
      "date": "2022-03-08",
      "description": "There is a possible code injection vulnerability in the Active Storage module\nof Rails. This vulnerability has been assigned the CVE identifier\nCVE-2022-21831.\n\nVersions Affected:  \u003e= 5.2.0\nNot affected:       \u003c 5.2.0\nFixed Versions:     7.0.2.3, 6.1.4.7, 6.0.4.7, 5.2.6.3\n\nImpact\n------\nThere is a possible code injection vulnerability in the Active Storage module\nof Rails.  This vulnerability impacts applications that use Active Storage\nwith the image_processing processing in addition to the mini_magick back end\nfor image_processing.\n\nVulnerable code will look something similar to this:\n\n```ruby\n\u003c%= image_tag blob.variant(params[:t] =\u003e params[:v]) %\u003e\n```\n\nWhere the transformation method or its arguments are untrusted arbitrary\ninput.\n\nAll users running an affected release should either upgrade or use one of the\nworkarounds immediately.\n\nWorkarounds\n-----------\nTo work around this issue, applications should implement a strict allow-list\non accepted transformation methods or arguments.  Additionally, a strict image\nmagick security policy will help mitigate this issue.\n\n  https://imagemagick.org/script/security-policy.php\n",
      "framework": "rails",
      "gem": "activestorage",
      "ghsa": "w749-p3v6-hccq",
      "patched_versions": [
        "~\u003e 5.2.6, \u003e= 5.2.6.3",
        "~\u003e 6.0.4, \u003e= 6.0.4.7",
        "~\u003e 6.1.4, \u003e= 6.1.4.7",
        "\u003e= 7.0.2.3"
      ],
      "title": "Possible code injection vulnerability in Rails / Active Storage",
      "unaffected_versions": [
        "\u003c 5.2.0"
      ],
      "url": "https://groups.google.com/g/rubyonrails-security/c/n-p-W1yxatI"
    },
    "gitlab.com": {
      "advisories": [
        {
          "affected_range": "\u003e=5.2.0 \u003c5.2.6.3||\u003e=6.0.0 \u003c6.0.4.7||\u003e=6.1.0 \u003c6.1.4.7||\u003e=7.0.0 \u003c7.0.2.3",
          "affected_versions": "All versions starting from 5.2.0 before 5.2.6.3, all versions starting from 6.0.0 before 6.0.4.7, all versions starting from 6.1.0 before 6.1.4.7, all versions starting from 7.0.0 before 7.0.2.3",
          "cvss_v2": "AV:N/AC:M/Au:N/C:P/I:P/A:P",
          "cvss_v3": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
          "cwe_ids": [
            "CWE-1035",
            "CWE-937",
            "CWE-94"
          ],
          "date": "2023-03-14",
          "description": "A code injection vulnerability exists in the Active Storage \u003e= v5.2.0 that could allow an attacker to execute code via image_processing arguments.",
          "fixed_versions": [
            "5.2.6.3",
            "6.0.4.7",
            "6.1.4.7",
            "7.0.2.3"
          ],
          "identifier": "CVE-2022-21831",
          "identifiers": [
            "CVE-2022-21831",
            "GHSA-w749-p3v6-hccq",
            "GMS-2022-301"
          ],
          "not_impacted": "All versions before 5.2.0, all versions starting from 5.2.6.3 before 6.0.0, all versions starting from 6.0.4.7 before 6.1.0, all versions starting from 6.1.4.7 before 7.0.0, all versions starting from 7.0.2.3",
          "package_slug": "gem/activestorage",
          "pubdate": "2022-05-26",
          "solution": "Upgrade to versions 5.2.6.3, 6.0.4.7, 6.1.4.7, 7.0.2.3 or above.",
          "title": "Improper Control of Generation of Code (\u0027Code Injection\u0027)",
          "urls": [
            "https://nvd.nist.gov/vuln/detail/CVE-2022-21831",
            "https://github.com/advisories/GHSA-w749-p3v6-hccq",
            "https://github.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546e",
            "https://groups.google.com/g/rubyonrails-security/c/n-p-W1yxatI",
            "https://rubysec.com/advisories/CVE-2022-21831/"
          ],
          "uuid": "b705c97b-1146-4ab0-930d-6607cda20480"
        },
        {
          "affected_range": "\u003c0",
          "affected_versions": "All versions starting from 5.2.0 up to 5.2.6.2, all versions starting from 6.0.0 up to 6.0.4.6, all versions starting from 6.1.0 up to 6.1.4.6, all versions starting from 7.0.0 up to 7.0.2.2",
          "cwe_ids": [
            "CWE-1035",
            "CWE-937"
          ],
          "date": "2022-03-08",
          "description": "The Active Storage module of Rails starting with version 5.2.0 are possibly vulnerable to code injection. This issue was patched in versions 5.2.6.2, 6.0.4.7, 6.1.4.7, and 7.0.2.3. To work around this issue, applications should implement a strict allow-list on accepted transformation methods or arguments. Additionally, a strict ImageMagick security policy will help mitigate this issue.",
          "fixed_versions": [
            "5.2.6.3",
            "6.0.4.7",
            "6.1.4.7",
            "7.0.2.3"
          ],
          "identifier": "GMS-2022-301",
          "identifiers": [
            "GHSA-w749-p3v6-hccq",
            "GMS-2022-301",
            "CVE-2022-21831"
          ],
          "not_impacted": "All versions before 5.2.0, all versions after 5.2.6.2 before 6.0.0, all versions after 6.0.4.6 before 6.1.0, all versions after 6.1.4.6 before 7.0.0, all versions after 7.0.2.2",
          "package_slug": "gem/activestorage",
          "pubdate": "2022-03-08",
          "solution": "Upgrade to versions 5.2.6.3, 6.0.4.7, 6.1.4.7, 7.0.2.3 or above.",
          "title": "Duplicate of ./gem/activestorage/CVE-2022-21831.yml",
          "urls": [
            "https://nvd.nist.gov/vuln/detail/CVE-2022-21831",
            "https://github.com/rails/rails/commit/0a72f7d670e9aa77a0bb8584cb1411ddabb7546e",
            "https://groups.google.com/g/rubyonrails-security/c/n-p-W1yxatI",
            "https://rubysec.com/advisories/CVE-2022-21831/",
            "https://github.com/advisories/GHSA-w749-p3v6-hccq"
          ],
          "uuid": "67a40378-7cd2-4bdd-8870-6c33d01b244c"
        }
      ]
    },
    "nvd.nist.gov": {
      "configurations": {
        "CVE_data_version": "4.0",
        "nodes": [
          {
            "children": [],
            "cpe_match": [
              {
                "cpe23Uri": "cpe:2.3:a:rubyonrails:active_storage:*:*:*:*:*:ruby:*:*",
                "cpe_name": [],
                "versionEndExcluding": "7.0.2.3",
                "versionStartIncluding": "7.0.0",
                "vulnerable": true
              },
              {
                "cpe23Uri": "cpe:2.3:a:rubyonrails:active_storage:*:*:*:*:*:ruby:*:*",
                "cpe_name": [],
                "versionEndExcluding": "6.1.4.7",
                "versionStartIncluding": "6.1.0",
                "vulnerable": true
              },
              {
                "cpe23Uri": "cpe:2.3:a:rubyonrails:active_storage:*:*:*:*:*:ruby:*:*",
                "cpe_name": [],
                "versionEndExcluding": "6.0.4.7",
                "versionStartIncluding": "6.0.0",
                "vulnerable": true
              },
              {
                "cpe23Uri": "cpe:2.3:a:rubyonrails:active_storage:*:*:*:*:*:ruby:*:*",
                "cpe_name": [],
                "versionEndExcluding": "5.2.6.3",
                "versionStartIncluding": "5.2.0",
                "vulnerable": true
              }
            ],
            "operator": "OR"
          },
          {
            "children": [],
            "cpe_match": [
              {
                "cpe23Uri": "cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*",
                "cpe_name": [],
                "vulnerable": true
              }
            ],
            "operator": "OR"
          }
        ]
      },
      "cve": {
        "CVE_data_meta": {
          "ASSIGNER": "cve-assignments@hackerone.com",
          "ID": "CVE-2022-21831"
        },
        "data_format": "MITRE",
        "data_type": "CVE",
        "data_version": "4.0",
        "description": {
          "description_data": [
            {
              "lang": "en",
              "value": "A code injection vulnerability exists in the Active Storage \u003e= v5.2.0 that could allow an attacker to execute code via image_processing arguments."
            }
          ]
        },
        "problemtype": {
          "problemtype_data": [
            {
              "description": [
                {
                  "lang": "en",
                  "value": "CWE-94"
                }
              ]
            }
          ]
        },
        "references": {
          "reference_data": [
            {
              "name": "https://github.com/advisories/GHSA-w749-p3v6-hccq",
              "refsource": "MISC",
              "tags": [
                "Patch",
                "Third Party Advisory"
              ],
              "url": "https://github.com/advisories/GHSA-w749-p3v6-hccq"
            },
            {
              "name": "[debian-lts-announce] 20220903 [SECURITY] [DLA 3093-1] rails security update",
              "refsource": "MLIST",
              "tags": [
                "Mailing List",
                "Third Party Advisory"
              ],
              "url": "https://lists.debian.org/debian-lts-announce/2022/09/msg00002.html"
            },
            {
              "name": "https://security.netapp.com/advisory/ntap-20221118-0001/",
              "refsource": "CONFIRM",
              "tags": [
                "Third Party Advisory"
              ],
              "url": "https://security.netapp.com/advisory/ntap-20221118-0001/"
            },
            {
              "name": "DSA-5372",
              "refsource": "DEBIAN",
              "tags": [],
              "url": "https://www.debian.org/security/2023/dsa-5372"
            }
          ]
        }
      },
      "impact": {
        "baseMetricV2": {
          "acInsufInfo": false,
          "cvssV2": {
            "accessComplexity": "MEDIUM",
            "accessVector": "NETWORK",
            "authentication": "NONE",
            "availabilityImpact": "PARTIAL",
            "baseScore": 6.8,
            "confidentialityImpact": "PARTIAL",
            "integrityImpact": "PARTIAL",
            "vectorString": "AV:N/AC:M/Au:N/C:P/I:P/A:P",
            "version": "2.0"
          },
          "exploitabilityScore": 8.6,
          "impactScore": 6.4,
          "obtainAllPrivilege": false,
          "obtainOtherPrivilege": false,
          "obtainUserPrivilege": false,
          "severity": "MEDIUM",
          "userInteractionRequired": false
        },
        "baseMetricV3": {
          "cvssV3": {
            "attackComplexity": "LOW",
            "attackVector": "NETWORK",
            "availabilityImpact": "HIGH",
            "baseScore": 9.8,
            "baseSeverity": "CRITICAL",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "privilegesRequired": "NONE",
            "scope": "UNCHANGED",
            "userInteraction": "NONE",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "exploitabilityScore": 3.9,
          "impactScore": 5.9
        }
      },
      "lastModifiedDate": "2023-03-14T08:15Z",
      "publishedDate": "2022-05-26T17:15Z"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

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…

Detection rules are retrieved from Rulezet.

Loading…

Loading…