# CVE-2021-4248: kapetan dns Request.cs entropy

> Insufficient entropy in the PRNG allows remote attackers to predict DNS request identifiers, potentially enabling cache poisoning or spoofing attacks.

- **Severity:** Medium 5.6 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Dec 2022
- **Updated:** 15 Apr 2025
- **Also known as:** GHSA-g3wc-xv93-445q

## What is CVE-2021-4248?

CVE-2021-4248 is a medium-severity vulnerability in kapetan dns, published on 18 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A vulnerability was found in kapetan dns up to 6.1.0. It has been rated as problematic. Affected by this issue is some unknown functionality of the file DNS/Protocol/Request.cs. The manipulation leads to insufficient entropy in prng. The attack may be launched remotely. Upgrading to version 7.0.0 is able to address this issue. The name of the patch is cf7105aa2aae90d6656088fe5a8ee1d5730773b6. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-216188.

Weakness: CWE-330 (Use of Insufficiently Random Values)

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

2 open source packages ship an affected version, including DNS. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `DNS` | NuGet | All versions | 7.0.0 |
| `DNS` | NuGet | All versions | 7.0.0 |

Products: Kapetan Dns Project Kapetan Dns.

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

Upgrade DNS to 7.0.0 or later.

## Is CVE-2021-4248 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2021-4248 is a medium-severity vulnerability in kapetan dns, published on 18 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-4248 in the wild and no public exploit code.

Affected packages and fixed versions:
- DNS (NuGet): affected all versions; fixed in 7.0.0
- DNS (NuGet): affected all versions; fixed in 7.0.0

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

## Sources

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

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