Skip to content

Various Hardening Updates#617

Merged
asgrim merged 1 commit into
php:1.5.xfrom
iliaal:hardening-various
May 20, 2026
Merged

Various Hardening Updates#617
asgrim merged 1 commit into
php:1.5.xfrom
iliaal:hardening-various

Conversation

@iliaal
Copy link
Copy Markdown
Contributor

@iliaal iliaal commented May 15, 2026

Summary

Five hardening changes from a security audit. None is a fresh attacker primitive on its own; the audit recommended shipping them as one PR.

  • RemoveIniEntry: anchor the regex with \b and preg_quote the extension name, so uninstalling foo no longer rewrites the prefix of extension=foo_other lines.
  • PlaceholderReplacer and WindowsInstall: skip symlinks during the recursive source walk, so the iterator no longer descends into files outside the extracted source dir.
  • OverrideDownloadUrlInstallListener: warn that swapping to a release-asset URL leaves only HTTPS-to-origin as the integrity guarantee, since Composer's dist-sha was bound to the original Packagist URL.
  • ConfigureOption: validate php-ext.configure-options[].name against /^[a-zA-Z][a-zA-Z0-9_-]*$/, so configure-flag identifiers can't carry whitespace or shell metacharacters into argv or installed.json.
  • FallbackVerificationUsingOpenSsl: promote the fallback notice to writeError and document that the OpenSSL path skips Rekor transparency-log verification.
Five hardening changes from a security audit. None is a fresh attacker primitive on its own; the audit recommended shipping them as one PR.

- `RemoveIniEntry`: anchor the regex with `\b` and `preg_quote` the extension name, so uninstalling `foo` no longer rewrites the prefix of `extension=foo_other` lines.
- `PlaceholderReplacer` and `WindowsInstall`: skip symlinks during the recursive source walk, so the iterator no longer descends into files outside the extracted source dir.
- `OverrideDownloadUrlInstallListener`: warn that swapping to a release-asset URL leaves only HTTPS-to-origin as the integrity guarantee, since Composer's dist-sha was bound to the original Packagist URL.
- `ConfigureOption`: validate `php-ext.configure-options[].name` against `/^[a-zA-Z][a-zA-Z0-9_-]*$/`, so configure-flag identifiers can't carry whitespace or shell metacharacters into argv or `installed.json`.
- `FallbackVerificationUsingOpenSsl`: promote the fallback notice to `writeError` and document that the OpenSSL path skips Rekor transparency-log verification.
@iliaal iliaal force-pushed the hardening-various branch from 67ab520 to fc74b38 Compare May 15, 2026 14:09
@asgrim asgrim self-requested a review May 15, 2026 14:24
@asgrim asgrim added the enhancement New feature or request label May 15, 2026
@asgrim asgrim added this to the 1.3.13 milestone May 15, 2026
@asgrim asgrim self-assigned this May 15, 2026
@asgrim asgrim modified the milestones: 1.3.13, 1.5.0 May 20, 2026
Copy link
Copy Markdown
Contributor

@asgrim asgrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

@asgrim asgrim merged commit 51e0dc1 into php:1.5.x May 20, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

2 participants