{"answers":{"affected":"2 open source packages ship an affected version, including github.com/vapor/vapor. It affects 1 product.","exploited":"There is no known exploitation of CVE-2024-21631 in the wild and no public exploit code.","fix":"Upgrade github.com/vapor/vapor to 4.90.0 or later.","what":"CVE-2024-21631 is a medium-severity vulnerability in vapor, published on 3 Jan 2024. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-21631 and fix it if it is affected.\n\nWhat it is: CVE-2024-21631 is a medium-severity vulnerability in vapor, published on 3 Jan 2024. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-21631 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/vapor/vapor (SwiftURL): affected all versions; fixed in 4.90.0\n- github.com/vapor/vapor (SwiftURL): affected all versions; fixed in 4.90.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-21631/ (Markdown: https://insights.sbomify.com/CVE-2024-21631/index.md)","id":"CVE-2024-21631","markdown":"https://insights.sbomify.com/CVE-2024-21631/index.md","name":"CVE-2024-21631","record":{"aliases":["GHSA-r6r4-5pr8-gjcp"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Swift HTTP framework","requires_auth":"low_privilege","summary":"An integer overflow in Vapor's URI parser allows attackers to spoof hosts, potentially bypassing security checks in applications relying on this library.","user_interaction":"not_required","vuln_class":"integer_overflow"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"vapor","vendor":"vapor"}],"cvss":{"score":6.5,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"},{"id":"CWE-190","name":"Integer Overflow or Wraparound"},{"id":"CWE-1104","name":"Use of Unmaintained Third Party Components"}],"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.","ecosystems":["SwiftURL"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Integer overflow in URI leading to potential host spoofing","id":"CVE-2024-21631","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"SwiftURL","product":null,"products":[],"type":"integer_overflow","year":"2024"},"n_packages":2,"n_references":2,"next":{"headline":"omniauth-microsoft_graph vulnerable to account takeover (nOAuth)","id":"CVE-2024-21632"},"packages":[{"ecosystem":"SwiftURL","fixed":["4.90.0"],"introduced":["0"],"last_affected":[],"package":"github.com/vapor/vapor","purl":null,"source":"GHSA-r6r4-5pr8-gjcp"},{"ecosystem":"SwiftURL","fixed":["4.90.0"],"introduced":["0"],"last_affected":[],"package":"github.com/vapor/vapor","purl":"pkg:swift/github.com/vapor/vapor","source":"GHSA-r6r4-5pr8-gjcp"}],"prev":{"headline":"Zulip non-admins can invite new users to streams they would not otherwise be able to add existing users to","id":"CVE-2024-21630"},"products":["vapor"],"published":"2024-01-03","related":[{"cvss_score":7.5,"headline":"DoS Vulnerability in URLEncodedFormDecoder in Vapor","id":"CVE-2022-31019","kev_date_added":null,"published":"2022-06-06"},{"cvss_score":7.5,"headline":"Integer Overflow in Vapor's HTTP Range Request","id":"CVE-2022-31005","kev_date_added":null,"published":"2022-05-31"},{"cvss_score":5.3,"headline":"Incorrect request error handling triggers server crash in Vapor","id":"CVE-2023-44386","kev_date_added":null,"published":"2023-10-05"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-09-18","vendors":["vapor"]},"summary":"An integer overflow in Vapor's URI parser allows attackers to spoof hosts, potentially bypassing security checks in applications relying on this library.","url":"https://insights.sbomify.com/CVE-2024-21631/"}