Vulnerability DatabaseCVE-2026-142643

CVE-2026-142643: 
Laravel vulnerability analysis and mitigation

Overview

CVE-2026-142643 is a type confusion vulnerability in the Laravel PHP web application framework that allows unauthenticated attackers to bypass exists and unique validation rules by submitting specially crafted JSON input. The flaw affects Laravel framework versions prior to 12.73.0 and versions 13.0.0 through 13.42.x (prior to 13.43.0), and is specific to applications using MySQL or MariaDB as the database backend. It was disclosed on December 2, 2026, with the underlying fix merged on November 12, 2026. The vulnerability carries a CVSS v3.1 base score of 5.3 (Medium) (GitHub Advisory, Feedly).

Technical details

The root cause is classified under CWE-843 (Access of Resource Using Incompatible Type / Type Confusion) and CWE-1287 (Improper Validation of Specified Type of Input). Laravel's DatabasePresenceVerifier class passed integer and boolean values received from JSON requests directly to the database query builder without type coercion, binding them as native PHP integers or booleans. On MySQL and MariaDB, when a bound integer is compared against a string (VARCHAR) column, the database engine implicitly casts the string column to a number — meaning any non-numeric string evaluates to 0, causing values like JSON 0, false, or [0] to satisfy an exists:invites,code rule on a non-numeric string column. The fix introduces a prepareValue() method in DatabasePresenceVerifier that casts integers to their string representation and booleans to '1' or '0' before query binding (GitHub Advisory, PR #62447, Commit 2b517db).

Impact

Successful exploitation allows an unauthenticated attacker to bypass application-level record existence checks, potentially gaining access to features or resources that require a valid reference to an existing database record (e.g., invite codes, tokens, or access keys). The primary impact is a confidentiality breach (CVSS C:L), as attackers may access restricted application areas or data without possessing a legitimate credential. Integrity and availability are not directly impacted by this vulnerability, and PostgreSQL, SQLite, and form-encoded (non-JSON) inputs are unaffected (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code or in-the-wild exploitation has been reported as of the disclosure date. The EPSS score is 0.0, indicating a currently low probability of exploitation in the wild, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. However, the attack requires no authentication, no user interaction, and low complexity — any application endpoint that accepts JSON and uses exists or unique validation rules against a MySQL/MariaDB string column is potentially vulnerable (Feedly, GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify a Laravel application backed by MySQL or MariaDB that accepts JSON-encoded POST requests and applies exists or unique validation rules on non-numeric string columns (e.g., invite codes, coupon codes, or access tokens).
  2. Identify target endpoint: Locate an API endpoint or form handler that validates a field with a rule such as required|exists:invites,code, where code is a VARCHAR column.
  3. Craft malicious JSON payload: Prepare a JSON request body where the target field is set to an integer or boolean value, such as {"code": 0}, {"code": false}, or {"code": [0]}.
  4. Submit JSON request: Send the crafted payload via HTTP POST with Content-Type: application/json to the target endpoint. The Laravel validator passes the integer 0 to DatabasePresenceVerifier, which binds it as an integer to the SQL query.
  5. Bypass validation: MySQL/MariaDB casts all non-numeric string values in the code column to 0 for comparison, causing the query to return a non-zero count and the exists rule to pass — even though no record with code 0 exists.
  6. Access restricted functionality: With validation bypassed, the attacker gains access to the protected feature (e.g., redeeming an invite, activating a coupon) without a valid record reference (GitHub Advisory, PR #62447).

Indicators of compromise

  • Network: HTTP POST requests to validation-gated endpoints with Content-Type: application/json headers containing integer or boolean values (0, false) in fields expected to hold string tokens or codes.
  • Logs: Application logs showing successful validation passes for fields like invite codes or tokens where the submitted value is 0, false, or a single-element array like [0]; repeated requests from the same IP with varying integer/boolean payloads suggesting probing behavior.
  • Application Behavior: Unexpected activation of invite links, coupon codes, or access tokens without corresponding valid records in the database; database query logs (if enabled) showing WHERE code = 0 or equivalent integer comparisons against VARCHAR columns.

Mitigation and workarounds

Upgrade to Laravel framework version 13.43.0 (for the 13.x branch) or 12.73.0 (for the 12.x branch), which include the fix in DatabasePresenceVerifier (GitHub Advisory, PR #62447, PR #62448). As a temporary workaround without upgrading, prepend a string (or integer, as appropriate) rule before exists and unique rules in your validation logic (e.g., required|string|exists:invites,code), or cast the input to the expected type in the controller's prepareForValidation() method. Applications using PostgreSQL or SQLite, or those that only accept form-encoded (non-JSON) input, are not affected and do not require immediate action.

Community reactions

The vulnerability was reported by researcher localhost8080 and the fix was authored by contributor pushpak1300 and merged by Laravel creator Taylor Otwell on November 12, 2026 (PR #62447). A community blog post titled "Your Laravel exists rule let 0 through on MySQL" was published on November 20, 2026, indicating awareness within the Laravel developer community (PR #62448). The issue was discussed on Mastodon's infosec.exchange and tracked across multiple vulnerability aggregators shortly after public disclosure.

Additional resources


Source: This report was generated using AI

Related Laravel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-142642MEDIUM5.4
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026
CVE-2026-142644MEDIUM5.3
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026
CVE-2026-142643MEDIUM5.3
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026
CVE-2026-142647MEDIUM4.8
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026
CVE-2026-142645MEDIUM4.8
  • Laravel logoLaravel
  • laravel/framework
NoYesDec 02, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management