# CVE-2021-3654: Open Redirect in CPython that affects users of OpenStack Nova

> Attackers can craft malicious URLs to redirect users to arbitrary sites via the noVNC console proxy in OpenStack Nova.

- **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
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 2 Mar 2022
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2021-3654, GHSA-vqp6-j452-j6wp, PYSEC-2026-693, RHSA-2022:0983, RHSA-2022:0999, UBUNTU-CVE-2021-3654

## What is CVE-2021-3654?

CVE-2021-3654 is a medium-severity vulnerability in openstack-nova, published on 2 Mar 2022. 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

A vulnerability was found in openstack-nova's console proxy, noVNC. By crafting a malicious URL, noVNC could be made to redirect to any desired URL.

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

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

7 open source packages ship an affected version, including nova. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `nova` | PyPI | All versions | 21.2.3, 22.2.3, 23.0.3 |
| `nova` | PyPI | All versions | 21.2.3 |
| `nova` | PyPI | All versions | 21.2.3 |
| `nova` | PyPI | From 22.0.0 | 22.2.3 |
| `nova` | PyPI | From 22.0.0 | 22.2.3 |
| `nova` | PyPI | From 23.0.0 | 23.0.3 |
| `nova` | PyPI | From 23.0.0 | 23.0.3 |
| `openstack-nova` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-api` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-common` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-compute` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-conductor` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-console` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-migration` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-novncproxy` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-scheduler` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-serialproxy` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova-spicehtml5proxy` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `python3-nova` | Red Hat:openstack:16.1::el8 | All versions | 1:20.4.1-1.20220112153422.1ee93b9.el8ost |
| `openstack-nova` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-api` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-common` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-compute` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-conductor` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-console` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-migration` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-novncproxy` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-scheduler` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-serialproxy` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `openstack-nova-spicehtml5proxy` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |
| `python3-nova` | Red Hat:openstack:16.2::el8 | All versions | 1:20.6.2-2.20220112164912.8906554.el8ost |

Products: Openstack Nova, Redhat Openstack Platform.

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

Upgrade nova to a fixed version for your release line: 21.2.3, 22.2.3 or 23.0.3.

## Is CVE-2021-3654 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-3654 exists.

Public exploit code:

- Nova noVNC - Open Redirect (nuclei): http/cves/2021/CVE-2021-3654.yaml

## Other vulnerabilities in openstack-nova

- [CVE-2017-7214](https://insights.sbomify.com/CVE-2017-7214/): OpenStack Nova logs sensitive context from notification exceptions (critical 9.8)
- [CVE-2017-17051](https://insights.sbomify.com/CVE-2017-17051/): OpenStack Nova DoS by rebuilding the same instance with a new image multiple times (high 8.6)
- [CVE-2020-17376](https://insights.sbomify.com/CVE-2020-17376/): OpenStack Nova Live migration fails to update persistent domain XML (high 8.3)
- [CVE-2017-18191](https://insights.sbomify.com/CVE-2017-18191/): OpenStack Nova Denial of service attack on the compute host (high 7.5)
- [CVE-2015-3280](https://insights.sbomify.com/CVE-2015-3280/): OpenStack Compute (nova) allows remote authenticated users to cause a denial of service (medium 6.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2021-3654 is a medium-severity vulnerability in openstack-nova, published on 2 Mar 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-3654 exists.

Affected packages and fixed versions:
- nova (PyPI): affected all versions; fixed in 21.2.3, 22.2.3, 23.0.3
- nova (PyPI): affected all versions; fixed in 21.2.3
- nova (PyPI): affected all versions; fixed in 21.2.3
- nova (PyPI): affected from 22.0.0; fixed in 22.2.3
- nova (PyPI): affected from 22.0.0; fixed in 22.2.3
- nova (PyPI): affected from 23.0.0; fixed in 23.0.3
- nova (PyPI): affected from 23.0.0; fixed in 23.0.3

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

## Sources

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

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