# CVE-2025-40043: net: nfc: nci: Add parameter validation for packet data

> Insufficient input validation in the Linux kernel NFC driver allows attackers to read uninitialized memory, potentially disclosing sensitive kernel data.

- **Severity:** High 8.8 (`CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Oct 2025
- **Updated:** 5 Aug 2026
- **Also known as:** BELL-CVE-2025-40043, DEBIAN-CVE-2025-40043, GHSA-rwhf-69pj-m4jv, ROOT-OS-DEBIAN-11-CVE-2025-40043, ROOT-OS-DEBIAN-12-CVE-2025-40043, ROOT-OS-DEBIAN-13-CVE-2025-40043, ROOT-OS-UBUNTU-2204-CVE-2025-40043, ROOT-OS-UBUNTU-2404-CVE-2025-40043, UBUNTU-CVE-2025-40043

## What is CVE-2025-40043?

CVE-2025-40043 is a high-severity vulnerability in Linux, published on 28 Oct 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

In the Linux kernel, the following vulnerability has been resolved:

net: nfc: nci: Add parameter validation for packet data

Syzbot reported an uninitialized value bug in nci_init_req, which was
introduced by commit 5aca7966d2a7 ("Merge tag
'perf-tools-fixes-for-v6.17-2025-09-16' of
git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools").

This bug arises due to very limited and poor input validation
that was done at nic_valid_size(). This validation only
validates the skb->len (directly reflects size provided at the
userspace interface) with the length provided in the buffer
itself (interpreted as NCI_HEADER). This leads to the processing
of memory content at the address assuming the correct layout
per what opcode requires there. This leads to the accesses to
buffer of `skb_buff->data` which is not assigned anything yet.

Following the same silent drop of packets of invalid sizes at
`nic_valid_size()`, add validation of the data in the respective
handlers and return error values in case of failure. Release
the skb if error values are returned from handlers in
`nci_nft_packet` and effectively do a silent drop

Possible TODO: because we silently drop the packets, the
call to `nci_request` will be waiting for completion of request
and will face timeouts. These timeouts can get excessively logged
in the dmesg. A proper handling of them may require to export
`nci_request_cancel` (or propagate error handling from the
nft packets handlers).

## Which versions are affected by CVE-2025-40043?


## How do I fix CVE-2025-40043?

Apply the vendor's patch.

## Is CVE-2025-40043 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-40043 and fix it if it is affected.

What it is: CVE-2025-40043 is a high-severity vulnerability in Linux, published on 28 Oct 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-40043 in the wild and no public exploit code.

Affected product: Linux. 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-2025-40043/ (Markdown: https://insights.sbomify.com/CVE-2025-40043/index.md)
```

## Sources

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

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