BreachSpiderVerified, not vibes

CVE-2025-40205 in Kernel products

High 7.8

In the Linux kernel, the following vulnerability has been resolved: btrfs: avoid potential out-of-bounds in btrfs_encode_fh() The function btrfs_encode_fh() does not properly account for the three cases it handles. Before writing to the file handle (fh), the function only returns to the user BTRFS_FID_SIZE_NON_CO...

Affects 1 product from 4 vendors. Facts below cite their sources.

CVSS 3.17.8
EPSS0.2%
EPSS percentile9th
FixUnknown

Requires local access, low complexity, low privileges required, no user interaction needed, impact contained to the vulnerable component, full confidentiality impact, full integrity impact, full availability impact.

Affected products and versions

VendorProductAffected versions
Kernel — —
Linux Linux 2.6.29
Novell — —
Three — —

A product listed here is affected only at the versions shown. Use the free check to test the exact version you run.

Fix and vendor advisory

No official vendor advisory link on record. See the CVE record.

Exploitation

CISA known-exploitedNot in the CISA KEV catalog
Public exploitNot confirmed

Official description

In the Linux kernel, the following vulnerability has been resolved: btrfs: avoid potential out-of-bounds in btrfs_encode_fh() The function btrfs_encode_fh() does not properly account for the three cases it handles. Before writing to the file handle (fh), the function only returns to the user BTRFS_FID_SIZE_NON_CONNECTABLE (5 dwords, 20 bytes) or BTRFS_FID_SIZE_CONNECTABLE (8 dwords, 32 bytes). However, when a parent exists and the root ID of the parent and the inode are different, the function writes BTRFS_FID_SIZE_CONNECTABLE_ROOT (10 dwords, 40 bytes). If *max_len is not large enough, this write goes out of bounds because BTRFS_FID_SIZE_CONNECTABLE_ROOT is greater than BTRFS_FID_SIZE_CONNECTABLE originally returned. This results in an 8-byte out-of-bounds write at fid->parent_root_objectid = parent_root_id. A previous attempt to fix this issue was made but was lost. https://lore.kernel.org/all/[email protected]/ Although this issue does not seem to be easily triggerable, it is a potential memory corruption bug that should be fixed. This patch resolves the issue by ensuring the function returns the appropriate size for all three cases and validates that *max_len is large enough before writing any data.

Source: NIST NVD / MITRE CVE.

Record details

CVE IDCVE-2025-40205
BreachSpider IDBS-2025-GLOBAL-258948-I
CVSS vectorCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Published2025-11-12
Last modified2026-10-19
SourceNVD

Analysis AI-written, not human-reviewed

A potential out-of-bounds write vulnerability exists in the btrfs_encode_fh() function of the Linux kernel, which could be exploited to cause a buffer overflow.

An attacker with local access could potentially exploit this vulnerability to execute arbitrary code or cause a denial of service by crafting a specific file handle that triggers the out-of-bounds write.

Questions

What is CVE-2025-40205?

A potential out-of-bounds write vulnerability exists in the btrfs_encode_fh() function of the Linux kernel, which could be exploited to cause a buffer overflow.

What is the CVSS score for CVE-2025-40205?

CVE-2025-40205 has CVSS 7.8 (High). Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. EPSS: 0.2%.

Is CVE-2025-40205 actively exploited?

No confirmed active exploitation of CVE-2025-40205 as of 2026-10-25.

How do I remediate CVE-2025-40205?

Priority: MEDIUM.

What systems are affected by CVE-2025-40205?

CVE-2025-40205 affects Kernel; Linux Linux; Novell; Three.

For developers and AI agents

Run this check from your own code or agent

REST API

curl -s https://breachspider.com/api/v1/assets/correlate-cves \
 -H "Authorization: Bearer $BREACHSPIDER_API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"assets":[{"asset_id":"dev-1","vendor":"Kernel","product":"EDS-518A","version":"1.0"}]}'

API reference

Python SDK

pip install breachspider

PyPI · GitHub

MCP for AI agents

# hosted: add as a connector
https://mcp.breachspider.com/mcp
# local
pipx install breachspider-mcp

Setup for Claude, ChatGPT, Cursor

Free trial: 14 days, 750 device checks, no card.

Page facts from NVD, MITRE, CISA and vendor advisories, record last modified 2026-10-19.