Bug 1219757 (CVE-2024-24821)

Summary: VUL-0: CVE-2024-24821: php-composer2: under certain conditions arbitrary code execution may lead to local privilege escalation, provide lateral user movement or malicious code execution
Product: [Novell Products] SUSE Security Incidents Reporter: SMASH SMASH <smash_bz>
Component: IncidentsAssignee: Security Team bot <security-team>
Status: RESOLVED FIXED QA Contact: Security Team bot <security-team>
Severity: Major    
Priority: P3 - Medium CC: andrea.mattiazzo, carlos.lopez
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/393513/
Whiteboard: CVSSv3.1:SUSE:CVE-2024-24821:7.8:(AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
Found By: Security Response Team Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description SMASH SMASH 2024-02-09 09:16:25 UTC
Composer is a dependency Manager for the PHP language. In affected versions several files within the local working directory are included during the invocation of Composer and in the context of the executing user. As such, under certain conditions arbitrary code execution may lead to local privilege escalation, provide lateral user movement or malicious code execution when Composer is invoked within a directory with tampered files. All Composer CLI commands are affected, including composer.phar's self-update. The following scenarios are of high risk: Composer being run with sudo, Pipelines which may execute Composer on untrusted projects, Shared environments with developers who run Composer individually on the same project. This vulnerability has been addressed in versions 2.7.0 and 2.2.23. It is advised that the patched versions are applied at the earliest convenience. Where not possible, the following should be addressed: Remove all sudo composer privileges for all users to mitigate root privilege escalation, and avoid running Composer within an untrusted directory, or if needed, verify that the contents of `vendor/composer/InstalledVersions.php` and `vendor/composer/installed.php` do not include untrusted code.  A reset can also be done on these files by the following:```sh
rm vendor/composer/installed.php vendor/composer/InstalledVersions.php
composer install --no-scripts --no-plugins
```

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2024-24821
https://www.cve.org/CVERecord?id=CVE-2024-24821
https://github.com/composer/composer/security/advisories/GHSA-7c6p-848j-wh5h
https://github.com/advisories/GHSA-7c6p-848j-wh5h

Patch:
2.2 - https://github.com/composer/composer/commit/77e3982918bc1d886843dc3d5e575e7e871b27b7
2.7 - https://github.com/composer/composer/commit/64e4eb356b159a30c766cd1ea83450a38dc23bf5
Comment 1 Andrea Mattiazzo 2024-02-09 09:17:03 UTC
Tracking as affected:
- SUSE:SLE-15-SP4:Update/php-composer2  2.2.3  
- openSUSE:Factory/php-composer2        2.6.5
Comment 2 Petr Gajdos 2024-02-13 11:04:22 UTC
Factory submission:
https://build.opensuse.org/request/show/1146367

Submitted for TW,15sp4/php-composer2. I believe all fixed.
Comment 5 Maintenance Automation 2024-02-22 16:30:07 UTC
SUSE-SU-2024:0592-1: An update that solves one vulnerability can now be installed.

Category: security (important)
Bug References: 1219757
CVE References: CVE-2024-24821
Sources used:
SUSE Linux Enterprise Server 15 SP4 LTSS 15-SP4 (src): php-composer2-2.2.3-150400.3.9.1
SUSE Linux Enterprise Server for SAP Applications 15 SP4 (src): php-composer2-2.2.3-150400.3.9.1
SUSE Manager Server 4.3 (src): php-composer2-2.2.3-150400.3.9.1
openSUSE Leap 15.4 (src): php-composer2-2.2.3-150400.3.9.1
openSUSE Leap 15.5 (src): php-composer2-2.2.3-150400.3.9.1
Web and Scripting Module 15-SP5 (src): php-composer2-2.2.3-150400.3.9.1
SUSE Linux Enterprise High Performance Computing ESPOS 15 SP4 (src): php-composer2-2.2.3-150400.3.9.1
SUSE Linux Enterprise High Performance Computing LTSS 15 SP4 (src): php-composer2-2.2.3-150400.3.9.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 6 Carlos López 2024-04-19 08:29:45 UTC
Done, closing.