{"id":"CVE-2022-31019","aliases":["CVE-2022-31019","GHSA-qvxg-wjxc-r4gg"],"related":[],"kind":"vulnerability","state":"published","title":"DoS Vulnerability in URLEncodedFormDecoder in Vapor","summary":"Vapor is a server-side Swift HTTP web framework. When using automatic content decoding an attacker can craft a request body that can make the server crash with the following request: `curl -d \"array[_0][0][array][_0][0][array]$(for f in $(seq 1100); do echo -n '[_0][0][array]'; done)[string][_0]=hello%20world\" http://localhost:8080/foo`. The issue is unbounded, attacker controlled stack growth which will at some point lead to a stack overflow and a process crash. This issue has been fixed in version 4.61.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Vapor is a server-side Swift HTTP web framework. When using automatic content decoding an attacker can craft a request body that can make the server crash with the following request: `curl -d \"array[_0][0][array][_0][0][array]$(for f in $(seq 1100); do echo -n '[_0][0][array]'; done)[string][_0]=hello%20world\" http://localhost:8080/foo`. The issue is unbounded, attacker controlled stack growth which will at some point lead to a stack overflow and a process crash. This issue has been fixed in version 4.61.1.","source":"cvelist"},{"lang":"en","text":"Vapor is an HTTP web framework for Swift. Vapor versions earlier than 4.61.1 are vulnerable to a denial of service in the URLEncodedFormDecoder.\n\n### Impact\nWhen using automatic content decoding, e.g. \n\n```swift\napp.post(\"foo\") { request -> String in\n  let foo = try request.content.decode(Foo.self)\n  return \"\\(foo)\"\n}\n```\n\nAn attacker can craft a request body that can make the server crash with the following request:\n\n```\ncurl -d \"array[_0][0][array][_0][0][array]$(for f in $(seq 1100); do echo -n '[_0][0][array]'; done)[string][_0]=hello%20world\" http://localhost:8080/foo\n```\n\nThe issue is unbounded, attacker controlled stack growth which will at some point lead to a stack overflow.\n\n### Patches\nFixed in 4.61.1\n\n### Workarounds\nIf you don't need to decode Form URL Encoded data, you can disable the `ContentConfiguration` so it won't be used. E.g. in **configure.swift**\n\n```swift\nvar contentConfig = ContentConfiguration()\ncontentConfig.use(encoder: JSONEncoder.custom(dates: .iso8601), for: .json)\ncontentConfig.use(decoder: JSONDecoder.custom(dates: .iso8601), for: .json)\ncontentConfig.use(encoder: JSONEncoder.custom(dates: .iso8601), for: .jsonAPI)\ncontentConfig.use(decoder: JSONDecoder.custom(dates: .iso8601), for: .jsonAPI)\nContentConfiguration.global = contentConfig\n```\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the Vapor repo](https://github.com/vapor/vapor)\n* Ask in [Vapor Discord](http://vapor.team)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Vapor es un framework web Swift HTTP del lado del servidor. Cuando es usada la decodificación automática de contenido, un atacante puede diseñar un cuerpo de petición que puede hacer que el servidor se bloquee con la siguiente petición: \"curl -d \"array[_0][0][array][_0][array]$(for f in $(seq 1100); do echo -n \"[_0][array]\"; done)[string][_0]=hello%20world\" http://localhost:8080/foo\". El problema es el crecimiento ilimitado de la pila, controlado por el atacante, que en algún momento conllevará un desbordamiento de la pila y un bloqueo del proceso. Este problema ha sido corregido en versión 4.61.1","source":"nvd"}],"published":"2022-06-06T21:05:20.000Z","modified":"2026-06-17T04:44:37.097Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-120","CWE-121","CWE-674"],"affected":[{"ranges":[{"version":"< 4.61.1","status":"affected"}],"vendor":"vapor","product":"vapor","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.61.1"}],"ecosystem":"SwiftURL","package":"github.com/vapor/vapor","purl":"pkg:swift/github.com/vapor/vapor","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.61.1"}],"vendor":"vapor","product":"vapor","cpe":"cpe:2.3:a:vapor:vapor:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/vapor/vapor/security/advisories/GHSA-qvxg-wjxc-r4gg","tags":["mitigation","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vapor/vapor/commit/6c63226a4ab82ce53730eb1afb9ca63866fcf033","tags":["exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31019","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vapor/vapor","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-04-22T15:40:52.632Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-31019","url":"https://www.cve.org/CVERecord?id=CVE-2022-31019","licence":"CVE Terms of Use","modified":"2025-04-22T17:54:38.010Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qvxg-wjxc-r4gg","url":"https://github.com/advisories/GHSA-qvxg-wjxc-r4gg","licence":"CC-BY-4.0","modified":"2023-11-08T04:09:22.722Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-31019","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31019","licence":"Public domain","modified":"2026-06-17T04:44:37.097Z"}],"updatedAt":"2026-11-25T22:58:12.184Z","epss":{"score":0.01663,"percentile":0.77403,"date":"2026-12-01T12:00:22.000Z"}}