Bug 1216261 (CVE-2023-5574) - VUL-0: CVE-2023-5574: xorg-x11-server: Server Damage Object Use-After-Free Local Privilege Escalation Vulnerability
Summary: VUL-0: CVE-2023-5574: xorg-x11-server: Server Damage Object Use-After-Free Lo...
Status: RESOLVED FIXED
Alias: CVE-2023-5574
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/381931/
Whiteboard: CVSSv3.1:SUSE:CVE-2023-5574:7.4:(AV:L...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-16 08:17 UTC by Marcus Meissner
Modified: 2024-05-17 12:18 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
0001-mi-fix-CloseScreen-initialization-order.patch (1020 bytes, patch)
2023-10-16 08:18 UTC, Marcus Meissner
Details | Diff
0002-fb-properly-wrap-unwrap-CloseScreen.patch (3.34 KB, patch)
2023-10-16 08:18 UTC, Marcus Meissner
Details | Diff
poc.c (4.56 KB, text/plain)
2023-10-16 08:19 UTC, Marcus Meissner
Details
0005-dix-always-initialize-pScreen-CloseScreen.patch (1.41 KB, patch)
2023-10-24 11:02 UTC, Marcus Meissner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 2 Marcus Meissner 2023-10-16 08:18:18 UTC
Created attachment 870206 [details]
0001-mi-fix-CloseScreen-initialization-order.patch

0001-mi-fix-CloseScreen-initialization-order.patch
Comment 3 Marcus Meissner 2023-10-16 08:18:34 UTC
Created attachment 870207 [details]
0002-fb-properly-wrap-unwrap-CloseScreen.patch

0002-fb-properly-wrap-unwrap-CloseScreen.patch
Comment 5 Marcus Meissner 2023-10-16 08:19:41 UTC
[-- Attachment #1 [details] --]                                                                                                                                        [-- Type: text/plain, Encoding: 7bit, Size: 2.6K --]                                                                                                                                                                                                                                                                      This issue is now CVE-2023-5574.                                                                                                                             
                                                                                                                                                             
Turns out this is somehow related to multiple screens again, the bug is                                                                                      
triggered when the pointer moves from screen 0 into the window on screen 1. I                                                                                
found a way to reproduce this reliably:                                                                                                                      
                                                                                                                                                             
$ meson configure build -Db_sanitize=address                                                                                                                 
$ ./build/hw/vfb/Xvfb :3 -screen 1 1024x768x24 -ac                                                                                                           
                                                                                                                                                             
reproducer                                                                                                                                                   
                                                                                                                                                             
$ export DISPLAY=:3.1                                                                                                                                        
$ xcalc                                                                                                                                                      
$ xdotool mousemove --screen 1 10 10                                                                                                                         
$ killall -2 xcalc                                                                                                                                           
                                                                                                                                                             
Works with xterm too but not xev, xinput, so *something* is needed. The                                                                                      
reduced 200 line PoC (attached) seems to require a `panedWidgetClass` for the                                                                                
bug to trigger.                                                                                                                                              
                                                                                                                                                             
Requires moving from screen 0 to 1, what happend on screen 0 doesn't seem to                                                                                 
matter and neither does moving back.                                                                                                                         
                                                                                                                                                             
If anyone has any ideas or pointers, I'll happily take them. The patch makes                                                                                 
the issue go away, I'm just wondering if there is some other underlying issue                                                                                
that we're now papering over and/or are exposed to.                                                                                                          
                                                                                                                                                             
Cheers,                                                                                                                                                      
  Peter
Comment 10 Marcus Meissner 2023-10-24 11:02:02 UTC
Created attachment 870426 [details]
0005-dix-always-initialize-pScreen-CloseScreen.patch

Please note that the fix for CVE-2023-5574 
(0004-fb-properly-wrap-unwrap-CloseScreen.patch) was buggy and can 
trigger a segfault in Xwayland on exit. A new patch is added to this 
sequence to mitigate this issue 
(0005-dix-always-initialize-pScreen-CloseScreen.patch) and will be part 
of tomorrow's disclosure and announcement.

The other patches are unchanged to the original announcement.

Thanks to Marc Deslauriers for finding this issue.

Cheers,
   Peter
Comment 11 Stefan Dirsch 2023-10-24 13:41:50 UTC
Ok. I just submitted fixed xorg-x11-server packages for sle12-sp5, sle15-sp2, sle15-sp4 and sle15-sp5. X11:XOrg, Tumbleweed and ALP updates will come once the issue has been officially announced.
Comment 13 Marcus Meissner 2023-10-25 07:19:04 UTC
is public

https://lists.x.org/archives/xorg-announce/2023-October/003430.html

3) CVE-2023-5574: Use-after-free bug in DamageDestroy

Introduced in: xorg-server-1.13.0 (2012)
Found by: Sri working with Trend Micro Zero Day Initiative
Merge request tracking the fixes: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1189

This issue only affects Xvfb and requires a legacy multi-screen setup
with multiple protocol screens ("Zaphod").

Screen cleanup is handled via stackable "modules", but the fb module hardcoded
the cleanup path for the screen pixmap instead of calling into the next layer
of the stack. This caused a minor memory leak that was fixed with a patch to
Xvfb introduced in server 1.13. However, that patch did not remove all
references to the freed pixmap, causing a use-after-free during screen cleanup
in a lower module.

This issue has not yet been fixed, please see the above merge request to
track future fixes to this issue.
Comment 15 Stefan Dirsch 2023-10-25 09:36:09 UTC
Ok. It's worse. I didn't yet patch xwayland at all to fix this ticket. :-( Working on it now ...
Comment 16 Stefan Dirsch 2023-10-25 09:51:56 UTC
I just submitted fixed xwayland packages for sle15-sp4 and sle15-sp5.
Comment 18 Stefan Dirsch 2023-10-25 12:20:45 UTC
(In reply to Stefan Dirsch from comment #11)
> Ok. I just submitted fixed xorg-x11-server packages for sle12-sp5,
> sle15-sp2, sle15-sp4 and sle15-sp5. X11:XOrg, Tumbleweed and ALP updates
> will come once the issue has been officially announced.

DONE. Same for xwayland. Reassigning.
Comment 19 Maintenance Automation 2023-10-30 20:30:09 UTC
SUSE-SU-2023:4272-1: An update that solves three vulnerabilities can now be installed.

Category: security (important)
Bug References: 1216133, 1216135, 1216261
CVE References: CVE-2023-5367, CVE-2023-5380, CVE-2023-5574
Sources used:
openSUSE Leap 15.5 (src): xorg-x11-server-21.1.4-150500.7.7.1
Basesystem Module 15-SP5 (src): xorg-x11-server-21.1.4-150500.7.7.1
Development Tools Module 15-SP5 (src): xorg-x11-server-21.1.4-150500.7.7.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 20 Maintenance Automation 2023-10-30 20:30:27 UTC
SUSE-SU-2023:4269-1: An update that solves three vulnerabilities can now be installed.

Category: security (important)
Bug References: 1216133, 1216135, 1216261
CVE References: CVE-2023-5367, CVE-2023-5380, CVE-2023-5574
Sources used:
SUSE Linux Enterprise Software Development Kit 12 SP5 (src): xorg-x11-server-1.19.6-10.56.1
SUSE Linux Enterprise High Performance Computing 12 SP5 (src): xorg-x11-server-1.19.6-10.56.1
SUSE Linux Enterprise Server 12 SP5 (src): xorg-x11-server-1.19.6-10.56.1
SUSE Linux Enterprise Server for SAP Applications 12 SP5 (src): xorg-x11-server-1.19.6-10.56.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 21 Maintenance Automation 2023-10-31 12:30:10 UTC
SUSE-SU-2023:4306-1: An update that solves two vulnerabilities can now be installed.

Category: security (important)
Bug References: 1216135, 1216261
CVE References: CVE-2023-5367, CVE-2023-5574
Sources used:
openSUSE Leap 15.5 (src): xwayland-22.1.5-150500.7.5.1
SUSE Linux Enterprise Workstation Extension 15 SP5 (src): xwayland-22.1.5-150500.7.5.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 22 Maintenance Automation 2023-10-31 12:30:33 UTC
SUSE-SU-2023:4293-1: An update that solves two vulnerabilities can now be installed.

Category: security (important)
Bug References: 1216135, 1216261
CVE References: CVE-2023-5367, CVE-2023-5574
Sources used:
openSUSE Leap 15.4 (src): xwayland-21.1.4-150400.3.20.1
SUSE Linux Enterprise Workstation Extension 15 SP4 (src): xwayland-21.1.4-150400.3.20.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 23 Maintenance Automation 2023-10-31 12:30:37 UTC
SUSE-SU-2023:4292-1: An update that solves three vulnerabilities can now be installed.

Category: security (important)
Bug References: 1216133, 1216135, 1216261
CVE References: CVE-2023-5367, CVE-2023-5380, CVE-2023-5574
Sources used:
openSUSE Leap 15.4 (src): xorg-x11-server-1.20.3-150400.38.29.1
Basesystem Module 15-SP4 (src): xorg-x11-server-1.20.3-150400.38.29.1
Development Tools Module 15-SP4 (src): xorg-x11-server-1.20.3-150400.38.29.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 24 Maintenance Automation 2023-11-02 12:30:16 UTC
SUSE-SU-2023:4338-1: An update that solves three vulnerabilities can now be installed.

Category: security (important)
Bug References: 1216133, 1216135, 1216261
CVE References: CVE-2023-5367, CVE-2023-5380, CVE-2023-5574
Sources used:
SUSE Linux Enterprise High Performance Computing ESPOS 15 SP3 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Linux Enterprise High Performance Computing LTSS 15 SP3 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Linux Enterprise Server 15 SP2 LTSS 15-SP2 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Linux Enterprise Server 15 SP3 LTSS 15-SP3 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Linux Enterprise Server for SAP Applications 15 SP2 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Linux Enterprise Server for SAP Applications 15 SP3 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Manager Proxy 4.2 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Manager Retail Branch Server 4.2 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Manager Server 4.2 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Linux Enterprise Workstation Extension 15 SP4 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Linux Enterprise Workstation Extension 15 SP5 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Enterprise Storage 7.1 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
openSUSE Leap 15.4 (src): xorg-x11-server-1.20.3-150200.22.5.79.1
SUSE Linux Enterprise High Performance Computing 15 SP2 LTSS 15-SP2 (src): xorg-x11-server-1.20.3-150200.22.5.79.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 25 OBSbugzilla Bot 2023-11-24 11:35:05 UTC
This is an autogenerated message for OBS integration:
This bug (1216261) was mentioned in
https://build.opensuse.org/request/show/1128531 Factory / xwayland
Comment 31 OBSbugzilla Bot 2024-02-11 11:05:06 UTC
This is an autogenerated message for OBS integration:
This bug (1216261) was mentioned in
https://build.opensuse.org/request/show/1145978 Factory / xorg-x11-server
Comment 34 OBSbugzilla Bot 2024-02-12 10:45:07 UTC
This is an autogenerated message for OBS integration:
This bug (1216261) was mentioned in
https://build.opensuse.org/request/show/1146120 Factory / xorg-x11-server
Comment 35 Marcus Meissner 2024-05-17 12:18:32 UTC
done