{"id":"CVE-2024-42353","aliases":["CVE-2024-42353","GHSA-mg3v-6m49-jhp3","PYSEC-2024-188"],"related":[],"kind":"vulnerability","state":"published","title":"WebOb's location header normalization during redirect leads to open redirect","summary":"WebOb provides objects for HTTP requests and responses. When WebOb normalizes the HTTP Location header to include the request hostname, it does so by parsing the URL that the user is to be redirected to with Python's urlparse, and joining it to the base URL. `urlparse` however treats a `//` at the start of a string as a URI without a scheme, and then treats the next part as the hostname. `urljoin` will then use that hostname from the second part as the hostname replacing the original one from the request. This vulnerability is patched in WebOb version 1.8.8.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"WebOb provides objects for HTTP requests and responses. When WebOb normalizes the HTTP Location header to include the request hostname, it does so by parsing the URL that the user is to be redirected to with Python's urlparse, and joining it to the base URL. `urlparse` however treats a `//` at the start of a string as a URI without a scheme, and then treats the next part as the hostname. `urljoin` will then use that hostname from the second part as the hostname replacing the original one from the request. This vulnerability is patched in WebOb version 1.8.8.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nWhen WebOb normalizes the HTTP Location header to include the request hostname, it does so by parsing the URL that the user is to be redirected to with Python's urlparse, and joining it to the base URL. `urlparse` however treats a `//` at the start of a string as a URI without a scheme, and then treats the next part as the hostname. `urljoin` will then use that hostname from the second part as the hostname replacing the original one from the request.\n\n```\n>>> parse.urlparse(\"//example.com/test/path\")\nParseResult(scheme='', netloc='example.com', path='/test/path', params='', query='', fragment='')\n```\n\nWebOb uses `urljoin` to take the request URI and joining the redirect location, so assuming the request URI is: `https://example.org//example.com/some/path`, and the URL to redirect to (for example by adding a slash automatically) is `//example.com/some/path/` that gets turned by `urljoin` into:\n\n```\n>>> parse.urljoin(\"https://example.org//attacker.com/some/path\", \"//attacker.com/some/path/\")\n'https://attacker.com/some/path/'\n```\n\nWhich redirects from `example.org` where we want the user to stay to `attacker.com`\n\n\n### Patches\n\nThis issue is patched in WebOb 1.8.8\n\nOlder versions of WebOb continue to be vulnerable to this issue, and should be avoided.\n\n### Workarounds\n\nAny use of the `Response` class that includes a `location` can be rewritten to make sure to always pass a full URI that includes the hostname to redirect the user to.\n\n### Thanks\n\n- Sara Gao\n\nThis issue was reported via the [Pylons Project Security List](mailto:pylons-project-security@googlegroups.com)","format":"markdown","source":"ghsa"},{"lang":"es","text":"WebOb proporciona objetos para solicitudes y respuestas HTTP. Cuando WebOb normaliza el encabezado de Ubicación HTTP para incluir el nombre de host de la solicitud, lo hace analizando la URL a la que se redirigirá al usuario con urlparse de Python y uniéndola a la URL base. Sin embargo, `urlparse` trata un `//` al comienzo de una cadena como un URI sin un esquema, y luego trata la siguiente parte como el nombre de host. `urljoin` luego usará ese nombre de host de la segunda parte como nombre de host reemplazando el original de la solicitud. Esta vulnerabilidad está parcheada en WebOb versión 1.8.8.","source":"nvd"}],"published":"2024-08-14T17:48:06.000Z","modified":"2026-06-17T07:49:18.797Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-601"],"affected":[{"ranges":[{"version":"<= 1.8.7","status":"affected"}],"vendor":"Pylons","product":"webob","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.8.8"}],"ecosystem":"PyPI","package":"webob","purl":"pkg:pypi/webob","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.8.8"}],"vendor":"pylonsproject","product":"webob","cpe":"cpe:2.3:a:pylonsproject:webob:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"f689bcf4f0a1f64f1735b1d5069aef5be6974b5b"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.8.8"}],"ecosystem":"PyPI","package":"webob","purl":"pkg:pypi/webob","repo":"https://github.com/pylons/webob","source":"pysec"}],"references":[{"url":"https://github.com/Pylons/webob/security/advisories/GHSA-mg3v-6m49-jhp3","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/Pylons/webob/commit/f689bcf4f0a1f64f1735b1d5069aef5be6974b5b","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42353","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Pylons/webob","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/webob/PYSEC-2024-188.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-08-15T14:02:15.377Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-42353","url":"https://www.cve.org/CVERecord?id=CVE-2024-42353","licence":"CVE Terms of Use","modified":"2024-08-15T14:04:01.806Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mg3v-6m49-jhp3","url":"https://github.com/advisories/GHSA-mg3v-6m49-jhp3","licence":"CC-BY-4.0","modified":"2025-01-21T18:21:20.814Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-42353","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42353","licence":"Public domain","modified":"2026-06-17T07:49:18.797Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2024-188","url":"https://osv.dev/vulnerability/PYSEC-2024-188","licence":"CC-BY-4.0","modified":"2025-01-19T04:56:55.038Z"}],"updatedAt":"2026-11-25T22:58:44.389Z","epss":{"score":0.00689,"percentile":0.48092,"date":"2026-11-30T12:00:22.000Z"}}