← 输入框|github.com|刷新
Skip to content

Fix the PMMP and shopsys integration tests on 2.3.x - #15484

Merged
ondrejmirtes merged 2 commits into
phpstan:2.3.xfrom
pawell67:pocketmine-shift-overflow-baseline
Oct 17, 2026
Merged

ondrejmirtes merged 2 commits into
phpstan:2.3.xfrom
pawell67:pocketmine-shift-overflow-baseline

Conversation

@pawell67

@pawell67 pawell67 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes two integration jobs that fail on every phpstan-src PR changing the PHAR (e.g. phpstan/phpstan-src#6695). The two fixes are in one PR because every PR touching e2e/** runs all integration jobs, so neither can be green on its own.

1. Baseline the PocketMine-MP fread() length (PMMP Tests)

Since phpstan/phpstan-src#6647 (Check open integer-range bounds for shift-left overflow):

src/world/format/io/region/RegionLoader.php:154
Parameter #2 $length of function fread expects int<1, max>, int given.
$bytesToRead = $this->locationTable[$index]->getSectorCount() << 12;
$payload = fread($this->filePointer, $bytesToRead);

getSectorCount() is only positive-int, so << 12 can overflow and the result is int. As @JanTvrdik noted in #6647, the new error is correct and he left the baseline unchanged. This adds the entry to pocketmine-ng-baseline.neon, sorted by path. PocketMine-MP's config sets reportUnmatchedIgnoredErrors: false, so older PHARs are not affected.

2. Update the vulnerable Symfony packages in the shopsys locks (Integration - shopsys/shopsys)

Both jobs abort in their setup step, before PHPStan runs: shopsys' composer security-check fails on symfony/expression-language (CVE-2026-109449), symfony/http-foundation (CVE-2026-108082) and symfony/yaml (CVE-2026-109413). Same situation as #14849. Only those three packages are updated to 7.4.21 in shopsys-composer.lock and shopsys-project-base-composer.lock (composer update ... --with 'symfony/expression-language:7.4.*' --no-install on shopsys v19.0.0); expression-language is held at 7.4.* so it does not jump to 8.x. 18 lines per lock.

composer audit --locked still lists composer/composer and league/flysystem (GitHub advisories only). shopsys' security-check did not flag them, so they are left alone.

I could not run the shopsys setup scripts locally (missing PHP extensions in the container), so the shopsys result is confirmed by CI only: on the earlier PR it passed with this lock change.

🤖 Generated with Claude Code

pawell67 and others added 2 commits October 15, 2026 21:13
…ow check

phpstan/phpstan-src#6647 made an open positive-int << 12 return int, since it
can overflow. RegionLoader passes getSectorCount() << 12 to fread(), and
getSectorCount() is only positive-int, so the length is no longer int<1, max>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shopsys/shopsys setup runs `composer security-check` after install and
aborts on symfony/expression-language, symfony/http-foundation and symfony/yaml
(CVE-2026-109449, CVE-2026-108082, CVE-2026-109413). Only those three packages
are updated, to 7.4.21, in both shopsys locks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pawell67
pawell67 force-pushed the pocketmine-shift-overflow-baseline branch from 329ecf1 to b6e6c06 Compare October 15, 2026 19:13
@pawell67 pawell67 changed the title Baseline the PocketMine-MP fread() length after the shift-left overflow check Fix the PMMP and shopsys integration tests on 2.3.x Oct 15, 2026
@ondrejmirtes
ondrejmirtes merged commit 72bf92c into phpstan:2.3.x Oct 17, 2026
171 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants