Repository navigation
fix(laravel): require patched symfony/http-foundation and add a Composer cooldown - #117
Conversation
…er cooldown 7.3.7 is affected by GHSA-r925-mgvr-h9cc. Releases 7.4.19 to 7.4.22 fix it but carry four advisories that packagist published on November 4, so 7.4.23 is the first version that Composer accepts. The seven-day cooldown needs Composer 2.11 or later. composer.lock follows once 7.4.23 clears the cooldown.
sc0
left a comment
There was a problem hiding this comment.
Approving in advance - all in all looks good, but merging it without composer.lock will break compose install.
| "laravel/sanctum": "^4.0", | ||
| "laravel/tinker": "^2.7", | ||
| "symfony/http-foundation": "7.3.7" | ||
| "symfony/http-foundation": "^7.4.23" |
There was a problem hiding this comment.
[High] Update composer.lock before merging
The committed composer.lock still selects symfony/http-foundation v7.3.7, which does not satisfy the new ^7.4.23 requirement. Composer rejects this mismatch, so the README's composer install step fails on a clean checkout, and the patched dependency is not delivered.
ELI5: The two dependency lists disagree, so new users cannot install the example.
Fix: Regenerate and commit composer.lock using Composer 2.11+ with the seven-day cooldown enabled before merging. Then verify a clean composer install, run composer audit --locked, and smoke-test the viewer.
There was a problem hiding this comment.
Fixed in a76591b. I went with a full composer update instead of just symfony/http-foundation, because the targeted update still left 12 advisories in laravel/framework, league/flysystem and other Symfony packages. composer audit --locked is clean now, and the README steps on a clean checkout load the viewer without errors.
The lock still pinned symfony/http-foundation v7.3.7, which fails the ^7.4.23 constraint, so composer install rejected a clean checkout. Regenerated with Composer 2.11.2 under the seven-day cooldown. A full update also clears the 12 other advisories that composer audit reported in laravel/framework, league/flysystem, and symfony components.
Why
The Laravel example pins
symfony/http-foundationto 7.3.7, which is affected by GHSA-r925-mgvr-h9cc, a ReDoS inHeaderUtils::split()through theCache-Controlheader. Dependabot reports it in alert 1867 (https://github.com/PSPDFKit/nutrient-web-examples/security/dependabot/1867). Version 7.4.19 fixes that advisory. But packagist published four more advisories on November 4 that affect 7.4.19 to 7.4.22. Composer refuses those versions, so 7.4.23 is the first version that the example can use.What changed
composer.jsonreplaces the exact 7.3.7 pin with^7.4.23, and it adds a seven-day Composer cooldown throughconfig.policy.cooldown.period. The README now asks for Composer 2.11 or later, because 2.11 is the first release that enforces the cooldown. I checked Composer 2.8.8, 2.9.8 and 2.10.3, and all three ignore the setting.composer.lockcomes from a fullcomposer updatewith Composer 2.11.2 under the cooldown, because a targeted update ofsymfony/http-foundationleft 12 advisories inlaravel/framework,league/flysystem,symfony/http-kernel,symfony/mime,symfony/routingandsymfony/yaml. The update moves 70 packages, includinglaravel/framework12.62.0 to 12.71.0 andsymfony/http-foundation7.3.7 to 7.4.23.How I tested it
composer audit --lockedreports no advisories.composer install,.envcopy,php artisan key:generate,npm install,npm run devandphp artisan serve, with PHP 8.5 and Composer 2.11.2 in Docker.document.pdf,.PSPDFKit-Errorstays hidden, and the page logs no errors. The shared browser suite excludes the Laravel example, so CI does not cover this.composer.json.Open question
The example ships
composer.phar2.8.8, which ignores the cooldown, but the README tells readers to install Composer themselves. Do we still need the bundledcomposer.phar, or can I remove it in this PR?