# CVE-2021-29462: DNS rebinding in pupnp

> The pupnp library is vulnerable to DNS rebinding attacks due to missing Host header validation, allowing attackers to bypass same-origin policies.

- **Severity:** High 7.6 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L`)
- **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:** 20 Apr 2021
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2021-29462, GHSA-6hqq-w3jq-9fhg, MGASA-2021-0319, UBUNTU-CVE-2021-29462

## What is CVE-2021-29462?

CVE-2021-29462 is a high-severity vulnerability in pupnp, published on 20 Apr 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

The Portable SDK for UPnP Devices is an SDK for development of UPnP device and control point applications. The server part of pupnp (libupnp) appears to be vulnerable to DNS rebinding attacks because it does not check the value of the `Host` header. This can be mitigated by using DNS revolvers which block DNS-rebinding attacks. The vulnerability is fixed in version 1.14.6 and later.

Weakness: CWE-345 (Insufficient Verification of Data Authenticity), CWE-20 (Improper Input Validation)

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

It affects 1 product.


Products: Pupnp Project Pupnp.

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

Upgrade to a fixed version.

## Is CVE-2021-29462 being exploited?

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

## Other vulnerabilities in pupnp

- [CVE-2026-57486](https://insights.sbomify.com/CVE-2026-57486/): pupnp: NULL pointer dereference in ixmlNode_compare crashes on non-namespaced attributes (high 7.5)
- [CVE-2026-57487](https://insights.sbomify.com/CVE-2026-57487/): libupnp chunked HTTP bodies can bypass g_maxContentLength and be fully buffered (high 7.5)
- [CVE-2026-77630](https://insights.sbomify.com/CVE-2026-77630/): pupnp: Denial of service via blocking DNS resolution in parse_uri()/GENA callback parsing (high 7.5)
- [CVE-2021-28302](https://insights.sbomify.com/CVE-2021-28302/): Denial of service in n/a (high 7.5)
- [CVE-2026-57488](https://insights.sbomify.com/CVE-2026-57488/): pupnp: Integer truncation in HTTP Content-Length parsing enables request smuggling (high 7.1)

## Fix prompt for AI coding agents

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

What it is: CVE-2021-29462 is a high-severity vulnerability in pupnp, published on 20 Apr 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-29462 in the wild and no public exploit code.

Affected product: pupnp. No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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