Vulnerabilities in pkg:pypi/webob

PACKAGE
Advisory Identifier: GHSA-6hx8-3wjj-gr8g
Advisory Summary

CVE-2026-54770 is a MODERATE (CVSS 6.1) open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting WebOb libraries in the PyPI ecosystem. The issue involves open redirect in location header normalization via leading c0 control / space characters. Remediation is available by upgrading affected packages to version 1.8.11.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/webob

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/webob. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6hx8-3wjj-gr8g CVE-2026-54770 MODERATE WebOb: Open redirect in Location header normalization via leading C0 control / space characters
GHSA-fh3h-vg37-cc95 CVE-2026-44889 MODERATE WebOb: Location header normalization during redirect leads to open redirect - again
GHSA-mg3v-6m49-jhp3 CVE-2024-42353 MODERATE WebOb's location header normalization during redirect leads to open redirect

CVE-2026-54770 at a Glance

CVE Identifier CVE-2026-54770
GHSA Identifier GHSA-6hx8-3wjj-gr8g
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product WebOb
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-54770

To remediate this vulnerability, upgrade all affected WebOb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

webob fixed: 1.8.11
pip install webob>=1.8.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show webob

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-54770, inspect your installed packages using pip:

pip show webob

Analyze the terminal output to locate any version of WebOb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.8.11), your application is affected.

