Laravel’s Read-Only GET That Wipes a Table

The short version: A read-only GET request could empty an entire table in vulnerable Laravel apps. The bug is real, the fix has existed since August, and the danger now sits mostly with apps that never update. I checked the advisory, the patch, and the code behind it: a serious flaw with a narrow blast radius and a simple fix.

In late November 2026, Laravel contributor Hristijan Manasijev posted about one of the strangest bugs he had ever reported. A GET request to a read-only endpoint, the kind of request that should only fetch data, could trigger a TRUNCATE TABLE on a related table. No write permission needed. No login needed, if the endpoint was public. The request even came back with an HTTP 500 error, which made it look like nothing had happened. Behind that error, the table was already empty.

That post spread fast, and with it came exaggeration. Some versions claimed the bug wiped the whole database or scored 9.2 out of 10. Neither is true. This article sticks to the primary sources: the GitHub security advisory, the NVD entry, and the fix itself in the Laravel source.

What CVE-2026-114508 Actually Is

CVE-2026-114508 is a vulnerability in laravel/framework, published as GitHub advisory GHSA-5wcm-3v2w-8362 under the title “Unauthorized Data Destruction”. The NVD entry for CVE-2026-114508 puts it plainly: crafted relationship inclusion on a read-only endpoint can trigger a destructive database operation on a related table instead of retrieving data.

The numbers matter, so here they are in one place.

ItemDetail
CVE IDCVE-2026-114508
AdvisoryGHSA-5wcm-3v2w-8362, “Unauthorized Data Destruction”
CVSS score6.5, Medium (CVSS 3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L)
WeaknessCWE-470, Unsafe Reflection: external input selects code to run
Vulnerable versions12.45.0 to below 12.68.0, and 13.0.0 to below 13.27.0
Fixed versions12.68.0 and 13.27.0
Vulnerable componentJsonApiResource relationship loading (ResolvesJsonApiElements trait)
ReporterHristijan Manasijev (KIKOmanasijev), Laravel contributor
Public proof of conceptNone known as of 27 November 2026
Exploitation in the wildNo evidence as of 27 November 2026

Two details in that table deserve attention. First, the score is 6.5, Medium, not 9.2. The 9.2 figure belongs to a different CVE, CVE-2026-114509, a TokenGuard authentication bypass reported by the same researcher on the same day. Second, the vulnerable component is narrow: only apps using Laravel’s JSON:API resources, a feature introduced in 12.45.0, can hit this path at all.

The advisory puts the impact plainly: a user with only read access could cause irreversible data loss, for example a related table being emptied, without needing any write permissions. The score stays Medium because no data is disclosed. I read that as honest scoring: the bug is dangerous, but it cannot touch tables outside the exposed relationship.

How One Query Parameter Empties a Table

Laravel’s JSON:API resources let an API client ask for related data in the same request. A client reading a user can add ?include=comments to get that user’s comments alongside the user record. The framework splits the value on the dot: the first segment names a relationship, and further segments name nested relationships.

The bug lived in what happened to the segments after the first one. The first segment was checked against the relationships the resource actually declares. The later segments were not checked at all and were passed straight into Eloquent’s relationship loader. So in a request shaped like ?include=comments.truncate, comments passed the check as a declared relationship, and then truncate was handed to Eloquent as if it were a relationship name to load.

Rows of server racks with blinking lights in a dark data center

Eloquent tried to load a relationship called truncate. The Comment model has no such relationship, so the call fell through to the model’s magic method handler, which forwarded it to a fresh query builder. And the query builder does have a method called truncate. It ran TRUNCATE TABLE comments immediately.

An analogy helps here. Imagine asking a librarian for “the comments shelf, shred it”. A careful librarian checks every word and refuses the second half. This librarian checked only the first word, found the shelf, and carried out the rest of the sentence without reading it. That is CWE-470 in everyday terms: untrusted input choosing which code runs.

The same flaw worked one level deeper: a nested include such as posts.comments.truncate reached the same dangerous call, and the fix’s own test suite covers that case. Whether other destructive methods such as .delete or .update work through the same path is unconfirmed, so I will not present them as working exploits. This pattern, untrusted text steering a system into an action the sender never had permission to perform, is not unique to Laravel. I have written before about prompt injection, where crafted input steers an AI system into doing something its instructions never allowed. The lesson is the same: never let raw input from the outside pick the operation.

