CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-R33W-FG8J-9C94

Magic Tricks or Dark Arts? RCE in Laravel MagicLink

Amit Schendel
Amit Schendel
Senior Security Researcher

Feb 13, 2026·6 min read·39 visits

Executive Summary (TL;DR)

The `cesargb/laravel-magiclink` package (< 2.25.1) trusts the database too much. It stores serialized PHP actions in the `magic_links` table and unserializes them when a user clicks the link. If an attacker can modify this table (via SQLi or compromised credentials), they can inject a malicious PHP object (gadget chain) that executes code upon deserialization. The fix involves HMAC signing to ensure data integrity.

A critical insecure deserialization vulnerability in `cesargb/laravel-magiclink` allows attackers with database write access to execute arbitrary code. The package, designed to create passwordless login links, stored serialized PHP objects directly in the database without integrity checks. This flaw turns a standard SQL Injection or low-privileged database access into a full Remote Code Execution (RCE) event.

The Hook: When Convenience Becomes a Curse

We all love magic links. Users hate passwords, and developers hate managing them. cesargb/laravel-magiclink is a popular solution for this, allowing you to generate a URL that, when clicked, performs an action—usually logging a user in. It’s elegant, simple, and ostensibly secure. But as with all things in security, the devil is in the implementation details.

Under the hood, this package wasn't just storing a token and a user ID. It was storing an Action. When you generate a magic link, the package serializes a PHP object representing what that link should do and stuffs it into the database. When the user clicks the link, the application fetches that blob, wakes it up, and executes it.

This architecture relies on a fatal assumption: that the database is a sanctuary where data is immutable and trustworthy. But in the real world, databases are messy places. SQL Injection exists. Disgruntled employees exist. Leaked credentials exist. By treating the database as a trusted source for serialized objects, the developers inadvertently built a remote control for your server that anyone with write access to the magic_links table could pick up.

The Flaw: The Forbidden Fruit of Serialization

The root cause here is CWE-502: Deserialization of Untrusted Data. If you're new to this, think of PHP serialization as freezing an object. You take a complex data structure—with all its properties and logic—and freeze it into a string of text. unserialize() is the microwave that thaws it back out into a living, breathing object.

The problem arises when you thaw out something you didn't freeze. If an attacker can replace the frozen lasagna in your freezer with a frozen bomb, your microwave is going to have a bad time. In PHP, this is achieved via "gadget chains." These are sequences of code in existing classes (like those in Laravel or Monolog) that trigger when an object is destructed or woken up.

In laravel-magiclink versions prior to 2.25.1, the code essentially did this:

// Fetch the row from the DB
$action_data = $magicLinkRow->action;
 
// Blindly trust it
$action = unserialize($action_data);
 
// Run it
$action->run();

There was no digital signature. No HMAC. No validation. The code assumed that if the data was in the database, it must be safe. This effectively upgrades any vulnerability that allows database writes (like a limited SQL injection) into full-blown Remote Code Execution.

The Code: The Smoking Gun

Let's look at the vulnerable logic found in src/MagicLink.php and src/Actions/ResponseAction.php. The vulnerability was incredibly straightforward—a direct call to unserialize on a database column.

The Vulnerable Code (Simplified):

public function getActionAttribute($value)
{
    // 💀 DANGER ZONE
    return unserialize($value);
}

This is the coding equivalent of leaving your front door unlocked because you live in a "gated community." The fix implemented in version 2.25.1 introduces a sanity check. They didn't just stop using serialization (which would be a breaking change); they wrapped it in a layer of cryptography.

The Fix (v2.25.1):

The maintainers introduced a Serializable class that handles signing. Now, when data is stored, it is hashed with the application's APP_KEY using HMAC.

// Verifying the data integrity before unserializing
if (! hash_equals($signature, hash_hmac('sha256', $payload, $secret))) {
    throw new InvalidSignatureException();
}
 
// Also adding allowed_classes to restrict what can be instantiated
return unserialize($payload, ['allowed_classes' => $allowed]);

By checking the signature, the application ensures that the data in the database was created by the application itself. If an attacker manually updates the row via SQLi, they won't know the APP_KEY to generate the correct signature, and the exploit fails.

The Exploit: From SQLi to RCE

How does a hacker actually pull this off? It requires a prerequisite: Write access to the magic_links table. This changes the CVSS vector slightly (PR:L), but don't let that lower your guard. A SQL Injection vulnerability anywhere in the app often gives read/write access to the whole DB.

The Attack Chain:

  1. Recon: The attacker identifies that the target is using cesargb/laravel-magiclink and finds a way to modify the database (SQLi or perhaps a compromised internal tool).
  2. Weaponization: Using a tool like PHPGGC (PHP Generic Gadget Chains), the attacker generates a malicious serialized object. Since the target is a Laravel app, chains like Laravel/RCE5 or Monolog/RCE1 are prime candidates.
    ./phpggc Laravel/RCE5 "system('id')" --base64
  3. Injection: The attacker updates a valid magic link record, replacing the legitimate action blob with their malicious payload.
    UPDATE magic_links 
    SET action = 'O:40:"Illuminate\\Broadcasting\\PendingBroadcast":...' 
    WHERE id = 123;
  4. Trigger: The attacker simply visits the URL associated with that magic link ID.
  5. Detonation: The application fetches the row, calls unserialize(), the gadget chain fires, and the server executes system('id').

The Impact: Why You Should Panic

So, why is this an 8.8 High severity and not a critical 10? Solely because of the prerequisite: you need to touch the database first. However, in the context of modern web exploitation, this is a massive escalation vector.

Imagine you find a low-impact SQL injection that only lets you update a profile table, or you have credentials for a dashboard with limited permissions. Without this vulnerability, you are an annoyance. With this vulnerability, you are a God.

