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

@iliaaliliaal commented May 15, 2026

Copy link
Copy Markdown
Contributor

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
iliaalforce-pushed the hardening-various branch from 67ab520 to fc74b38CompareMay 15, 2026 14:09
@asgrim
asgrim self-requested a review May 15, 2026 14:24
@asgrimasgrim added the enhancement New feature or request label May 15, 2026
@asgrimasgrim added this to the 1.3.13 milestone May 15, 2026
@asgrimasgrim self-assigned this May 15, 2026
@asgrimasgrim modified the milestones: 1.3.13, 1.5.0May 20, 2026

@asgrimasgrim left a comment

Copy link
Copy Markdown
Contributor

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.xMay 20, 2026
28 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@iliaal@asgrim