Skip to main content
No exploitation reportedFix available

CVE-2024-21631

No exploitation reported by the sources we read.

  • Published2024-01-03
  • Fixed inpkg:swift/github.com/vapor/vapor@4.90.0 · 4.90.0
  • WeaknessCWE-1104 · CWE-190 · CWE-20

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2024-01-0317:15CVE publishedNVD

Versions per branch

CISA-ADP · NVD · OSV
Vapor
BranchAffectedFixed in
—≥ pkg:swift/github.com/vapor/vapor@0, < pkg:swift/github.com/vapor/vapor@4.90.0pkg:swift/github.com/vapor/vapor@4.90.0
4.90< 4.90.04.90.0

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As GitHub_M, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • vapor
    Affected
    • = < 4.90.0no fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2024-01-03

Fix

  1. Update Vapor to pkg:swift/github.com/vapor/vapor@4.90.0 · 4.90.0

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

  • CISA-ADPSSVC decisionnone2024-01-03
  • CNACVSS 3.16.5known since 2026-10-23
  • NVDCVSS 3.16.5read 2026-10-23
  • CNAweakness (CWE)CWE-1104, CWE-190, CWE-20known since 2026-10-23
  • NVDweakness (CWE)CWE-190read 2026-10-23
  • FIRST EPSSEPSS score0.6 %2026-11-08
  • OSVaffected packages—
  • GitHub AdvisoriesadvisoryMODERATE2024-01-03

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
Published
2024-01-03
Last Modified
2026-06-17
NVD status
Modified
GitHub Advisory
GHSA-r6r4-5pr8-gjcp

Frequently asked questions

What is 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.

Is CVE-2024-21631 actively exploited?

Active exploitation of CVE-2024-21631 has not been confirmed. Its EPSS score was 0.6% on 2026-11-08, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2024-21631?

CVE-2024-21631 has a CVSS v3 base score of 6.5 (MEDIUM severity), with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.

Running github.com/vapor/vapor? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record