Note: The pip show webob command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In WebOb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary This is a third follow-up to **CVE-2024-42353 / GHSA-mg3v-6m49-jhp3** and **CVE-2026-44889 / GHSA-fh3h-vg37-cc95**. WebOb makes the `Location` header absolute when it serves a redirect. To stop a relative or protocol-relative target from redirecting users off-host, it checks the value for a URI scheme and for a leading `//`, then joins it against the request URI with `urllib.parse.urljoin()`. The previous fix additionally stripped ASCII tab/CR/LF from the value before those checks. However, on Python 3.10+ `urllib.parse.urljoin()` (via `urlsplit()`) does more than remove tab/CR/LF: **it also strips leading and trailing C0 control characters (`U+0000`–`U+001F`) and spaces from the URL before parsing it.** Because WebOb's guard checks (`SCHEME_RE` and `startswith("//")`) run against the *un-stripped* value, a single leading space or control byte slips past them, and `urljoin()` then silently removes that byte and parses what remains as a protocol-relative — or even absolute — URL. The result is an open redirect to an attacker-controlled host. ## Details `Response._make_location_absolute()` (in `src/webob/response.py`) performed, prior to the fix: ```python value = value.replace("\t", "").replace("\r", "").replace("\n", "") if SCHEME_RE.search(value): # ^[a-z]+: -> already absolute, return as-is return value if value.startswith("//"): # neutralize protocol-relative URLs value = f"/%2f{value[2:]}" new_location = urlparse.urljoin(_request_uri(environ), value) ``` Consider the Location value `" //www.example.com/test"` (a single leading space): 1. The explicit strip only removes `\t`, `\r`, `\n` — the leading **space** survives. 2. `SCHEME_RE` (`^[a-z]+:`) does **not** match — the value starts with a space. 3. `value.startswith("//")` is **False** — the value starts with a space, not `/`. The `//` → `/%2f` neutralization is skipped. 4. `urllib.parse.urljoin(_request_uri(environ), " //www.example.com/test")` then **strips the leading space** before parsing, sees `//www.example.com/test`, treats it as protocol-relative, and returns `http://www.example.com/test`. The same bypass works with a value such as `" https://www.example.com/test"` (leading space + a full scheme): `SCHEME_RE` does not match the space-prefixed string, but `urljoin()` strips the space and returns the fully absolute attacker URL `https://www.example.com/test`. Any C0 control character works equally well in place of the space, e.g. `"\x00//www.example.com/test"` or `"\x1f//www.example.com/test"`, because `urlsplit()` strips the whole leading C0-control-and-space run. ### Affected entry points - **`Response.location`** — any application that sets a relative/attacker-influenced `Location` and serves the response (the classic redirect path). - **`Request.relative_url()`** — used `urllib.parse.urljoin()` directly and was subject to the same character stripping. - **`webob.exc._HTTPMove` subclasses** (`HTTPMovedPermanently`, `HTTPFound`, `HTTPSeeOther`, `HTTPTemporaryRedirect`, `HTTPPermanentRedirect`, etc.) — these built their absolute Location with `urlparse.urljoin(req.path_url, self.location)` **without** going through `_make_location_absolute()` at all, so they bypassed even the tab/CR/LF strip and the `//` → `/%2f` neutralization. A protocol-relative location passed to e.g. `HTTPFound(location="//evil.example")` redirected off-host. ## Proof of Concept ```python from webob import Response from webob.request import Request res = Response() res.status = "301" res.location = " //www.example.com/test" # note the single leading space req = Request.blank("/") # request host is "localhost" print(req.get_response(res).location) # Vulnerable (<= 1.8.10): http://www.example.com/test <-- open redirect # Fixed: http://localhost/ //www.example.com/test ``` Absolute-URL variant: ```python res.location = " https://www.example.com/test" # Vulnerable: https://www.example.com/test <-- off-host # Fixed: http://localhost/ https://www.example.com/test ``` Via the HTTP exceptions: ```python from webob import exc environ = { "wsgi.url_scheme": "http", "SERVER_NAME": "localhost", "SERVER_PORT": "80", "REQUEST_METHOD": "HEAD", "PATH_INFO": "/", } m = exc.HTTPFound(location="//www.example.com/test") m(environ, lambda *a, **k: None) print(m.location) # Vulnerable: //www.example.com/test <-- open redirect # Fixed: http://localhost/%2fwww.example.com/test ``` ## Impact An unauthenticated remote attacker who controls (in whole or part) the redirect target of an application built on WebOb can redirect a user from a trusted host to an attacker-controlled host. This enables phishing and credential-theft campaigns that abuse the trusted origin, and can be chained with OAuth/SSO `redirect_uri` flows to leak tokens. Exploitation requires user interaction (following the redirect). Confidentiality and integrity impact are limited (`L`); the scope is changed (`C`) because the trust boundary of the originating site is crossed. ## Patches Fixed by replacing the use of `urllib.parse.urljoin()` with WebOb's own RFC 3986 reference-resolution implementation, `webob.util.urljoin()`, which resolves the reference **exactly as given, character for character, with no whitespace or control-character removal**. - `Response._make_location_absolute()` now uses `webob.util.urljoin()`. - `Request.relative_url()` now uses `webob.util.urljoin()`. - `webob.exc._HTTPMove` now normalizes its Location through the same `_make_location_absolute()` code path as `Response`, so protocol-relative and whitespace-smuggled locations are neutralized there too. Users should upgrade to the patched release. There are no API changes. ## Workarounds - Only ever set the `Location` header / redirect target to a fully-qualified URI whose host you control, or strictly allowlist redirect destinations before handing them to WebOb. - Reject any redirect target that does not begin with `https://yourhost/` (or a validated relative path with no leading whitespace/control bytes). ## References - This advisory: GHSA-6hx8-3wjj-gr8g - GHSA-fh3h-vg37-cc95 (CVE-2026-44889) — second incomplete fix (tab/CR/LF) - GHSA-mg3v-6m49-jhp3 (CVE-2024-42353) — original open redirect fix - RFC 3986, Section 5 — Reference Resolution: https://www.rfc-editor.org/rfc/rfc3986#section-5 - Python `urllib.parse` URL stripping behavior (CPython 3.10+, removal of leading and trailing C0 control and space characters): https://docs.python.org/3/library/urllib.parse.html To report a vulnerability to the Pylons Project please take a look at: - Pylons Project security policy and reporting process: https://github.com/Pylons/.github/blob/main/SECURITY.md - Security contact (private, coordinated disclosure): `pylons-project-security@googlegroups.com` (the Pylons Project requests a 90-day disclosure embargo) ## Credit Reported via the Pylons Project security mailing list by: - **tonghuaroot** — for the residual open redirect in `Response._make_location_absolute()`: the 1.8.10 fix stripped only ASCII tab/CR/LF, but `urllib.parse.urljoin()` also strips leading C0 control and space characters, so values such as `" //attacker.example/path"` (and `" https://attacker.example/path"`) still escaped off-host. - **Matheus Polkorny** — for identifying that the `webob.exc._HTTPMove` redirect exceptions (`HTTPFound` and friends) performed their own `urllib.parse.urljoin()` normalization and never went through `_make_location_absolute()`, so a protocol-relative location such as `//evil.example/path/` redirected off-host through that separate code path.

CVE-2026-54770 Affected WebOb Versions

1 component(s)
Fixed Versions:
1.8.11
Product / Package Ecosystem Affected Versions Fixed Version
webob
PyPI
< 1.8.11
1.8.11

References

Frequently Asked Questions

