CVE-2023-3773: Kernel: xfrm: out-of-bounds read of xfrma_mtimer_thresh nlattr

Published Jun 30, 2023
·
Updated

========== 2. OOB read of XFRMAMTIMERTHRESH nlattr ==========

[require privilege]: CAPNETADMIN

[effects]: information leak

[crash stack]: Interesting enough as this OOB read will not be detected by KASan (perhaps why this bug is not detected by the fuzzer), see the details below.

[buggy commit]: 4e484b3e969b ("xfrm: rate limit SA mapping change message to user space")

[root cause]: The mentioned commit above added one additional attribute named XFRMAMTIMERTHRESH and described its type at compatpolicy (net/xfrm/xfrmcompat.c). However, the author forgot to also describe it at xfrmapolicy (net/xfrm/xfrmuser.c). Hence, this suppose NLAU32 (4 bytes) value can be faked as empty (0 bytes) by a malicious user, which lead to 4 bytes overflow read when parsing nlattrs.

The overall buffer skb is created at netlinksendmsg(...). According to the code, it will add another 0x140 skbsharedinfo data behind the skb data so this OOB will not be detected by KASan.

To exploit this (see PoC part), one malicious user can spray the SLUB objects and then leverage this 4 bytes OOB read to leak the heap data into x->mappingmaxage (see xfrmupdateaeparams(...)), and leak it to userspace via copytouserstateextra(...).

[PoC code]: see attachment poc2.c. I have tested it in latest Linux with QEMU. (no effects in ubuntu thanks to CONFIGINITONALLOCDEFAULTON)

[suggest fix]: Just add the type description like below

@@ -3035,6 +3035,7 @@ const struct nlapolicy xfrmapolicy[XFRMAMAX+1] = { [XFRMASETMARK] = { .type = NLAU32 }, [XFRMASETMARKMASK] = { .type = NLAU32 }, [XFRMAIFID] = { .type = NLAU32 }, + [XFRMAMTIMERTHRESH] = { .type = NLAU32 }, };

Other sources

A flaw was found in the Linux kernel’s IP framework for transforming packets (XFRM subsystem). This issue may allow a malicious user with CAPNETADMIN privileges to cause a 4 byte out-of-bounds read of XFRMAMTIMERTHRESH when parsing netlink attributes, leading to potential leakage of sensitive heap data to userspace.

Kernel: xfrm: out-of-bounds read of xfrmamtimerthresh nlattr

Microsoft

Affected Software

10 affected componentsFixes available
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
Fedoraproject Fedora
Linux Linux kernel
Debian Debian Linux=10.0
Debian Debian Linux=12.0
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-1
Microsoft cbl2 hyperv-daemons 5.15.153.1-1
Microsoft cbl2 hyperv-daemons 5.15.158.1-1
Microsoft cbl2 hyperv-daemons 5.15.153.1-1

Event History

Jun 30, 2023
Data Sourced
via Red Hat·04:47 PM
DescriptionSeverityAffected Software
Jul 25, 2023
CVE Published
via MITRE·03:47 PM
Data Sourced
via MITRE·03:47 PM
DescriptionSeverityWeakness
Data Sourced
04:15 PM
Description
Jan 12, 2024
Data Sourced
via Launchpad·12:22 AM
Description
Jan 21, 2024
Data Sourced
via Microsoft·08:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·08:00 AM
Affected Software
Updated
via Microsoft·08:00 AM
SeverityAffected Software
Updated
via Microsoft·08:00 AM
Affected Software
Updated
via Microsoft·08:00 AM
DescriptionSeverity
Apr 28, 2025
Data Sourced
via Ubuntu·02:13 PM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2023-3773?

The severity of CVE-2023-3773 is medium.

2

What software is affected by CVE-2023-3773?

Redhat Enterprise Linux 8.0 and 9.0, Fedoraproject Fedora, Linux Linux Kernel, and Debian Linux are affected by CVE-2023-3773.

3

How can a malicious user exploit CVE-2023-3773?

A malicious user with CAP_NET_ADMIN privileges can exploit CVE-2023-3773 by causing an out-of-bounds read of XFRMA_MTIMER_THRESH, potentially leading to sensitive information leakage.

4

Is there a fix available for CVE-2023-3773?

Yes, there are fixes available for CVE-2023-3773. Apply the relevant security updates provided by Redhat, Fedoraproject, Linux Kernel, or Debian.

5

Where can I find more information about CVE-2023-3773?

You can find more information about CVE-2023-3773 at the following references: [Link 1](https://access.redhat.com/security/cve/CVE-2023-3773), [Link 2](https://bugzilla.redhat.com/show_bug.cgi?id=2218944), [Link 3](https://lore.kernel.org/all/20230723074110.3705047-1-linma@zju.edu.cn/T/#u).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203