# CVE-2023-52523: bpf, sockmap: Reject sk\_msg egress redirects to non-TCP sockets

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.33% (percentile 18, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-03-02T21:52:30.351Z
- **Modified:** 2026-08-05T09:10:23.650Z

## Who should check

- Anyone running Linux \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< bc8b89b6963803a123f64aa9494155a037b3d728; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< b8f97e47b6fb84fcf2f5a22e725eefb6cf5070c2; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< ded6e448028f0f91b6af35985afca01fa02a9089; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< b80e31baa43614e086a9d29dc1151932b1bd7fc5
- Anyone running Linux 5.13

## Description

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

bpf, sockmap: Reject sk\_msg egress redirects to non-TCP sockets

With a SOCKMAP/SOCKHASH map and an sk\_msg program user can steer messages
sent from one TCP socket (s1) to actually egress from another TCP
socket (s2):

tcp\_bpf\_sendmsg(s1)		// = sk\_prot-\>sendmsg
  tcp\_bpf\_send\_verdict(s1)	// \_\_SK\_REDIRECT case
    tcp\_bpf\_sendmsg\_redir(s2)
      tcp\_bpf\_push\_locked(s2)
	tcp\_bpf\_push(s2)
	  tcp\_rate\_check\_app\_limited(s2) // expects tcp\_sock
	  tcp\_sendmsg\_locked(s2)	 // ditto

There is a hard-coded assumption in the call-chain, that the egress
socket (s2) is a TCP socket.

However in commit 122e6c79efe1 ("sock\_map: Update sock type checks for
UDP") we have enabled redirects to non-TCP sockets. This was done for the
sake of BPF sk\_skb programs. There was no indention to support sk\_msg
send-to-egress use case.

As a result, attempts to send-to-egress through a non-TCP socket lead to a
crash due to invalid downcast from sock to tcp\_sock:

 BUG: kernel NULL pointer dereference, address: 000000000000002f
 ...
 Call Trace:
  \<TASK\>
  ? show\_regs+0x60/0x70
  ? \_\_die+0x1f/0x70
  ? page\_fault\_oops+0x80/0x160
  ? do\_user\_addr\_fault+0x2d7/0x800
  ? rcu\_is\_watching+0x11/0x50
  ? exc\_page\_fault+0x70/0x1c0
  ? asm\_exc\_page\_fault+0x27/0x30
  ? tcp\_tso\_segs+0x14/0xa0
  tcp\_write\_xmit+0x67/0xce0
  \_\_tcp\_push\_pending\_frames+0x32/0xf0
  tcp\_push+0x107/0x140
  tcp\_sendmsg\_locked+0x99f/0xbb0
  tcp\_bpf\_push+0x19d/0x3a0
  tcp\_bpf\_sendmsg\_redir+0x55/0xd0
  tcp\_bpf\_send\_verdict+0x407/0x550
  tcp\_bpf\_sendmsg+0x1a1/0x390
  inet\_sendmsg+0x6a/0x70
  sock\_sendmsg+0x9d/0xc0
  ? sockfd\_lookup\_light+0x12/0x80
  \_\_sys\_sendto+0x10e/0x160
  ? syscall\_enter\_from\_user\_mode+0x20/0x60
  ? \_\_this\_cpu\_preempt\_check+0x13/0x20
  ? lockdep\_hardirqs\_on+0x82/0x110
  \_\_x64\_sys\_sendto+0x1f/0x30
  do\_syscall\_64+0x38/0x90
  entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

Reject selecting a non-TCP sockets as redirect target from a BPF sk\_msg
program to prevent the crash. When attempted, user will receive an EACCES
error from send/sendto/sendmsg() syscall.

## Affected and fixed versions

- Linux: \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< bc8b89b6963803a123f64aa9494155a037b3d728; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< b8f97e47b6fb84fcf2f5a22e725eefb6cf5070c2; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< ded6e448028f0f91b6af35985afca01fa02a9089; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< b80e31baa43614e086a9d29dc1151932b1bd7fc5 (cvelist)
- Linux: 5.13 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-52523. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-52523.md
Affected: Linux >= 122e6c79efe1c25816118aca9cfabe54e99c2432, < bc8b89b6963803a123f64aa9494155a037b3d728; >= 122e6c79efe1c25816118aca9cfabe54e99c2432, < b8f97e47b6fb84fcf2f5a22e725eefb6cf5070c2; >= 122e6c79efe1c25816118aca9cfabe54e99c2432, < ded6e448028f0f91b6af35985afca01fa02a9089; >= 122e6c79efe1c25816118ac…
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-52523 being exploited?

There is no confirmed exploitation: CVE-2023-52523 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.33% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-52523?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-52523?

Linux \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< bc8b89b6963803a123f64aa9494155a037b3d728; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< b8f97e47b6fb84fcf2f5a22e725eefb6cf5070c2; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< ded6e448028f0f91b6af35985afca01fa02a9089; \>= 122e6c79efe1c25816118aca9cfabe54e99c2432, \< b80e31baa43614e086a9d29dc1151932b1bd7fc5; Linux 5.13.

### Is there a fix for CVE-2023-52523?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-52523?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/bc8b89b6963803a123f64aa9494155a037b3d728>
- patch: <https://git.kernel.org/stable/c/b8f97e47b6fb84fcf2f5a22e725eefb6cf5070c2>
- patch: <https://git.kernel.org/stable/c/ded6e448028f0f91b6af35985afca01fa02a9089>
- patch: <https://git.kernel.org/stable/c/b80e31baa43614e086a9d29dc1151932b1bd7fc5>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-52523>

HTML: <https://flawdb.com/CVE-2023-52523> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-52523>
