CVE-2024-21631

Vapor is an HTTP web framework for Swift. Prior to version 4.90.0, Vapor's `vapor_urlparser_parse` function uses `uint16_t` indexes when parsing a URI's components, which may cause integer overflows when parsing untrusted inputs. This vulnerability does not affect Vapor directly but could impact applications relying on the URI type for validating user input. The URI type is used in several places in Vapor. A developer may decide to use URI to represent a URL in their application (especially if that URL is then passed to the HTTP Client) and rely on its public properties and methods. However, URI may fail to properly parse a valid (albeit abnormally long) URL, due to string ranges being converted to 16-bit integers. An attacker may use this behavior to trick the application into accepting a URL to an untrusted destination. By padding the port number with zeros, an attacker can cause an integer overflow to occur when the URL authority is parsed and, as a result, spoof the host. Version 4.90.0 contains a patch for this issue. As a workaround, validate user input before parsing as a URI or, if possible, use Foundation's `URL` and `URLComponents` utilities.
Configurations

Configuration 1 (hide)

cpe:2.3:a:vapor:vapor:*:*:*:*:*:*:*:*

History

10 Jan 2024, 18:40

Type Values Removed Values Added
CPE cpe:2.3:a:vapor:vapor:*:*:*:*:*:*:*:*
References () https://github.com/vapor/vapor/commit/6db3d917b5ce5024a84eb265ef65691383305d70 - () https://github.com/vapor/vapor/commit/6db3d917b5ce5024a84eb265ef65691383305d70 - Patch
References () https://github.com/vapor/vapor/security/advisories/GHSA-r6r4-5pr8-gjcp - () https://github.com/vapor/vapor/security/advisories/GHSA-r6r4-5pr8-gjcp - Vendor Advisory
First Time Vapor
Vapor vapor
Summary
  • (es) Vapor es un framework web HTTP para Swift. Antes de la versión 4.90.0, la función `vapor_urlparser_parse` de Vapor utiliza índices `uint16_t` al analizar los componentes de un URI, lo que puede causar desbordamientos de enteros al analizar entradas que no son de confianza. Esta vulnerabilidad no afecta a Vapor directamente, pero podría afectar a las aplicaciones que dependen del tipo de URI para validar la entrada del usuario. El tipo URI se utiliza en varios lugares de Vapor. Un desarrollador puede decidir utilizar URI para representar una URL en su aplicación (especialmente si esa URL luego se pasa al Cliente HTTP) y confiar en sus propiedades y métodos públicos. Sin embargo, es posible que el URI no pueda analizar correctamente una URL válida (aunque anormalmente larga), debido a que los rangos de cadenas se convierten a enteros de 16 bits. Un atacante puede utilizar este comportamiento para engañar a la aplicación para que acepte una URL a un destino que no es de confianza. Al rellenar el número de puerto con ceros, un atacante puede provocar un desbordamiento de enteros cuando se analiza la autoridad de la URL y, como resultado, falsificar el host. La versión 4.90.0 contiene un parche para este problema. Como workaround, valide la entrada del usuario antes de analizarla como URI o, si es posible, utilice las utilidades `URL` y `URLComponents` de Foundation.

03 Jan 2024, 17:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-01-03 17:15

Updated : 2024-01-10 18:40


NVD link : CVE-2024-21631

Mitre link : CVE-2024-21631

CVE.ORG link : CVE-2024-21631


JSON object : View

Products Affected

vapor

  • vapor
CWE
CWE-190

Integer Overflow or Wraparound

CWE-1104

Use of Unmaintained Third Party Components

CWE-20

Improper Input Validation