← Back to CVE Explorer

CVE-2026-48157

Full vulnerability record from the local CVENow database.

Description

Slim is a PHP micro framework that enables users to write simple web applications and APIs. In versions 4.4.0 through 4.15, if an application uses HttpException::setTitle() and/or setDescription() to include untrusted/request-derived data in the error title or description (e.g. "No products found matching '{$query}'."), an attacker could inject arbitrary HTML/JavaScript that executes in the victim's browser when they encounter an HTML error page generated by Slim. The vulnerability is present even with displayErrorDetails = false as the unescaped title and description are rendered on this error path. Built-in exceptions (HttpNotFoundException, HttpBadRequestException, etc.) ship plain-text defaults, so a vanilla Slim app with no user code is not exploitable. Only applications that feed untrusted data into setTitle() and/or setDescription() are affected. The issue has been fixed in 4.15.2. If developers are unable to immediately update their applications, they can work around this issue by avoiding passing untrusted/request-derived data into HttpException::setTitle() and setDescription() and using static, plain-text error copy instead. They should also register a custom error renderer (an ErrorRendererInterface implementation, or a subclass of HtmlErrorRenderer that escapes the title and description) for the HTML media type.

Severity
MEDIUM
CVSS score
6.1 (v3.1)
Vulnerability status
Deferred
Source identifier
Published
2026-06-15 22:16:17.090000
Last modified
2026-10-25 23:10:00.167000
View original CVE JSON
{
  "id": "CVE-2026-48157",
  "sourceIdentifier": "[email protected]",
  "published": "2026-06-15T22:16:17.090",
  "lastModified": "2026-10-25T23:10:00.167",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "Slim is a PHP micro framework that enables users to write simple web applications and APIs. In versions 4.4.0 through 4.15, if an application uses HttpException::setTitle() and/or setDescription() to include untrusted/request-derived data in the error title or description (e.g. \"No products found matching '{$query}'.\"), an attacker could inject arbitrary HTML/JavaScript that executes in the victim's browser when they encounter an HTML error page generated by Slim. The vulnerability is present even with displayErrorDetails = false as the unescaped title and description are rendered on this error path. Built-in exceptions (HttpNotFoundException, HttpBadRequestException, etc.) ship plain-text defaults, so a vanilla Slim app with no user code is not exploitable. Only applications that feed untrusted data into setTitle() and/or setDescription() are affected. The issue has been fixed in 4.15.2. If developers are unable to immediately update their applications, they can work around this issue by avoiding passing untrusted/request-derived data into HttpException::setTitle() and setDescription() and using static, plain-text error copy instead.\nThey should also register a custom error renderer (an ErrorRendererInterface implementation, or a subclass of HtmlErrorRenderer that escapes the title and description) for the HTML media type."
    },
    {
      "lang": "es",
      "value": "Slim es un micro framework de PHP que permite a los usuarios escribir aplicaciones web y APIs sencillas. En las versiones 4.4.0 a 4.15, si una aplicación utiliza HttpException::setTitle() y/o setDescription() para incluir datos no confiables/derivados de la solicitud en el título o la descripción del error (por ejemplo, ’No se encontraron productos que coincidan con ’{$query}’.’), un atacante podría inyectar HTML/JavaScript arbitrario que se ejecuta en el navegador de la víctima cuando esta encuentra una página de error HTML generada por Slim. La vulnerabilidad está presente incluso con displayErrorDetails = false, ya que el título y la descripción sin escapar se renderizan en esta ruta de error. Las excepciones integradas (HttpNotFoundException, HttpBadRequestException, etc.) vienen con valores predeterminados de texto plano, por lo que una aplicación Slim ’vainilla’ sin código de usuario no es explotable. Solo las aplicaciones que introducen datos no confiables en setTitle() y/o setDescription() se ven afectadas. El problema ha sido solucionado en la versión 4.15.2. Si los desarrolladores no pueden actualizar sus aplicaciones de inmediato, pueden solucionar este problema evitando pasar datos no confiables/derivados de la solicitud a HttpException::setTitle() y setDescription() y utilizando en su lugar una copia de error estática de texto plano. También deberían registrar un renderizador de errores personalizado (una implementación de ErrorRendererInterface, o una subclase de HtmlErrorRenderer que escape el título y la descripción) para el tipo de medio HTML."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "slimphp",
          "product": "Slim",
          "versions": [
            {
              "version": ">= 4.4.0, < 4.15.2",
              "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: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-16T12:21:29.106141Z",
          "id": "CVE-2026-48157",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "partial"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-79"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/slimphp/Slim/releases/tag/4.15.2",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/slimphp/Slim/security/advisories/GHSA-53h4-8rc4-f539",
      "source": "[email protected]"
    }
  ]
}