Bug 1222856 (CVE-2024-1874) - VUL-0: CVE-2024-1874: php5,php53,php7,php72,php74,php8: improper cmdline handling on windows
Summary: VUL-0: CVE-2024-1874: php5,php53,php7,php72,php74,php8: improper cmdline hand...
Status: RESOLVED UPSTREAM
Alias: CVE-2024-1874
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P5 - None : Normal
Target Milestone: ---
Assignee: Petr Gajdos
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/401686/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-15 15:54 UTC by SMASH SMASH
Modified: 2024-04-15 15:58 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SMASH SMASH 2024-04-15 15:54:02 UTC
https://github.com/php/php-src/security/advisories/GHSA-pc52-254m-w9w7
(CVE-2024-1874) reports:

    Due to the improper handling of command line arguments on Windows,
    maliciously crafted arguments can inject arbitrary commands even if
    the bypass_shell option is enabled.

    Details
    --------
    proc_open executes external commands passed via its arguments. The documentation
    of this function states the following:

        As of PHP 7.4.0, the command may be passed as an array of command parameters.
        In this case, the process will be opened directly (without going through a

    shell) and PHP will take care of any necessary argument escaping. bypass_shell (windows only): bypass cmd.exe shell when set to true


    However, when executing .bat or .cmd files, CreateProcess implicitly spawns
    cmd.exe, resulting in command line arguments being parsed in cmd.exe despite
    the documentation explicitly stating it doesn't spawn the shell.

    While proc_open tries to escape the arguments, command prompts will not
    recognize \ as the escape character. So, the following command line argument
    will spawn calc.exe:

        test.bat "\"&calc.exe"
Comment 1 Marcus Meissner 2024-04-15 15:58:09 UTC
no need to fix windows issues.