Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1yNnI0LTVwcjgtZ2pjcM4AA4Lw

Vapor contains an integer overflow in URI leading to potential host spoofing

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 behaviour 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.

Impact

Users attempting to treat untrusted input as a URI are vulnerable to a host spoofing attack due to an integer overflow.

Workarounds

Validate user input before parsing as a URI or, if possible, use Foundation's URL and URLComponents utilities.

Permalink: https://github.com/advisories/GHSA-r6r4-5pr8-gjcp
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1yNnI0LTVwcjgtZ2pjcM4AA4Lw
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 11 months ago
Updated: 10 months ago


CVSS Score: 6.5
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Identifiers: GHSA-r6r4-5pr8-gjcp, CVE-2024-21631
References: Repository: https://github.com/vapor/vapor
Blast Radius: 18.9

Affected Packages

swift:github.com/vapor/vapor
Dependent packages: 122
Dependent repositories: 796
Downloads:
Affected Version Ranges: <= 4.89.3
Fixed in: 4.90.0
All affected versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.2.8, 0.2.9, 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75.1, 4.75.2, 4.76.0, 4.76.1, 4.76.2, 4.76.3, 4.76.4, 4.77.0, 4.77.1, 4.77.2, 4.78.0, 4.78.1, 4.78.2, 4.79.0, 4.80.0, 4.81.0, 4.81.1, 4.82.0, 4.83.0, 4.83.1, 4.83.2, 4.84.0, 4.84.1, 4.84.2, 4.84.3, 4.84.4, 4.84.5, 4.84.6, 4.85.0, 4.85.1, 4.86.0, 4.86.1, 4.86.2, 4.87.0, 4.87.1, 4.88.0, 4.89.0, 4.89.1, 4.89.2, 4.89.3
All unaffected versions: 4.90.0, 4.91.0, 4.91.1, 4.92.0, 4.92.1, 4.92.2, 4.92.3, 4.92.4, 4.92.5, 4.92.6, 4.92.7, 4.92.8, 4.92.9, 4.93.0, 4.93.1, 4.93.2, 4.94.0, 4.94.1, 4.95.0, 4.96.0, 4.97.0, 4.97.1, 4.98.0, 4.99.0, 4.99.1, 4.99.2, 4.99.3, 4.100.0, 4.100.1, 4.100.2, 4.101.0, 4.101.1, 4.101.2, 4.101.3, 4.101.4, 4.102.0, 4.102.1, 4.103.0, 4.103.1