CVE-2023-6040
Linux Kernel vulnerability analysis and mitigation

Overview

An out-of-bounds access vulnerability (CVE-2023-6040) was discovered in the Linux kernel's netfilter subsystem. The vulnerability was reported by Lin Ma from Ant Security Light-Year Lab and was fixed in the Linux kernel version 5.18-rc1. The issue affects upstream stable kernel versions 5.4.y, 5.10.y, and 5.15.y. The vulnerability stems from a lack of safeguard against invalid nf_tables family (pf) values within the nf_tables_newtable function during the creation of new netfilter tables (OSS Security).

Technical details

The vulnerability manifests as an out-of-bounds access issue in two specific locations: 1) In the xt_find_target function within x_tables.c, where the xt array can be dereferenced without a boundary check, allowing an attacker to fake xt_af data, and 2) In the nf_logger_find_get function within nf_log.c, where the pf parameter is used as an index on the loggers global array containing struct nf_logger members. The vulnerability has been assigned a CVSS v3.1 base score of 7.8 (High) with vector AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

The vulnerability enables an attacker to achieve out-of-bounds access to kernel memory. Through this access, an attacker could potentially fake struct nf_logger data and use invalid pf values to dereference adjacent global data, potentially leading to privilege escalation, information disclosure, or system compromise (OSS Security).

Mitigation and workarounds

The primary mitigation is to disable unprivileged user namespaces. For temporary mitigation, administrators can execute 'sudo sysctl -w kernel.unprivileged_userns_clone=0'. For permanent mitigation across reboots, add 'kernel.unprivileged_userns_clone=0' to /etc/sysctl.d/99-disable-unpriv-userns.conf. The vulnerability has been fixed in Linux kernel version 5.18-rc1 and later, and patches are available for affected stable versions (OSS Security).

Additional resources


SourceThis report was generated using AI

Related Linux Kernel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-68764N/AN/A
  • Linux KernelLinux Kernel
  • kernel-64k-debug-modules
NoYesJan 05, 2026
CVE-2025-68762N/AN/A
  • Linux KernelLinux Kernel
  • kernel-debug
NoYesJan 05, 2026
CVE-2025-68758N/AN/A
  • Linux KernelLinux Kernel
  • linux-riscv
NoYesJan 05, 2026
CVE-2025-68756N/AN/A
  • Linux KernelLinux Kernel
  • linux-fips
NoYesJan 05, 2026
CVE-2025-68753N/AN/A
  • Linux KernelLinux Kernel
  • python3-perf
NoYesJan 05, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management