Skip to content

Stdlib: mail() additional_params shell escape + mail.force_extra_parameters #21434

Description

@PurHur

Category

stdlib | child of #3285 (mail transport depth)

Problem

php-src runs php_escape_shell_cmd() on $additional_params (arg 5) before appending to sendmail_path. mail.force_extra_parameters INI overrides the caller params when set. This compiler either ignores arg 5 for the pipe or concatenates unescaped.

php-src reference

Repro

<?php
// With mock sendmail that records argv: mail(..., '', ';evil')
// Zend escapes; argv must not execute shell metacharacters as syntax

Scope

Path Work
ext/standard/VmMail.php escape + force_extra_parameters
Reuse existing escapeshellcmd builtin if present
Tests mock sendmail recording $1… / command line

Done when (php-src-strict)

  • Metacharacters in additional_params are escaped like Zend
  • mail.force_extra_parameters overrides arg 5 when set
  • Compliance green on VM

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions