Skip to content

Normalize stored serialized data handling - #2393

Open
sbreker wants to merge 2 commits into
qa/2.xfrom
dev/unserialize-refactor
Open

Normalize stored serialized data handling#2393
sbreker wants to merge 2 commits into
qa/2.xfrom
dev/unserialize-refactor

Conversation

@sbreker

@sbreker sbreker commented Jul 16, 2026

Copy link
Copy Markdown
Member

Add a shared helper for reading serialized application values and update runtime call sites to use it with explicit defaults.

@sbreker
sbreker force-pushed the dev/unserialize-refactor branch from feaa7b7 to f545910 Compare July 16, 2026 20:50

@sevein sevein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gpt-5.6-sol max is still reporting one issue:

containsObject() needs cycle detection. PHP preserves serialized references, so the valid payload a:1:{i:0;R:1;} produces a self-referential array. The recursive call then exhausts memory and terminates the request.

Regression test:

  public function testSafeUnserializeRejectsCircularArrays()
  {
      $serialized = 'a:1:{i:0;R:1;}';

      $this->assertSame(
          [],
          Qubit::safeUnserialize($serialized, [])
      );
  }

Full report here: https://gist.github.com/sevein/0aa4b44e21ec352f9cbdac5faf073c29.

@sbreker
sbreker force-pushed the dev/unserialize-refactor branch from f545910 to 0e78cf4 Compare July 23, 2026 16:59
Add a shared helper for reading serialized application values and update
runtime call sites to use it with explicit defaults.
@sbreker
sbreker force-pushed the dev/unserialize-refactor branch from 0e78cf4 to e4882cc Compare July 23, 2026 17:00
@sbreker

sbreker commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

gpt-5.6-sol max is still reporting one issue:

containsObject() needs cycle detection. PHP preserves serialized references, so the valid payload a:1:{i:0;R:1;} produces a self-referential array. The recursive call then exhausts memory and terminates the request.

Regression test:

  public function testSafeUnserializeRejectsCircularArrays()
  {
      $serialized = 'a:1:{i:0;R:1;}';

      $this->assertSame(
          [],
          Qubit::safeUnserialize($serialized, [])
      );
  }

Full report here: https://gist.github.com/sevein/0aa4b44e21ec352f9cbdac5faf073c29.

Good catch! I have added a new commit that addresses this.

@melaniekung melaniekung added this to the 2.11 milestone Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants