Document queue serializer trust boundary and safer serializer options
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.1k
- Forks
- 285
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
The default queue serializer is yii\queue\serializers\PhpSerializer, which uses PHP serialization for job payloads. This is expected for trusted Yii/PHP producers and trusted queue backends, but the trust boundary is easy to miss.
If an application allows untrusted or semi-trusted producers to write jobs, or if queue storage is shared with systems outside the application trust boundary, the default PHP serializer is not appropriate. Workers deserialize queued payloads before validating that the result is a JobInterface instance, so arbitrary raw queue messages must be treated as trusted input.
Suggested action:
- Document that the default PHP serializer assumes trusted producers and trusted queue storage.
- Recommend
yii\queue\serializers\JsonSerializeror a custom serializer for queues that receive jobs from non-PHP, third-party, or otherwise less trusted producers. - Mention that queue backends such as Redis, DB, AMQP, file storage, SQS, etc. should not be writable by untrusted actors when using the default serializer.
- Consider whether a future major version should use a safer default or require an explicit opt-in for PHP serialization.
This is intended as public hardening/documentation work, not as a report of a default remotely exploitable issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the public documentation for yii\queue\serializers\PhpSerializer and yii\queue\serializers\JsonSerializer, then review how queue backends such as Redis, DB, AMQP, file storage, and SQS are described. Document the trusted-producer and trusted-storage assumptions, recommend safer alternatives for less-trusted or non-PHP producers, and record the future-major-version consideration without presenting it as a current vulnerability.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, documentation, security
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100