What is CVE-2026-54770?
CVE-2026-54770 is a security vulnerability in WebOb involving Open redirect in Location header normalization via leading C0 control / space characters under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which WebOb versions are affected?
Affected versions include releases prior to 1.8.11 across affected packages: webob.
What version fixes CVE-2026-54770?
Upgrading to 1.8.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is webob affected?
Yes, webob is affected in releases prior to 1.8.11. Upgrade your dependency to 1.8.11 or later.
What is the CVSS score of CVE-2026-54770?
CVE-2026-54770 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-54770?
CVE-2026-54770 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check PyPI dependencies for CVE-2026-54770?
Run the dependency tree command: 'pip show webob'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6hx8-3wjj-gr8g",
  "modified" : "2026-08-27T22:10:07Z",
  "published" : "2026-08-27T22:10:07Z",
  "aliases" : [ "CVE-2026-54770" ],
  "summary" : "WebOb: Open redirect in Location header normalization via leading C0 control / space characters",
  "details" : "## Summary\n\nThis is a third follow-up to **CVE-2024-42353 / GHSA-mg3v-6m49-jhp3**\nand **CVE-2026-44889 / GHSA-fh3h-vg37-cc95**.\n\nWebOb makes the `Location` header absolute when it serves a redirect. To stop a\nrelative or protocol-relative target from redirecting users off-host, it checks\nthe value for a URI scheme and for a leading `//`, then joins it against the\nrequest URI with `urllib.parse.urljoin()`. The previous fix additionally stripped\nASCII tab/CR/LF from the value before those checks.\n\nHowever, on Python 3.10+ `urllib.parse.urljoin()` (via `urlsplit()`) does more\nthan remove tab/CR/LF: **it also strips leading and trailing C0 control\ncharacters (`U+0000`–`U+001F`) and spaces from the URL before parsing it.**\nBecause WebOb's guard checks (`SCHEME_RE` and `startswith(\"//\")`) run against the\n*un-stripped* value, a single leading space or control byte slips past them, and\n`urljoin()` then silently removes that byte and parses what remains as a\nprotocol-relative — or even absolute — URL. The result is an open redirect to an\nattacker-controlled host.\n\n## Details\n\n`Response._make_location_absolute()` (in `src/webob/response.py`) performed,\nprior to the fix:\n\n```python\nvalue = value.replace(\"\\t\", \"\").replace(\"\\r\", \"\").replace(\"\\n\", \"\")\n\nif SCHEME_RE.search(value):          # ^[a-z]+:   -> already absolute, return as-is\n    return value\n\nif value.startswith(\"//\"):           # neutralize protocol-relative URLs\n    value = f\"/%2f{value[2:]}\"\n\nnew_location = urlparse.urljoin(_request_uri(environ), value)\n```\n\nConsider the Location value `\" //www.example.com/test\"` (a single leading space):\n\n1. The explicit strip only removes `\\t`, `\\r`, `\\n` — the leading **space**\n   survives.\n2. `SCHEME_RE` (`^[a-z]+:`) does **not** match — the value starts with a space.\n3. `value.startswith(\"//\")` is **False** — the value starts with a space, not\n   `/`. The `//` → `/%2f` neutralization is skipped.\n4. `urllib.parse.urljoin(_request_uri(environ), \" //www.example.com/test\")` then\n   **strips the leading space** before parsing, sees `//www.example.com/test`,\n   treats it as protocol-relative, and returns\n   `http://www.example.com/test`.\n\nThe same bypass works with a value such as `\" https://www.example.com/test\"`\n(leading space + a full scheme): `SCHEME_RE` does not match the space-prefixed\nstring, but `urljoin()` strips the space and returns the fully absolute\nattacker URL `https://www.example.com/test`.\n\nAny C0 control character works equally well in place of the space, e.g.\n`\"\\x00//www.example.com/test\"` or `\"\\x1f//www.example.com/test\"`, because\n`urlsplit()` strips the whole leading C0-control-and-space run.\n\n### Affected entry points\n\n- **`Response.location`** — any application that sets a relative/attacker-influenced\n  `Location` and serves the response (the classic redirect path).\n- **`Request.relative_url()`** — used `urllib.parse.urljoin()` directly and was\n  subject to the same character stripping.\n- **`webob.exc._HTTPMove` subclasses** (`HTTPMovedPermanently`, `HTTPFound`,\n  `HTTPSeeOther`, `HTTPTemporaryRedirect`, `HTTPPermanentRedirect`, etc.) — these\n  built their absolute Location with `urlparse.urljoin(req.path_url, self.location)`\n  **without** going through `_make_location_absolute()` at all, so they bypassed\n  even the tab/CR/LF strip and the `//` → `/%2f` neutralization. A protocol-relative\n  location passed to e.g. `HTTPFound(location=\"//evil.example\")` redirected off-host.\n\n## Proof of Concept\n\n```python\nfrom webob import Response\nfrom webob.request import Request\n\nres = Response()\nres.status = \"301\"\nres.location = \" //www.example.com/test\"   # note the single leading space\n\nreq = Request.blank(\"/\")                    # request host is \"localhost\"\nprint(req.get_response(res).location)\n# Vulnerable (<= 1.8.10):  http://www.example.com/test   <-- open redirect\n# Fixed:                   http://localhost/ //www.example.com/test\n```\n\nAbsolute-URL variant:\n\n```python\nres.location = \" https://www.example.com/test\"\n# Vulnerable: https://www.example.com/test   <-- off-host\n# Fixed:      http://localhost/ https://www.example.com/test\n```\n\nVia the HTTP exceptions:\n\n```python\nfrom webob import exc\n\nenviron = {\n    \"wsgi.url_scheme\": \"http\", \"SERVER_NAME\": \"localhost\",\n    \"SERVER_PORT\": \"80\", \"REQUEST_METHOD\": \"HEAD\", \"PATH_INFO\": \"/\",\n}\nm = exc.HTTPFound(location=\"//www.example.com/test\")\nm(environ, lambda *a, **k: None)\nprint(m.location)\n# Vulnerable: //www.example.com/test          <-- open redirect\n# Fixed:      http://localhost/%2fwww.example.com/test\n```\n\n## Impact\n\nAn unauthenticated remote attacker who controls (in whole or part) the redirect\ntarget of an application built on WebOb can redirect a user from a trusted host to\nan attacker-controlled host. This enables phishing and credential-theft campaigns\nthat abuse the trusted origin, and can be chained with OAuth/SSO `redirect_uri`\nflows to leak tokens. Exploitation requires user interaction (following the\nredirect). Confidentiality and integrity impact are limited (`L`); the scope is\nchanged (`C`) because the trust boundary of the originating site is crossed.\n\n## Patches\n\nFixed by replacing the use of `urllib.parse.urljoin()` with WebOb's own\nRFC 3986 reference-resolution implementation, `webob.util.urljoin()`, which\nresolves the reference **exactly as given, character for character, with no\nwhitespace or control-character removal**.\n\n- `Response._make_location_absolute()` now uses `webob.util.urljoin()`.\n- `Request.relative_url()` now uses `webob.util.urljoin()`.\n- `webob.exc._HTTPMove` now normalizes its Location through the same\n  `_make_location_absolute()` code path as `Response`, so protocol-relative and\n  whitespace-smuggled locations are neutralized there too.\n\nUsers should upgrade to the patched release. There are no API changes.\n\n## Workarounds\n\n- Only ever set the `Location` header / redirect target to a fully-qualified URI\n  whose host you control, or strictly allowlist redirect destinations before\n  handing them to WebOb.\n- Reject any redirect target that does not begin with `https://yourhost/` (or a\n  validated relative path with no leading whitespace/control bytes).\n\n## References\n\n- This advisory: GHSA-6hx8-3wjj-gr8g\n- GHSA-fh3h-vg37-cc95 (CVE-2026-44889) — second incomplete fix (tab/CR/LF)\n- GHSA-mg3v-6m49-jhp3 (CVE-2024-42353) — original open redirect fix\n- RFC 3986, Section 5 — Reference Resolution: https://www.rfc-editor.org/rfc/rfc3986#section-5\n- Python `urllib.parse` URL stripping behavior (CPython 3.10+, removal of leading\n  and trailing C0 control and space characters): https://docs.python.org/3/library/urllib.parse.html\n  \nTo report a vulnerability to the Pylons Project please take a look at:\n\n - Pylons Project security policy and reporting process:\n  https://github.com/Pylons/.github/blob/main/SECURITY.md\n- Security contact (private, coordinated disclosure): `pylons-project-security@googlegroups.com`\n  (the Pylons Project requests a 90-day disclosure embargo)\n\n## Credit\n\nReported via the Pylons Project security mailing list by:\n\n- **tonghuaroot** — for the residual open redirect in\n  `Response._make_location_absolute()`: the 1.8.10 fix stripped only ASCII\n  tab/CR/LF, but `urllib.parse.urljoin()` also strips leading C0 control and\n  space characters, so values such as `\" //attacker.example/path\"` (and\n  `\" https://attacker.example/path\"`) still escaped off-host.\n- **Matheus Polkorny** — for identifying that the `webob.exc._HTTPMove`\n  redirect exceptions (`HTTPFound` and friends) performed their own\n  `urllib.parse.urljoin()` normalization and never went through\n  `_make_location_absolute()`, so a protocol-relative location such as\n  `//evil.example/path/` redirected off-host through that separate code path.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "webob"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Pylons/webob/security/advisories/GHSA-6hx8-3wjj-gr8g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54770"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Pylons/webob/commit/ff89560643fb252751b4db8806a283b5377f1f07"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Pylons/webob"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Pylons/webob/tree/1.8.11"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-27T22:10:07Z",
    "nvd_published_at" : "2026-08-20T17:18:18Z"
  }
}