/

CVE-2026-61701

Severity:

HIGH RISK

(8.8)

Unsafe Deserialization (CWE-502) in Laravel MagicLink

CVE-2026-61701

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Laravel MagicLink deserializes stored action objects without sufficient integrity protection, leaving an unsafe legacy fallback reachable. If an attacker can manipulate the relevant database record through another vulnerability or privileged access, visiting the associated magic link may execute arbitrary code in the application process.

Affected context

The issue occurs in Laravel MagicLink deployments that store serialized action objects in the magic-links database records and later deserialize them when a magic link is used. The risk depends on an attacker first obtaining a way to alter those records, such as through SQL injection or compromised administrative access; the magic-link feature itself does not independently provide database-write access.

Exploit preconditions

  • Attack surface: Magic-link request handling and action deserialization
  • Required access: Ability to manipulate the relevant database action record, typically through a separate database-access vulnerability or privileged administrative compromise
  • Trigger point: A user or process visits a magic link associated with the manipulated record
  • Why exploitation is possible: Serialized action data is accepted without sufficient integrity verification, and an unsafe legacy deserialization path can process attacker-controlled object behavior

Why this happens

The vulnerability results from treating serialized application objects stored in a database as trusted data. Insufficient integrity protection permits modified action records to reach deserialization, while the reachable unsafe unserialization fallback can reconstruct object graphs with executable behavior. This maps to CWE-502: Deserialization of Untrusted Data, because externally influenceable serialized data is converted into application objects without adequately restricting the types or verifying the data's origin.

Potential impact

  • Arbitrary code execution in the Laravel application process may occur
  • Application credentials and sensitive data could be exposed
  • The application runtime could be modified or disrupted
  • Attackers could gain a foothold for further unauthorized activity
  • Data accessed through magic-link workflows could be altered or disclosed

General mitigation guidance

Mitigation generally focuses on removing unsafe object deserialization and reducing trust in database-stored action data.

Common defensive patterns include:

  • Replacing serialized executable objects with allowlisted action identifiers and validated scalar parameters
  • Eliminating unsafe unserialization fallbacks and using restricted, data-only formats
  • Applying authenticated integrity protection to any unavoidable state-bearing link or record data
  • Validating action schemas before processing and rejecting unexpected types or fields
  • Preventing unauthorized database writes through parameterized queries, strong access controls, and administrative separation
  • Running application processes with least privilege and limiting access to secrets and sensitive resources

How teams detect issues like this

Organizations can identify similar risks through:

  • Static analysis rules for unserialize() and other unsafe deserialization APIs
  • Code review searches for serialized objects stored in databases or embedded in authentication links
  • Review of fallback parsing paths that bypass integrity checks or type restrictions
  • Tests that verify tampered action records are rejected before object reconstruction
  • Database monitoring for unexpected changes to magic-link action fields
  • Policy enforcement that prohibits executable object serialization in authentication and authorization workflows

Automated application-security and dependency-review tools may help flag unsafe deserialization patterns, but runtime and data-flow review remains important.

Sources

SourceLink
github.comgithub.com/cesargb/laravel-magiclink/commit/19fa820a49ea9b3984e9a91b4bf4bf0cf8375183
github.comgithub.com/cesargb/laravel-magiclink/pull/148
github.comgithub.com/cesargb/laravel-magiclink/releases/tag/v2.25.1
github.comgithub.com/cesargb/laravel-magiclink/security/advisories/GHSA-r33w-fg8j-9c94

Frequently asked

questions

No. Exploitation generally requires a separate capability to manipulate the associated database record; visiting the link then triggers the vulnerable deserialization path.

The attacker needs database-write influence, such as SQL injection or compromised administrative access. Normal access to an unmodified magic link is not by itself sufficient.

Avoid deserializing executable application objects. Prefer allowlisted action names with validated parameters, and reject unexpected or tampered state before processing.

Treat database and link-derived state as untrusted, enforce integrity protection and strict schemas, remove unsafe fallback parsers, and apply least privilege to application and administrative access.

Find out what's already
exploitable in your codebase.