# CVE-2021-21337: URL Redirection to Untrusted Site ('Open Redirect') in Products.PluggableAuthService

> An attacker can craft a malicious link to the login form to redirect users to an untrusted external website.

- **Severity:** Medium 5.7 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 8 Mar 2021
- **Updated:** 3 Aug 2024
- **Also known as:** GHSA-p44j-xrqg-4xrr, PYSEC-2021-45

## What is CVE-2021-21337?

CVE-2021-21337 is a medium-severity vulnerability in zopefoundation Products.PluggableAuthService, published on 8 Mar 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

Products.PluggableAuthService is a pluggable Zope authentication and authorization framework. In Products.PluggableAuthService before version 2.6.0 there is an open redirect vulnerability. A maliciously crafted link to the login form and login functionality could redirect the browser to a different website. The problem has been fixed in version 2.6.1. Depending on how you have installed Products.PluggableAuthService, you should change the buildout version pin to `2.6.1` and re-run the buildout, or if you used `pip` simply do `pip install "Products.PluggableAuthService>=2.6.1".

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

## Which versions are affected by CVE-2021-21337?

3 open source packages ship an affected version, including Products.PluggableAuthService and products-pluggableauthservice. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `Products.PluggableAuthService` | PyPI | All versions | 2.6.1 |
| `products-pluggableauthservice` | PyPI | All versions | 2.6.1 |
| `products-pluggableauthservice` | PyPI | All versions | 2.6.1 |

Products: Zope Products.pluggableauthservice.

## How do I fix CVE-2021-21337?

Upgrade Products.PluggableAuthService to 2.6.1 or later.

## Is CVE-2021-21337 being exploited?

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

Public exploit code:

- Products.PluggableAuthService 2.6.0 - Open Redirect (exploitdb)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-21337 and fix it if it is affected.

What it is: CVE-2021-21337 is a medium-severity vulnerability in zopefoundation Products.PluggableAuthService, published on 8 Mar 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2021-21337 in the wild and no public exploit code.

Affected packages and fixed versions:
- Products.PluggableAuthService (PyPI): affected all versions; fixed in 2.6.1
- products-pluggableauthservice (PyPI): affected all versions; fixed in 2.6.1
- products-pluggableauthservice (PyPI): affected all versions; fixed in 2.6.1

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-2021-21337/ (Markdown: https://insights.sbomify.com/CVE-2021-21337/index.md)
```

## Sources

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

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