Once code execution is achieved, the attacker can:

  • Read the .env file (stealing AWS keys, database passwords, and app secrets).
  • Dump the entire user database.
  • Install a persistent backdoor or webshell.
  • Pivot to other servers in the internal network.

It turns a data-tampering issue into a total system compromise. The "Magic Link" becomes a portal to hell.

The Fix: Closing the Portal

The remediation is simple: Update immediately.

Run the following in your terminal:

composer require cesargb/laravel-magiclink:^2.25.1

If you cannot update for some reason (legacy entanglements, fear of breaking changes), you are in a tight spot. You could theoretically write a database trigger that prevents updates to the action column, but that's a fragile band-aid.

Post-Patch Verification: After updating, existing magic links generated with the old version might become invalid because they lack the cryptographic signature required by the new version. You may need to clear out old links or regenerate them. It's a small price to pay for not getting owned.

Audit Strategy: Check your database logs. If you see mysterious UPDATE queries targeting the magic_links table that didn't originate from the application's standard flow, you might already have a visitor.

Official Patches

cesargbRelease notes for v2.25.1 containing the fix.
cesargbPull request implementing signed serialization.

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected Systems

cesargb/laravel-magiclink < 2.25.1Laravel applications using MagicLink

Affected Versions Detail

Product
Affected Versions
Fixed Version
cesargb/laravel-magiclink
cesargb
< 2.25.12.25.1
AttributeDetail
Vulnerability IDGHSA-R33W-FG8J-9C94
CWECWE-502 (Deserialization of Untrusted Data)
CVSS Score8.8 (High)
CVSS VectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack VectorNetwork (requires DB Write Access)
ImpactRemote Code Execution (RCE)

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1505.003Server Software Component: Web Shell
Persistence
T1210Exploitation of Remote Services
Lateral Movement
CWE-502
Deserialization of Untrusted Data

The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.

Known Exploits & Detection

GitHub AdvisoryAdvisory details indicating the lack of integrity checks on deserialized data.

Vulnerability Timeline

Vulnerability Published
2026-02-12
Patch v2.25.1 Released
2026-02-12

References & Sources

  • [1]GHSA-R33W-FG8J-9C94 Advisory
  • [2]Fix Commit

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-71322
4.3

CVE-2026-71322: Missing Authorization Check in Netflix Lemur Certificate Export

Netflix Lemur, a TLS/SSL certificate management framework, contains a missing authorization check in its certificate export endpoint. Prior to version 1.9.3, the validation logic verifying whether a user had permission to export a certificate was incorrectly placed inside a block that executed only if the selected plugin required a private key. When an authenticated user attempted to export a certificate using a plugin that did not require the private key, the authorization check was bypassed, allowing unauthorized access to the public portions of the certificate and producing misleading audit logs.

Alon Barad
Alon Barad
0 views•6 min read
•about 2 hours ago•GHSA-JF24-8G2H-2WG7
7.2

GHSA-JF24-8G2H-2WG7: Remote Code Execution in LibreNMS AboutController via Binary Path Substitution

A critical security flaw in LibreNMS allows authenticated administrators to execute arbitrary commands by modifying the configured binary path for snmpget and accessing the About page. This occurs due to insufficient verification of the executable file's identity and integrity prior to executing it with shell_exec.

Amit Schendel
Amit Schendel
1 views•6 min read
•about 3 hours ago•GHSA-7CJ5-V4PP-V632
4.8

GHSA-7cj5-v4pp-v632: Stored Cross-Site Scripting in LibreNMS Graph Descriptions

LibreNMS versions prior to 26.7.0 are vulnerable to a stored Cross-Site Scripting (XSS) vulnerability. An authenticated administrator can inject arbitrary HTML or JavaScript into graph descriptions via specific administrative configuration endpoints. When another authenticated user views the affected graph, the unescaped payload executes within their browser context.

Alon Barad
Alon Barad
2 views•5 min read
•about 4 hours ago•GHSA-7GWW-X7FH-JF9J
8.1

GHSA-7GWW-X7FH-JF9J: SSRF-Driven Stored Cross-Site Scripting in LibreNMS Oxidized Integration

An injection vulnerability in LibreNMS's Oxidized integration component allows administrative or network-positioned attackers to achieve stored cross-site scripting (XSS). By setting a malicious oxidized.url endpoint, the server makes outbound queries and processes returned JSON fields containing malicious HTML or JavaScript. These payloads are outputted directly in the web UI without appropriate output encoding.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 5 hours ago•CVE-2026-17106
7.1

CVE-2026-17106: Container-to-Host Arbitrary File Write in moby/go-archive (CopyEscape)

CVE-2026-17106 (CopyEscape) is a container-to-host arbitrary file-write vulnerability within Docker's archiving and extraction library moby/go-archive. By utilizing a Time-of-Check to Time-of-Use (TOCTOU) race condition during the file-walking stage inside a running container, a malicious container process can force the host engine to produce a compromised tar stream. During client-side extraction, the Docker CLI resolves directory entries through absolute symbolic links, resulting in arbitrary file creation or modification on the host system.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 6 hours ago•CVE-2026-73974
5.5

CVE-2026-73974: Local Path Traversal and Privilege Escalation in Linuxfabrik Monitoring Plugins

CVE-2026-73974 is a local path traversal vulnerability in linuxfabrik-lib and Linuxfabrik Monitoring Plugins. Under standard monitoring configurations running with elevated privileges via sudo, this flaw can be exploited by an unprivileged local user to read arbitrary root-only files, resulting in local privilege escalation.

Alon Barad
Alon Barad
4 views•5 min read