MagicLink: Insecure Deserialization of MagicLink Actions Leads to Remote Code Execution
High severity
GitHub Reviewed
Published
Feb 12, 2026
in
cesargb/laravel-magiclink
•
Updated Feb 12, 2026
Package
Affected versions
>= 2.0.0, < 2.25.1
Patched versions
2.25.1
Description
Published to the GitHub Advisory Database
Feb 12, 2026
Reviewed
Feb 12, 2026
Last updated
Feb 12, 2026
Description
MagicLink stores serialized action objects in the
magic_links.actiondatabase column and deserializes them without integrity validation or class allowlisting in src/MagicLink.php and src/Actions/ResponseAction.php. An attacker with the ability to manipulate database records (e.g., via SQL injection or compromised admin access) could inject malicious serialized objects containing arbitrary closures, leading to Remote Code Execution (RCE) when the magic link is visited.Resolution
The vulnerability has been mitigated through HMAC-signed serialization using the application key, class allowlisting restricted to
ActionAbstractsubclasses and framework classes, strict type validation preventing arbitrary object storage, and backward compatibility support for legacy data viaallowed_classesinunserialize(). Implementation includes a new Serializable security class with signing/verification, refactored getter/setter methods in MagicLink.References