Skip to content

Normalize stored serialized data handling - #2393

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

sbreker wants to merge 3 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 2 times, most recently 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
@anvit

anvit commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

@sbreker this has a merge conflict due to the same test updated in #2408 . Let us know if you have the capacity to rebase and fix this, but if not, we can rebase and merge this change

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 daeee27 to b1e92e3 Compare September 29, 2026 23:25
@sbreker

sbreker commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

@sbreker this has a merge conflict due to the same test updated in #2408 . Let us know if you have the capacity to rebase and fix this, but if not, we can rebase and merge this change

Hi @anvit! Rebase completed and pushed - feel free to squash and merge anytime...

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.

4 participants