Why a 500 Error Does Not Save Your Data

The cruelest part of this bug is the response code. The malicious request returns HTTP 500. To anyone watching the request, it looks like a failure. To an automated scanner, it looks like a dead end. But the damage happens before the error.

The sequence runs in this order. First, Eloquent resolves the relationship and executes the TRUNCATE while loading data. Second, the framework tries to use the result of that call as a relationship object. The truncate call returns a boolean, not a relationship, so the framework fails and the request ends in a 500. The error is real, but it arrives too late.

TRUNCATE is a DDL statement, so in MySQL and PostgreSQL it auto-commits. It does not sit inside the application’s transaction, so there is nothing to roll back when the 500 fires. The table is empty the moment the statement runs, and the only way back is a backup.

That ordering also hides the attack in logs. A log full of 500 errors looks like a bug, not a breach, and a team that treats every 500 as “the app broke” will miss that one of those errors emptied a table. After patching, treat a spike of 500 responses on JSON:API endpoints as something worth a look in the database, not just in the error tracker.

Who Is Vulnerable and Who Is Safe

Your situationAt risk?
Laravel 12.45.0 to 12.67.x with JsonApiResource endpointsYes
Laravel 13.0.0 to 13.26.x with JsonApiResource endpointsYes
Laravel 12.68.0 or newer, or 13.27.0 or newerNo, fixed
Laravel below 12.45.0No, the feature did not exist yet
Classic API resources (JsonResource) or no include parameterNo, different code path
JsonApiResource endpoints that require loginReduced risk, not safe

Three conditions must all hold for an attack to work. The app must run a vulnerable version, it must expose an endpoint that returns a JsonApiResource, and that resource must declare the relationship named in the first segment. If any one of those is missing, this CVE cannot touch the app. Classic API resources built on JsonResource use a different code path entirely.

Authentication changes the attacker, not the vulnerability. The CVSS vector records privileges required as none, which means that if the endpoint is public, no account is needed at all. If the endpoint requires login, any account with read access to it is enough. There is no check for write permission anywhere in the chain, because the framework never treats the request as a write. That is why getting authentication and authorization right matters, but also why authentication alone cannot be the whole answer here.

One more limiting factor: in MySQL, TRUNCATE TABLE requires the DROP privilege, so a database user without it would make the statement fail. That is one more reason to run applications with a least-privilege database user, but it is not the fix. The fix is the patch.

The Silent Fix: Patched in August, Disclosed in October

Here is the part of the timeline that surprised me most. The fix was merged on 24 August 2026. Taylor Otwell merged two twin pull requests the same evening: PR #61322 for the 13.x line and PR #61323 for the 12.x line. Both carry the same title, “Fix resource loading”, and both have an empty description. The releases followed the next day, 25 August 2026: v13.27.0 and v12.68.0. Each changelog mentions the fix in a single line among dozens of others, and neither uses the word “security”.

The public advisory only appeared on 19 October 2026, almost two months later. The NVD published the CVE on 21 October. The tweet that made the bug famous came in late November 2026, three months after the patch: a silent fix in August, a public advisory in October, and a viral post in November.

The fix itself is small and instructive. It removed the raw call that passed unvalidated segments to the relationship loader and added a filter that only allows segments matching relationships the resource actually declares. Anything else, including truncate, is now quietly ignored at every level. The two pull requests also added tests proving the point: after the fix, a request with the nested truncate include returns HTTP 200 with the comments intact.

The lesson I take from this timeline is simple. Routine updates are a security control, not just housekeeping. An app that ran composer update any time after late August was protected before anyone knew the bug existed. An app with its version pinned below the fix stayed exposed through October and November.

How to Check Your Own App

Checking takes two commands and a search through the codebase. Start with the version.

composer show laravel/framework
composer audit

The first command prints the installed version. Anything from 12.45.0 up to 12.67.x, or from 13.0.0 up to 13.26.x, is vulnerable. The second command checks installed packages against the advisory database and will flag GHSA-5wcm-3v2w-8362 directly if the app is affected. If the audit comes back clean and the version is 12.68.0 or newer, or 13.27.0 or newer, the app is patched for this CVE.

Next, find out whether the app even uses the vulnerable feature. Search the codebase for classes extending JsonApiResource:

