CVE-2024-50142 xfrm: validate new SA's prefixlen using SA family when sel.family is unset
A missing validation in the Linux kernel xfrm subsystem allows attackers to cause a denial of service by creating Security Associations with invalid prefix lengths.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-50142?
CVE-2024-50142 is a medium-severity denial of service vulnerability in Linux kernel, published on 7 Nov 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
xfrm: validate new SA's prefixlen using SA family when sel.family is unset
This expands the validation introduced in commit 07bf7908950a ("xfrm: Validate address prefix lengths in the xfrm selector.")
syzbot created an SA with usersa.sel.family = AF_UNSPEC usersa.sel.prefixlen_s = 128 usersa.family = AF_INET
Because of the AF_UNSPEC selector, verify_newsa_info doesn't put limits on prefixlen_{s,d}. But then copy_from_user_state sets x->sel.family to usersa.family (AF_INET). Do the same conversion in verify_newsa_info before validating prefixlen_{s,d}, since that's how prefixlen is going to be used later on.
Which versions are affected by CVE-2024-50142?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-50142?
Apply the vendor's patch.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2024-50142 being exploited?
There is no known exploitation of CVE-2024-50142 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-53474, AZL-53745, BELL-CVE-2024-50142, DEBIAN-CVE-2024-50142, GHSA-35cx-v8jm-4qrv, UBUNTU-CVE-2024-50142.