Repository navigation
1.9.79: read the three request values 1.9.79's own merges left cast (PHPStan red on 1.9.79) - #328
tracking202 wants to merge 1 commit into
Conversation
1.9.79's PHPStan job has been red since the merges at 15:46Z. #308 extended ForbidNumericCastOfRequestParamRule to the pages and baselined the casts already there. Three PRs merged beside it each added a cast that its baseline does not count, and each PR passed on its own: - Personal settings (#283) cast the same-IP fallback after checking it is a key of its choices. It now stores 1 for '1' and 0 for '0', the two keys the check admits. - Setup > Offline Conversions (#293) cast a feed id after a regex test. It now reads it with PostedId::read(). - Setup > Traffic Sources (#271) cast the edited account's id to read its stored postbacks. The page's own ownership check compares the raw value in SQL, where MySQL reads '12abc' as 12. So a save from ?edit_ppc_account_id=12abc changed account 12 (one of the account's own, not the one named) and held that account's postbacks. Measured on a live instance: the old page saved the tampered edit onto account 1. The id is now read exactly, and anything else is refused in the page's words before anything is read or written. The baseline counts are unchanged: each file now holds only the casts they counted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRoS2SViuxaucFaKWsFnLr
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…rs-returned 1.9.79's PHPStan job is red on its own tip: three request casts that its merges left. #328 fixes them, and it is merged here so this branch's PHPStan check runs green. When #328 merges into 1.9.79, the commit is already there and this merge adds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRoS2SViuxaucFaKWsFnLr
…lit-check 1.9.79's PHPStan job is red on its own tip: three request casts that its merges left. #328 fixes them, and it is merged here so this branch's PHPStan check runs green. When #328 merges into 1.9.79, the commit is already there and this merge adds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRoS2SViuxaucFaKWsFnLr
1.9.79's PHPStan job is red on its own tip: three request casts that its merges left. #328 fixes them, and it is merged here so this branch's PHPStan check runs green. When #328 merges into 1.9.79, the commit is already there and this merge adds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRoS2SViuxaucFaKWsFnLr
|
claude-review and adversarial-review did not run here, and this PR cannot fix that. The Claude app runs a review only when its workflow file matches master's copy. 6834377 (#275) changed both review workflows on 1.9.79, so neither runs on any PR into 1.9.79 until master carries those files. Re-running gives the same refusal ("Workflow validation failed. The workflow file must exist and have identical content to the version on the repository's default branch"). Codex is out of review quota, so this PR has no bot review. Generated by Claude Code |
…ds-sessions 1.9.79's PHPStan job is red on its own tip: three request casts that its merges left. #328 fixes them, and it is merged here so this branch's PHPStan check runs green. When #328 merges into 1.9.79, the commit is already there and this merge adds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VRoS2SViuxaucFaKWsFnLr
…'s PHPStan job refuses Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3VVstdYdz5zwv5MUbkDjT
1.9.79's PHP Lint › PHPStan (custom rules) job has been red on the branch since the merges at 15:46Z (runs on dee579c and c6d5167). #308 extended
ForbidNumericCastOfRequestParamRuleto the pages and baselined the casts already there. Three PRs merged beside it each added a cast its baseline does not count. Each passed on its own; together they fail.(int)$_POST[...]after checking it is a key of$sameIpChoices=== '1' ? 1 : 0, which covers the two keys the check admits. Behaviour unchanged(int) $_POST['feed_id']PostedId::read(). Behaviour unchanged(int) $_GET['edit_ppc_account_id']to read the account's stored postbacksThe third row is a real fix, not only a lint fix. The page's ownership check compares the raw
edit_ppc_account_idin SQL, where MySQL reads'12abc'as 12. So a save from?edit_ppc_account_id=12abcchanged account 12, one of the account's own but not the one named. It also held account 12's postbacks as the edited account's. The id is now read once, exactly, before anything is read or written.The baseline counts are unchanged. Each file now holds only the casts they counted:
account.php328 and 332,ppc_accounts.php531 and 532.No backlog item: this was found on 1.9.79's own CI after the merges.
Verification
Run in a worktree at 1a0e95c (origin/1.9.79 c6d5167 plus this commit), PHP 8.3, MariaDB 10.11.
.claude/skills/p202-verify/scripts/verify.sh --changed:Unit run: 7,573 tests, 6 skipped. The skips are the 4 documented "User class requires DB singleton" ones, plus "this checkout has a 202-config.php" and "root reads every file".
PHPStan:
phpstan.neon.dist: no errors, where c6d5167 alone gives the CI job's 5.phpstan-strict.neon: no errors.Integration suites, each alone on a fresh scratch database, all OK:
SetupPagesAccountScopeIntegrationTestAccountPixelsIntegrationTestSameIpFallbackIntegrationTestOfflineExportIntegrationTestUnit suites:
tests/Setup,tests/Http,tests/OfflineConversion,AccountScopedWriteTestandPostReadersCheckTokenTest.Live, in Chromium against a fresh instance served from this branch: 11/11 checks.
1abcis refused with the page's sentence and the stored value is unchanged.1abcit is refused with the new sentence and nothing is written.1abcis refused and the feed is kept. A delete naming its own id removes it.Plant: with the old
ppc_accounts.phpput back, the two1abcaccount checks failed, and the old page saved the tampered name onto account 1. The file was restored (cmp-checked) and the pass re-run green.What did not run:
Generated by Claude Code