CVE-2025-39965: xfrm: xfrm_alloc_spi shouldn't use 0 as SPI
In the Linux kernel, the following vulnerability has been resolved:
xfrm: xfrm_alloc_spi shouldn't use 0 as SPI
x->id.spi == 0 means "no SPI assigned", but since commit
94f39804d891 ("xfrm: Duplicate SPI Handling"), we now create states
and add them to the byspi list with this value.
__xfrm_state_delete doesn't remove those states from the byspi list,
since they shouldn't be there, and this shows up as a UAF the next
time we go through the byspi list.
Security readout for executives and security teams
Plain-English summary
A Linux kernel flaw in IPsec/XFRM state handling can leave a freed object referenced by an internal list. A local attacker with low privileges may be able to trigger memory corruption, potentially compromising confidentiality, integrity, and availability. Exact exposure depends on kernel lineage and whether the affected XFRM functionality is reachable.
Executive priority
Treat as a high-priority kernel update, especially on shared Linux infrastructure. It is not presented as remotely exploitable or actively exploited, reducing emergency urgency, but successful abuse could have system-wide impact. Confirm vendor exposure and deploy supported fixed kernels through normal expedited patching.
Technical view
Since commit 94f39804d891, XFRM states could enter the SPI lookup list with reserved SPI value zero. State deletion then failed to remove those entries, leaving a stale pointer. A later traversal could cause a use-after-free. The supplied CVSS 3.1 score is 7.8 with local, low-privilege attack requirements.
Likely exposure
Prioritize Linux hosts whose kernels contain the cited regression without a corresponding stable fix. Exposure is local rather than network-direct according to the CVSS vector. Systems using IPsec/XFRM or allowing local users to reach affected kernel paths deserve closer review. The bundle does not provide complete vulnerable version ranges.
Exploitation context
The supplied sources do not report active exploitation, and the CVE is not listed as KEV in the bundle. The vector indicates local access, low privileges, low complexity, and no user interaction. No conclusion about practical exploit reliability or attack prevalence can be made from the provided evidence.
Researcher notes
The defect is a lifecycle inconsistency: SPI zero denotes unassigned state, yet affected code inserted such states into the by-SPI list. Deletion assumed they were absent and skipped unlinking, enabling later use-after-free. The linked stable commits are authoritative remediation references; the supplied metadata does not fully map every vulnerable branch.
Mitigation direction
Upgrade to a vendor-supported kernel containing the applicable linked stable fix.
Check distribution advisories for exact package versions and reboot requirements.
Prioritize multi-user, container-hosting, and XFRM/IPsec-enabled systems pending vendor confirmation.
Restrict unnecessary local access while affected systems await updates.
Validation and detection
Record running kernel versions and distribution package release identifiers.
Compare kernel ancestry against regression commit 94f39804d891 and the applicable fix commit.
Confirm the corrected kernel is running after update and reboot.
Review vendor advisories because the bundle lacks complete affected-version ranges.
Check kernel logs for unexplained XFRM faults or use-after-free reports.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-39965 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
5Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.