Skip to content

[Pagination] Reject cursor tokens holding out-of-range floats as invalid - #4364

Open
Kocal wants to merge 1 commit into
symfony:3.xfrom
Kocal:pagination/cursor-non-finite-float
Open

Kocal wants to merge 1 commit into
symfony:3.xfrom
Kocal:pagination/cursor-non-finite-float

Conversation

@Kocal

@Kocal Kocal commented Nov 26, 2026

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
New feature? no
Deprecations? no
Documentation? no
Issues
License MIT

A cursor token whose values contain an out-of-range float literal such as 1e999 is decoded to INF. Re-encoding that payload to check the signature then threw a \JsonException, which the callers do not catch, so the token did not follow the invalid cursor path.

CursorCodec::decode() now turns that failure into an InvalidArgumentException, like any other malformed token.

| Q              | A
| -------------- | ---
| Bug fix?       | yes
| New feature?   | no
| Deprecations?  | no
| Documentation? | no
| Issues         |
| License        | MIT

A cursor token whose values contain an out-of-range float literal such as `1e999` is decoded to `INF`. Re-encoding that payload to check the signature then threw a `\JsonException`, which the callers do not catch, so the token did not follow the invalid cursor path.

`CursorCodec::decode()` now turns that failure into an `InvalidArgumentException`, like any other malformed token.
@carsonbot carsonbot added Bug Bug Fix Pagination Status: Needs Review Needs to be reviewed labels Nov 26, 2026
@Kocal
Kocal requested a review from smnandre November 26, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix Pagination Status: Needs Review Needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants