# CVE-2021-32645: Open Redirect in tenancy

> Attackers can redirect users to malicious sites via crafted URLs in specific Laravel tenancy configurations, requiring a patch or configuration change.

- **Severity:** Medium 4.3 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 27 May 2021
- **Updated:** 3 Aug 2024
- **Also known as:** GHSA-4r8q-gv9j-3xx6

## What is CVE-2021-32645?

CVE-2021-32645 is a medium-severity vulnerability in tenancy multi-tenant, published on 27 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Tenancy multi-tenant is an open source multi-domain controller for the Laravel web framework. In some situations, it is possible to have open redirects where users can be redirected from your site to any other site using a specially crafted URL. This is only the case for installations where the default Hostname Identification is used and the environment uses tenants that have `force_https` set to `true` (default: `false`). Version 5.7.2 contains the relevant patches to fix this bug. Stripping the URL from special characters to prevent specially crafted URL's from being redirected to. As a work around users can set the `force_https` to every tenant to `false`, however this may degrade connection security.

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

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

2 open source packages ship an affected version, including hyn/multi-tenant. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `hyn/multi-tenant` | Packagist | From 5.6.0 | 5.7.2 |
| `hyn/multi-tenant` | Packagist | From 5.6.0 | 5.7.2 |

Products: Tenancy Multi-Tenant.

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

Upgrade hyn/multi-tenant to 5.7.2 or later.

## Is CVE-2021-32645 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2021-32645 is a medium-severity vulnerability in tenancy multi-tenant, published on 27 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2021-32645 in the wild and no public exploit code.

Affected packages and fixed versions:
- hyn/multi-tenant (Packagist): affected from 5.6.0; fixed in 5.7.2
- hyn/multi-tenant (Packagist): affected from 5.6.0; fixed in 5.7.2

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

## Sources

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

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