grep -r "JsonApiResource" app/

If that search returns nothing, the app does not use JSON:API resources and this CVE does not apply to it. If it returns matches, look at each resource’s declared relationships and check whether the endpoint that serves it is public or authenticated. A public endpoint is the worst case; an authenticated one narrows the attacker pool to logged-in users.

For teams that want proof rather than a version number, the fix’s own test suite shows the shape of a safe check: on a staging copy with dummy data, request the endpoint with a nested include that names a destructive segment, then count the rows in the related table. If the count is unchanged, the app is patched. Never run that kind of test against production data.

How to Upgrade, and What to Do Until Then

The upgrade is the fix, and it is a minor version bump, not a rewrite. For the 12.x line, require 12.68.0 or newer. For the 13.x line, require 13.27.0 or newer. Run the test suite after updating, since the fix changes how nested includes are handled.

composer update laravel/framework
composer require "laravel/framework:^12.68.0"

For 13.x, I suggest going one step further and requiring 13.29.0 or newer instead of stopping at 13.27.0. The reason is the twin CVE from the same advisory day. CVE-2026-114509 is a TokenGuard authentication bypass scored 9.2, Critical, reported by the same researcher. Its fix landed in 12.68.0 and 13.29.0, so 13.27.0 closes the table-wiping bug but leaves the auth bypass open. Laravel News covered both advisories together, and the Corgea analysis walks through both in depth. Upgrading 13.x to 13.29.0 or newer closes both at once.

If an upgrade cannot ship today, these temporary measures reduce the risk. They are defensive practice, not official guidance from Laravel, and none replaces the patch.

  • Allow-list the include parameter. Add middleware that strips any include segment not on an approved list of relationships for that endpoint, especially segments after the first dot.
  • Require authentication on JsonApiResource endpoints. This does not fix the flaw, but it shrinks the attacker pool to logged-in users.
  • Give the database user least privilege. If the application database user has no DROP privilege, the TRUNCATE statement fails in MySQL. Review what the app user can actually do.
  • Keep backups current and watch for 500 spikes. A TRUNCATE cannot be undone without a backup, so backup health is the real safety net here. My guide to backing up a VPS with Restic and Backblaze B2 covers a setup that works for small apps. A sudden burst of 500 responses on a JSON:API endpoint is worth investigating rather than dismissing as noise.

When shipping code built with AI assistance, this kind of review matters even more. A generated endpoint that returns a JsonApiResource with a permissive include parameter looks correct and passes every functional test, because the bug only appears when someone sends input the developer never imagined. My notes on shipping vibe-coded apps without security holes cover the review habits that catch exactly this class of problem, and a careful deployment setup makes the patched version quicker to roll out.

Conclusion: What I Would Do Today

If I ran a Laravel app, my first move would be one command: composer show laravel/framework. If the version falls in the vulnerable ranges, I would update today, to 12.68.0 or newer on the 12.x line, or 13.29.0 or newer on the 13.x line so the twin TokenGuard CVE closes too. Then I would run composer audit and confirm the advisory is gone.

The bug itself is a good reminder of how web security actually fails. It was not a missing firewall or a leaked password. It was one unchecked word in a query string, in a feature most developers trust without thinking. GET requests are supposed to be safe, and almost always they are. This one was not, and the only reliable defense was a framework update that had already been waiting for two months. Check the version, update if needed, and keep updating.

Irfan is a Creative Tech Strategist and the founder of Grafisify. He spends his days testing the latest AI design tools and breaking down complex tech into actionable guides for creators. When he’s not writing, he’s experimenting with generative art or optimizing digital workflows.

Leave a Reply

Your email address will not be published. Required fields are marked *

You might also like
Vibe Coding and Accessibility: Why AI Ships Broken UI

Vibe Coding and Accessibility: Why AI Ships Broken UI

MCP Servers for Vibe Coding: What to Connect First

MCP Servers for Vibe Coding: What to Connect First

AI Coding Tools: What They Cost and If They Pay Off

AI Coding Tools: What They Cost and If They Pay Off

Deploy Your Vibe-Coded App: From Prompt to Production

Deploy Your Vibe-Coded App: From Prompt to Production

Best Programming Languages for Vibe Coding

Best Programming Languages for Vibe Coding

Do You Still Need to Learn to Code?

Do You Still Need to Learn to Code?