You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since 6.10.0, DatabaseSession::cacheRegion() stores serialize($region) directly into the region column of nocache_regions (#14422). PHP's serialize() produces binary output that is not valid UTF-8 — protected and private object properties are encoded using null byte markers (\x00*\x00, \x00ClassName\x00).
MySQL LONGTEXT columns with utf8mb4 charset correctly reject invalid UTF-8 sequences, resulting in:
SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xDB\xE2\x88\xB2...' for column 'region'`
This can be confirmed by checking the serialized output directly:
A fresh install with minimal content may not trigger this on every request. The failure depends on the specific byte sequence produced at the boundary of null byte property markers and surrounding content. Sites with multibyte content (Arabic, Chinese, Japanese, etc.) or large deeply nested object graphs are most reliably affected, but any site using MySQL + database nocache driver is potentially vulnerable.
Workaround
Wrapping the value in base64_encode/base64_decode produces pure ASCII output that MySQL always accepts, confirming the issue is the binary content of the serialized string:
Bug description
Since 6.10.0, DatabaseSession::cacheRegion() stores serialize($region) directly into the region column of nocache_regions (#14422). PHP's serialize() produces binary output that is not valid UTF-8 — protected and private object properties are encoded using null byte markers (\x00*\x00, \x00ClassName\x00).
MySQL LONGTEXT columns with utf8mb4 charset correctly reject invalid UTF-8 sequences, resulting in:
This can be confirmed by checking the serialized output directly:
A fresh install with minimal content may not trigger this on every request. The failure depends on the specific byte sequence produced at the boundary of null byte property markers and surrounding content. Sites with multibyte content (Arabic, Chinese, Japanese, etc.) or large deeply nested object graphs are most reliably affected, but any site using MySQL + database nocache driver is potentially vulnerable.
Workaround
Wrapping the value in base64_encode/base64_decode produces pure ASCII output that MySQL always accepts, confirming the issue is the binary content of the serialized string:
How to reproduce
All three must be true:
Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response