Skip to content

Commit 1dfe99f

Browse files
AngelFQCclaude
andcommitted
Security: Restrict allowed classes in Sequence::getUnSerializeGraph()
Refs GHSA-2c5g-hrhg-44vg Route Sequence::getUnSerializeGraph() through UnserializeApi::unserialize() with the existing 'sequence_graph' type, which restricts instantiation to the Fhaculty\Graph classes that legitimately compose a serialized sequence graph. This closes the PHP Object Injection path that allowed arbitrary class instantiation from the sequence.graph column, reusing the codebase's canonical allowlisted-deserialization helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 516d87e commit 1dfe99f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/CoreBundle/Entity/Sequence.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Fhaculty\Graph\Graph;
1212
use Gedmo\Timestampable\Traits\TimestampableEntity;
1313
use Stringable;
14+
use UnserializeApi;
1415

1516
#[ORM\Table(name: 'sequence')]
1617
#[ORM\Entity(repositoryClass: SequenceRepository::class)]
@@ -82,7 +83,7 @@ public function hasGraph(): bool
8283
*/
8384
public function getUnSerializeGraph()
8485
{
85-
return unserialize($this->graph);
86+
return UnserializeApi::unserialize('sequence_graph', $this->graph);
8687
}
8788

8889
public function setGraphAndSerialize(Graph $graph): self

0 commit comments

Comments
 (0)