Skip to content

Various Hardening Updates#617

Open
iliaal wants to merge 1 commit into
php:1.5.xfrom
iliaal:hardening-various
Open

Various Hardening Updates#617
iliaal wants to merge 1 commit into
php:1.5.xfrom
iliaal:hardening-various

Conversation

@iliaal
Copy link
Copy Markdown

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants