Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Serializer::JSON: deserialize ignores engine config that serialize honours

Open
#1,815 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
perl
Domain
backend

Research direction

Start in lib/Dancer2/Serializer/JSON.pm at lines 39-41 and 50-57, comparing how serialize merges $self->config with how deserialize builds its options. Identify which configured decoder options are safe to allow, including max_depth and max_size. Done means supported configuration affects deserialization consistently without forwarding unsafe or unintended keys.

Written by the indexing model from the issue text.

Description

Bug

Status: reasoned from code

lib/Dancer2/Serializer/JSON.pm:50-57. serialize merges $self->config into its options (lines 39-41); deserialize does not — it only sets utf8 and deletes strict_utf8.

So allow_nonref and every other configured option apply in one direction only, despite being configured in one place. That is surprising and undocumented.

Suggested fix

Mirror the merge loop from serialize, but be deliberate about which options are safe to honour on the decode side. Blindly forwarding every config key to the decoder could enable options nobody intended, so an allowlist is probably right.

Worth explicitly supporting max_depth and max_size as hardening while in there — JSON::XS defaults to max_depth 512 and max_size 0 (unlimited), and neither is currently settable from Dancer2 config.

Dominant language
Perl
Stars
604
Forks
287
Avg merge
1d 9h
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PerlDancer/Dancer2

All issues in PerlDancer/Dancer2

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.