Linux Kernel up to 6.17.3 btrfs btrfs_encode_fh out-of-bounds write

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
7.6$0-$5k0.00

Summaryinfo

A vulnerability classified as critical has been found in Linux Kernel up to 6.17.3. This vulnerability affects the function btrfs_encode_fh of the component btrfs. Performing a manipulation results in out-of-bounds write. This vulnerability is reported as CVE-2025-40205. No exploit exists. It is recommended to upgrade the affected component.

Detailsinfo

A vulnerability, which was classified as critical, was found in Linux Kernel up to 6.17.3. This affects the function btrfs_encode_fh of the component btrfs. The manipulation with an unknown input leads to a out-of-bounds write vulnerability. CWE is classifying the issue as CWE-787. The product writes data past the end, or before the beginning, of the intended buffer. This is going to have an impact on confidentiality, integrity, and availability. The summary by CVE is:

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.

It is possible to read the advisory at git.kernel.org. This vulnerability is uniquely identified as CVE-2025-40205 since 04/16/2025. The exploitability is told to be easy. Technical details of the vulnerability are known, but there is no available exploit. The pricing for an exploit might be around USD $0-$5k at the moment (estimation calculated on 02/07/2026).

The vulnerability scanner Nessus provides a plugin with the ID 275353 (Linux Distros Unpatched Vulnerability : CVE-2025-40205), which helps to determine the existence of the flaw in a target environment.

Upgrading to version 5.4.301, 5.10.246, 5.15.195, 6.1.157, 6.6.113, 6.12.54, 6.17.4 or 6.18-rc1 eliminates this vulnerability. Applying the patch 60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db/742b44342204e5dfe3926433823623c1a0c581df/d3a9a8e1275eb9b87f006b5562a287aea3f6885f/d91f6626133698362bba08fbc04bd72c466806d3/361d67276eb8ec6be8f27f4ad6c6090459438fee/43143776b0a7604d873d1a6f3e552a00aa930224/dff4f9ff5d7f289e4545cc936362e01ed3252742 is able to eliminate this problem. The bugfix is ready for download at git.kernel.org. The best possible mitigation is suggested to be upgrading to the latest version.

The vulnerability is also documented in the databases at Tenable (275353) and CERT Bund (WID-SEC-2025-2595). Be aware that VulDB is the high quality source for vulnerability data.

Affected

  • Google Container-Optimized OS
  • Debian Linux
  • Amazon Linux 2
  • Red Hat Enterprise Linux
  • SUSE Linux
  • Oracle Linux
  • SUSE openSUSE
  • Open Source Linux Kernel
  • RESF Rocky Linux

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 8.0
VulDB Meta Temp Score: 7.6

VulDB Base Score: 8.0
VulDB Temp Score: 7.6
VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍

Exploitinginfo

Class: Out-of-bounds write
CWE: CWE-787 / CWE-119
CAPEC: 🔒
ATT&CK: 🔒

Physical: No
Local: No
Remote: Partially

Availability: 🔒
Status: Not defined

EPSS Score: 🔒
EPSS Percentile: 🔒

Price Prediction: 🔍
Current Price Estimation: 🔒

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 275353
Nessus Name: Linux Distros Unpatched Vulnerability : CVE-2025-40205

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔒

Upgrade: Kernel 5.4.301/5.10.246/5.15.195/6.1.157/6.6.113/6.12.54/6.17.4/6.18-rc1
Patch: 60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db/742b44342204e5dfe3926433823623c1a0c581df/d3a9a8e1275eb9b87f006b5562a287aea3f6885f/d91f6626133698362bba08fbc04bd72c466806d3/361d67276eb8ec6be8f27f4ad6c6090459438fee/43143776b0a7604d873d1a6f3e552a00aa930224/dff4f9ff5d7f289e4545cc936362e01ed3252742

Timelineinfo

04/16/2025 CVE reserved
11/13/2025 +211 days Advisory disclosed
11/13/2025 +0 days VulDB entry created
02/07/2026 +86 days VulDB entry last update

Sourcesinfo

Vendor: kernel.org

Advisory: git.kernel.org
Status: Confirmed

CVE: CVE-2025-40205 (🔒)
GCVE (CVE): GCVE-0-2025-40205
GCVE (VulDB): GCVE-100-332247
CERT Bund: WID-SEC-2025-2595 - Linux Kernel: Mehrere Schwachstellen

Entryinfo

Created: 11/13/2025 07:28
Updated: 02/07/2026 20:37
Changes: 11/13/2025 07:28 (59), 11/13/2025 20:09 (2), 11/14/2025 05:54 (7), 12/01/2025 15:29 (1), 12/21/2025 22:01 (1), 02/07/2026 20:37 (1)
Complete: 🔍
Cache ID: 216::103

Be aware that VulDB is the high quality source for vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you know our Splunk app?

Download it now for free!