-
Notifications
You must be signed in to change notification settings - Fork 291
/
GHSA-r6r4-5pr8-gjcp.json
69 lines (69 loc) · 2.71 KB
/
GHSA-r6r4-5pr8-gjcp.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"schema_version": "1.4.0",
"id": "GHSA-r6r4-5pr8-gjcp",
"modified": "2024-02-09T00:29:14Z",
"published": "2024-01-03T21:44:35Z",
"aliases": [
"CVE-2024-21631"
],
"summary": "Vapor contains an integer overflow in URI leading to potential host spoofing",
"details": "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.\n\nThis vulnerability does not affect Vapor directly but could impact applications relying on the URI type for validating user input. \n\nThe 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.\n\nBy 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.\n\n### Impact\nUsers attempting to treat untrusted input as a URI are vulnerable to a host spoofing attack due to an integer overflow.\n\n### Workarounds\nValidate user input before parsing as a URI or, if possible, use Foundation's `URL` and `URLComponents` utilities.",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
}
],
"affected": [
{
"package": {
"ecosystem": "SwiftURL",
"name": "github.com/vapor/vapor"
},
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "4.90.0"
}
]
}
],
"database_specific": {
"last_known_affected_version_range": "<= 4.89.3"
}
}
],
"references": [
{
"type": "WEB",
"url": "https://github.com/vapor/vapor/security/advisories/GHSA-r6r4-5pr8-gjcp"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-21631"
},
{
"type": "WEB",
"url": "https://github.com/vapor/vapor/commit/6db3d917b5ce5024a84eb265ef65691383305d70"
},
{
"type": "PACKAGE",
"url": "https://github.com/vapor/vapor"
}
],
"database_specific": {
"cwe_ids": [
"CWE-1104",
"CWE-190"
],
"severity": "MODERATE",
"github_reviewed": true,
"github_reviewed_at": "2024-01-03T21:44:35Z",
"nvd_published_at": "2024-01-03T17:15:12Z"
}
}