← Back to CVE Explorer

CVE-2026-44587

Full vulnerability record from the local CVENow database.

Description

CarrierWave is a framework to upload files from Ruby applications. In versions prior to 2.2.7 and 3.1.3, the content_type_denylist check fails to escape regex metacharacters in string entries, causing the denylist to silently not match the content types it is intended to block. In lib/carrierwave/uploader/content_type_denylist.rb:57, denylist entries are interpolated directly into a regex without Regexp.quote or anchoring, so an entry such as image/svg+xml becomes the pattern /image\/svg+xml/, in which + is treated as a quantifier rather than a literal character and therefore never matches the real MIME type image/svg+xml. This is inconsistent with the allowlist implementation, which correctly applies both Regexp.quote and a \A anchor. Other content types containing regex metacharacters, such as application/xhtml+xml, are affected as well. As a result, any application that relies on content_type_denylist to block image/svg+xml, most commonly to prevent stored XSS, is silently unprotected. An attacker can upload an SVG file containing arbitrary JavaScript; if the application serves that SVG inline from its own origin, the script executes in the victim's browser, resulting in stored XSS. This issue has been fixed in versions 2.2.7 and 3.1.3.

Severity
MEDIUM
CVSS score
6.1 (v3.1)
Vulnerability status
Analyzed
Source identifier
Published
2026-06-17 13:20:40.703000
Last modified
2026-10-25 23:10:00.167000
View original CVE JSON
{
  "id": "CVE-2026-44587",
  "sourceIdentifier": "[email protected]",
  "published": "2026-06-17T13:20:40.703",
  "lastModified": "2026-10-25T23:10:00.167",
  "vulnStatus": "Analyzed",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "CarrierWave is a framework to upload files from Ruby applications. In versions prior to 2.2.7 and 3.1.3, the content_type_denylist check fails to escape regex metacharacters in string entries, causing the denylist to silently not match the content types it is intended to block. In lib/carrierwave/uploader/content_type_denylist.rb:57, denylist entries are interpolated directly into a regex without Regexp.quote or anchoring, so an entry such as image/svg+xml becomes the pattern /image\\/svg+xml/, in which + is treated as a quantifier rather than a literal character and therefore never matches the real MIME type image/svg+xml. This is inconsistent with the allowlist implementation, which correctly applies both Regexp.quote and a \\A anchor. Other content types containing regex metacharacters, such as application/xhtml+xml, are affected as well. As a result, any application that relies on content_type_denylist to block image/svg+xml, most commonly to prevent stored XSS, is silently unprotected. An attacker can upload an SVG file containing arbitrary JavaScript; if the application serves that SVG inline from its own origin, the script executes in the victim's browser, resulting in stored XSS. This issue has been fixed in versions 2.2.7 and 3.1.3."
    },
    {
      "lang": "es",
      "value": "CarrierWave es un framework para subir archivos desde aplicaciones Ruby. En versiones anteriores a la 2.2.7 y 3.1.3, la verificación content_type_denylist no logra escapar los metacaracteres de regex en las entradas de cadena, lo que provoca que la denylist no coincida silenciosamente con los tipos de contenido que pretende bloquear. En lib/carrierwave/uploader/content_type_denylist.rb:57, las entradas de la denylist se interpolan directamente en una regex sin Regexp.quote ni anclaje, por lo que una entrada como image/svg+xml se convierte en el patrón /image\\/svg+xml/, en el que + se trata como un cuantificador en lugar de un carácter literal y, por lo tanto, nunca coincide con el tipo MIME real image/svg+xml. Esto es inconsistente con la implementación de la allowlist, que aplica correctamente tanto Regexp.quote como un anclaje \\A. Otros tipos de contenido que contienen metacaracteres de regex, como application/xhtml+xml, también se ven afectados. Como resultado, cualquier aplicación que dependa de content_type_denylist para bloquear image/svg+xml, más comúnmente para prevenir XSS almacenado, queda silenciosamente desprotegida. Un atacante puede subir un archivo SVG que contenga JavaScript arbitrario; si la aplicación sirve ese SVG en línea desde su propio origen, el script se ejecuta en el navegador de la víctima, lo que resulta en XSS almacenado. Este problema ha sido solucionado en las versiones 2.2.7 y 3.1.3."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "carrierwaveuploader",
          "product": "carrierwave",
          "versions": [
            {
              "version": "< 2.2.7",
              "status": "affected"
            },
            {
              "version": ">= 3.0.0.rc, < 3.1.3",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N",
          "baseScore": 4.7,
          "baseSeverity": "MEDIUM",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "NONE",
          "userInteraction": "REQUIRED",
          "scope": "CHANGED",
          "confidentialityImpact": "LOW",
          "integrityImpact": "NONE",
          "availabilityImpact": "NONE"
        },
        "exploitabilityScore": 2.8,
        "impactScore": 1.4
      },
      {
        "source": "[email protected]",
        "type": "Primary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
          "baseScore": 6.1,
          "baseSeverity": "MEDIUM",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "NONE",
          "userInteraction": "REQUIRED",
          "scope": "CHANGED",
          "confidentialityImpact": "LOW",
          "integrityImpact": "LOW",
          "availabilityImpact": "NONE"
        },
        "exploitabilityScore": 2.8,
        "impactScore": 2.7
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-06-17T18:06:48.640514Z",
          "id": "CVE-2026-44587",
          "options": [
            {
              "exploitation": "poc"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-79"
        },
        {
          "lang": "en",
          "value": "CWE-184"
        },
        {
          "lang": "en",
          "value": "CWE-625"
        }
      ]
    }
  ],
  "configurations": [
    {
      "nodes": [
        {
          "operator": "OR",
          "negate": false,
          "cpeMatch": [
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:*",
              "versionEndExcluding": "2.2.7",
              "matchCriteriaId": "668CFF1A-82AC-4AD7-B3AA-EA7771B0F1C5"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:a:carrierwave_project:carrierwave:*:*:*:*:*:ruby:*:*",
              "versionStartIncluding": "3.0.0",
              "versionEndExcluding": "3.1.3",
              "matchCriteriaId": "BA022DA2-E783-4FDD-A120-9B022C4D3461"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/carrierwaveuploader/carrierwave/commit/21221cc6e260633f7da78c6133a88666a5529d27",
      "source": "[email protected]",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://github.com/carrierwaveuploader/carrierwave/commit/4c4a005775a436c5165df014dc9b1874c227d86c",
      "source": "[email protected]",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-7g26-2qgj-chfg",
      "source": "[email protected]",
      "tags": [
        "Vendor Advisory",
        "Exploit"
      ]
    },
    {
      "url": "https://github.com/carrierwaveuploader/carrierwave/security/advisories/GHSA-7g26-2qgj-chfg",
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
      "tags": [
        "Vendor Advisory",
        "Exploit"
      ]
    }
  ]
}