Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2025-39797 — kernel

🟠 CVSS 7.8 — High ✅ No Known Exploit NVD
7.8
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

xfrm: Duplicate SPI Handling

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

xfrm: Duplicate SPI Handling

The issue originates when Strongswan initiates an XFRM_MSG_ALLOCSPI

Netlink message, which triggers the kernel function xfrm_alloc_spi().

This function is expected to ensure uniqueness of the Security Parameter

Index (SPI) for inbound Security Associations (SAs). However, it can

return success even when the requested SPI is already in use, leading

to duplicate SPIs assigned to multiple inbound SAs, differentiated

only by their destination addresses.

This behavior causes inconsistencies during SPI lookups for inbound packets.

Since the lookup may return an arbitrary SA among those with the same SPI,

packet processing can fail, resulting in packet drops.

According to RFC 4301 section 4.4.2 , for inbound processing a unicast SA

is uniquely identified by the SPI and optionally protocol.

Reproducing the Issue Reliably:

To consistently reproduce the problem, restrict the available SPI range in

charon.conf : spi_min = 0x10000000 spi_max = 0x10000002

This limits the system to only 2 usable SPI values.

Next, create more than 2 Child SA. each using unique pair of src/dst address.

As soon as the 3rd Child SA is initiated, it will be assigned a duplicate

SPI, since the SPI pool is already exhausted.

With a narrow SPI range, the issue is consistently reproducible.

With a broader/default range, it becomes rare and unpredictable.

Current implementation:

xfrm_spi_hash() lookup function computes hash using daddr, proto, and family.

So if two SAs have the same SPI but different destination addresses, then

they will:

a. Hash into different buckets

b. Be stored in different linked lists (byspi + h)

c. Not be seen in the same hlist_for_each_entry_rcu() iteration.

As a result, the lookup will result in NULL and kernel allows that Duplicate SPI

Proposed Change:

xfrm_state_lookup_spi_proto() does a truly global search - across all states,

regardless of hash bucket and matches SPI and proto.

How this vulnerability can be exploited

This issue can be reached with local access to the system, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.

Affected software

CVE-2025-39797 is recorded against 2 packages.

  • kernel (from 6.16.0 up to 6.16.2)
  • linux-kernel (from 6.16 up to 6.16.2)

Timeline and source

Published on 12 September 2025 and last revised on 12 August 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.

References

git.kernel.org (Web)
git.kernel.org (Web)
git.kernel.org (Web)
git.kernel.org (Web)
git.kernel.org (Web)
github.com (Advisory)
nvd.nist.gov (Advisory)
git.kernel.org (Package)

CVE-2025-39797 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity High
CVSS Score 7.8
CVSS Vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE N/A
Public Exploit ✅ No
Source NVD
Published 2025-09-12
Updated 2026-08-20
Modified 2026-08-12

Affected Packages

Software From version Fixed in
kernel 6.16.0 6.16.2
linux-kernel 6.16 6.16.2

Similar Threats

Site Security Check

Is kernel part of your stack?

CVE-2025-39797 is rated CVSS 7.8 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.