# CVE-2024-42353: WebOb's location header normalization during redirect leads to open redirect


- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 14 Aug 2024
- **Updated:** 15 Aug 2024
- **Also known as:** AZL-47820, AZL-47826, DEBIAN-CVE-2024-42353, ECHO-7481-8feb-d02b, GHSA-mg3v-6m49-jhp3, MGASA-2024-0308, OESA-2024-2043, PYSEC-2024-188, RHSA-2024:6775, RHSA-2024:6827, RHSA-2024:9983, RHSA-2024:9989, SUSE-SU-2024:2969-1, SUSE-SU-2024:2970-1, SUSE-SU-2024:3116-1, UBUNTU-CVE-2024-42353, USN-6984-1, openSUSE-SU-2024:14279-1

## What is CVE-2024-42353?

CVE-2024-42353 is a medium-severity vulnerability in Pylons webob, published on 14 Aug 2024. 

### Official description

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.

Weakness: CWE-601 (URL Redirection to Untrusted Site)

## Which versions are affected by CVE-2024-42353?

3 open source packages ship an affected version, including webob. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `webob` | PyPI | All versions | 1.8.8 |
| `webob` | PyPI | All versions | 1.8.8 |
| `webob` | PyPI | All versions | 1.8.8 |
| `python-webob` | Red Hat:openshift_ironic:4.16::el9 | All versions | 0:1.8.8-2.el9 |
| `python3-webob` | Red Hat:openshift_ironic:4.16::el9 | All versions | 0:1.8.8-2.el9 |
| `python-webob` | Red Hat:openstack:17.1::el8 | All versions | 0:1.8.7-2.1.el8ost |
| `python3-webob` | Red Hat:openstack:17.1::el8 | All versions | 0:1.8.7-2.1.el8ost |
| `python-webob` | Red Hat:openstack:17.1::el9 | All versions | 0:1.8.7-2.1.el9ost |
| `python3-webob` | Red Hat:openstack:17.1::el9 | All versions | 0:1.8.7-2.1.el9ost |
| `python-webob` | Red Hat:openstack:18.0::el9 | All versions | 0:1.8.7-3.el9ost |
| `python3-webob` | Red Hat:openstack:18.0::el9 | All versions | 0:1.8.7-3.el9ost |
| `python-WebOb` | SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 1.7.4-150000.3.3.1 |
| `python-WebOb` | SUSE:Linux Enterprise Module for Basesystem 15 SP6 | All versions | 1.7.4-150000.3.3.1 |
| `python-WebOb` | SUSE:Linux Enterprise Module for Package Hub 15 SP5 | All versions | 1.7.4-150000.3.3.1 |
| `python-WebOb` | SUSE:Linux Enterprise Module for Package Hub 15 SP6 | All versions | 1.7.4-150000.3.3.1 |
| `python-WebOb` | SUSE:Linux Enterprise Module for Public Cloud 12 | All versions | 1.2.3-3.3.1 |
| `python-WebOb` | openSUSE:Leap 15.5 | All versions | 1.7.4-150000.3.3.1 |
| `python-WebOb` | openSUSE:Leap 15.6 | All versions | 1.8.7-150400.11.6.1 |
| `python-WebOb` | openSUSE:Tumbleweed | All versions | 1.8.8-1.1 |

Products: Pylonsproject Webob.

## How do I fix CVE-2024-42353?

Upgrade webob to 1.8.8 or later.

## Is CVE-2024-42353 being exploited?

There is no known exploitation of CVE-2024-42353 in the wild and no public exploit code.

## Other vulnerabilities in Pylons webob

- [CVE-2026-44889](https://insights.sbomify.com/CVE-2026-44889/): WebOb: Location header normalization during redirect leads to open redirect (medium 6.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-42353 and fix it if it is affected.

What it is: CVE-2024-42353 is a medium-severity vulnerability in Pylons webob, published on 14 Aug 2024. 
Exploitation: There is no known exploitation of CVE-2024-42353 in the wild and no public exploit code.

Affected packages and fixed versions:
- webob (PyPI): affected all versions; fixed in 1.8.8
- webob (PyPI): affected all versions; fixed in 1.8.8
- webob (PyPI): affected all versions; fixed in 1.8.8

Task:
1. 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.
2. 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.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-42353/ (Markdown: https://insights.sbomify.com/CVE-2024-42353/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-42353
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-42353
- OSV: https://osv.dev/vulnerability/CVE-2024-42353

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-42353/
Summaries are generated and may contain mistakes; the official description above is the record.
