CVE-2024-21631
published medium CVSS 3.1 · 6.5Integer overflow in URI leading to potential host spoofing
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| vapor | — | vapor< 4.90.0 | Affected | Not stated | GitHub_M |
| vapor | — | vapor0 to < 4.90.0 · Other versions: unknown | Affected | Not stated | CISA-ADP |
| vapor | — | vaporpkg:swift/github.com/vapor/vapor@0 to < pkg:swift/github.com/vapor/[email protected] · Other versions: unknown | Affected | Not stated | CISA-ADP |
Description
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 6.5 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| vapor | vapor | < 4.90.0 (affected) | GitHub_M · cna |
| vapor | vapor | 0 to < 4.90.0 (affected · custom)Default: unknown | CISA-ADP · adp |
| vapor | vapor | pkg:swift/github.com/vapor/vapor@0 to < pkg:swift/github.com/vapor/[email protected] (affected · custom)Default: unknown | CISA-ADP · adp |
Weaknesses
3- CWE-20 CWE-20: Improper Input Validation
- CWE-190 CWE-190: Integer Overflow or Wraparound
- CWE-1104 CWE-1104: Use of Unmaintained Third Party Components
References
2Provider assertions
3GitHub_M · cna
Integer overflow in URI leading to potential host spoofing
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 1c9cba134ab97554d518d6c8ca42bdebc255bb1ebf664e9d47f1a1d92c3ce34a
- Ingested
- 23 Sep 2026, 08:19:02 UTC
- Source record
- Official CVE record