Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Process] Limit env data #60858

Open
Open
@inilim

Description

@inilim

Symfony version(s) affected

7.2

Description

Limiting the transmitted data to the child environment, in which the parent script completes without errors.

How to reproduce

Example:

$value_env = \str_repeat('1234567890', 3_200);
// $value_env = \str_repeat('1234567890', 3_300);
VD::dd(\strlen($value_env));

$process = new Process(['php84', '--v'], env: [
    'key_env' => $value_env,
]);

echo 'RUN' . PHP_EOL;
$process->run();
echo 'END' . PHP_EOL;
php84 test.php
int(32000)

RUN
END
// $value_env = \str_repeat('1234567890', 3_200);
$value_env = \str_repeat('1234567890', 3_300);
VD::dd(\strlen($value_env));

$process = new Process(['php84', '--v'], env: [
    'key_env' => $value_env,
]);

echo 'RUN' . PHP_EOL;
$process->run();
echo 'END' . PHP_EOL;
php84 test.php
int(33000)

RUN

Possible Solution

Measure the transmitted value, and throw an exception

Additional Context

PHP 8.4.7 (cli) (built: May 6 2025 14:14:22) (NTS Visual C++ 2022 x64)
Copyright (c) The PHP Group
Zend Engine v4.4.7, Copyright (c) Zend Technologies
with Zend OPcache v8.4.7, Copyright (c), by Zend Technologies

Windows 10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions