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



CVE-2026-142649

CVE-2026-142649: Input Validation Bypass via Loose Type Comparison in Laravel Framework

Alon Barad
Alon Barad
Software Engineer

Dec 3, 2026·10 min read·1 visit

Executive Summary (TL;DR)

An omitted strict flag in PHP's in_array() call within Laravel's validateIn method allows non-canonical numeric strings (containing whitespace, newlines, scientific notation, or leading zeros) to bypass the 'in', 'Rule::in', and 'not_in' validation rules. Fixed in Laravel 12.67.0 and 13.26.0.

CVE-2026-142649 (also tracked as GHSA-h2hg-mfj4-rg7q) is an input validation bypass vulnerability affecting the validation subsystem of the Laravel web application framework (laravel/framework). Specifically, the validateIn method in src/Illuminate/Validation/Concerns/ValidatesAttributes.php performs non-strict comparisons when evaluating scalar input values against defined allowlists for the 'in', 'Rule::in', and 'not_in' validation rules. Because PHP's native in_array() function defaults to loose equality (==) when the third parameter ($strict) is omitted, numeric strings with non-canonical representations—such as leading or trailing whitespace, embedded newlines, leading zeros, positive signs, decimal points, or scientific notation—evaluate as equal to standard numeric allowlist entries. Furthermore, because Laravel's validated() and valid() accessor methods return the original, un-canonicalized input string rather than the matched allowlist token, unvalidated characters and unexpected string formats propagate directly into downstream business logic, database queries, and state enforcement checks.

Vulnerability Overview

The Laravel framework (laravel/framework) provides an integrated validation component located within the Illuminate\Validation namespace. Developers rely on this subsystem to enforce structural, syntactic, and semantic constraints on incoming HTTP request parameters before passing user-supplied data to controllers, models, or external services. Among the most frequently deployed rules in this subsystem are the in, Rule::in, and not_in validators, which restrict an input attribute to a discrete set of allowed (or disallowed) values.

In versions of laravel/framework prior to 12.67.0 and 13.26.0, the underlying implementation of the in validation rule (ValidatesAttributes::validateIn) suffers from an Incorrect Comparison vulnerability (CWE-697). When evaluating scalar inputs against an array of allowed string parameters, the framework invokes PHP's built-in in_array() function without specifying the $strict = true argument. Consequently, the PHP runtime executes a loose equality check (==) between the cast input string and each element in the parameter list.

Under PHP 8 comparison semantics, comparing two strings that both appear numeric triggers an automatic numeric conversion prior to comparison. This behavior allows an attacker to supply non-canonical numeric strings—including values padded with horizontal tabs, newline characters, leading zeros, positive signs, floating-point decimals, or exponential notation—that mathematically equate to an allowed number while remaining lexically distinct.

The security impact of this flaw is amplified by how Laravel exposes validated data to the application. When validation passes, methods such as $request->validated() and $validator->valid() do not substitute the user's input with the matched canonical value from the allowlist. Instead, they return the exact raw string sent in the request. Any downstream application component assuming that data returned by validated() strictly matches one of the literal strings specified in the in rule becomes susceptible to logic desynchronization, state bypasses, and parser discrepancies.

Root Cause Analysis

The root cause of CVE-2026-142649 lies in the interaction between Laravel's string-normalized validation parameter parsing and PHP's loose type comparison operator (==). When a developer defines a validation rule such as 'status' => 'in:1,2,3' or Rule::in([1, 2, 3]), Laravel normalizes the rule parameters into an array of strings: ['1', '2', '3']. When validateIn executes for a scalar $value, it casts $value to a (string) and searches for it within $parameters via in_array((string) $value, $parameters).

In PHP, in_array(mixed $needle, array $haystack, bool $strict = false): bool defaults to non-strict comparison when the third argument is omitted. While both (string) $value and the elements of $parameters are of type string at the point of execution, PHP's loose equality operator (==) does not perform a byte-for-byte lexical comparison on strings if both operands qualify as numeric strings.

According to PHP 8's internal string parsing rules (is_numeric_string), a string is considered numeric if it consists of optional leading whitespace, an optional sign (+ or -), digits, an optional decimal component, and an optional scientific exponent (e or E). Furthermore, when PHP compares two numeric strings using ==, or when trailing whitespace and certain control characters are processed in specific numeric comparison contexts, the engine converts both operands to integers or floats and compares their mathematical values.

Because of this behavior, comparing '1' from the $parameters array against user inputs such as ' 1', '1 ', "\t1", "1\n", '01', '+1', '1.0', or '1e0' evaluates to true. Note also that the validateNotIn method directly inverts the result of validateIn (return ! $this->validateIn($attribute, $value, $parameters);), meaning that not_in rules are equally affected by the loose comparison semantics.

An additional architectural inconsistency existed within validateIn itself prior to the patch. If $value was an array rather than a scalar, validateIn executed count(array_diff($value, $parameters)) === 0. Because array_diff() compares elements using strict string representation ((string) $elem1 === (string) $elem2), array inputs were subjected to exact lexical matching, whereas scalar inputs fell through to the loose in_array() check.

Code Analysis

The vulnerable method is validateIn, located in src/Illuminate/Validation/Concerns/ValidatesAttributes.php. Prior to commit 0db83d4177675d9290bee91f33f90b2b5828e56e, the method was implemented as follows:

// File: src/Illuminate/Validation/Concerns/ValidatesAttributes.php (Pre-Patch)
public function validateIn($attribute, $value, $parameters)
{
    if (is_array($value)) {
        return count(array_diff($value, $parameters)) === 0;
    }
 
    // VULNERABLE: The 3rd argument ($strict) to in_array() is omitted,
    // defaulting to false and triggering loose (==) comparison.
    return ! is_array($value) && in_array((string) $value, $parameters);
}

In PR #61146 (commit 0db83d4177675d9290bee91f33f90b2b5828e56e), authored by Mior Muhammad Zaki (crynobone), the flaw was remediated by passing true as the third argument to in_array(). This enforces strict identity comparison (===), ensuring that both the data type and the exact byte sequence of the cast string match an entry in $parameters.

diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
index e23dbce..63ecdd2 100644
--- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
+++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php
@@ -1522,7 +1522,7 @@ public function validateIn($attribute, $value, $parameters)
             return count(array_diff($value, $parameters)) === 0;
         }
 
-        return ! is_array($value) && in_array((string) $value, $parameters);
+        return ! is_array($value) && in_array((string) $value, $parameters, true);
     }

To verify the fix and prevent regressions, the patch introduced a parameterized PHPUnit test testInRuleIsNotLoosyBypassed in tests/Validation/ValidationInRuleTest.php. This test explicitly checks eight distinct non-canonical representations of the number 1 against the rule in:1,2,3:

// File: tests/Validation/ValidationInRuleTest.php (Post-Patch)
#[TestWith([' 1', false])]
#[TestWith(['1 ', false])]
#[TestWith(["\t1", false])]
#[TestWith(["1\n", false])]
#[TestWith(['01', false])]
#[TestWith(['+1', false])]
#[TestWith(['1.0', false])]
#[TestWith(['1e0', false])]
#[TestWith(['1', true])]
public function testInRuleIsNotLoosyBypassed(mixed $value, bool $expectation)
{
    $trans = new Translator(new ArrayLoader, 'en');
 
    $v = new Validator($trans, ['x' => $value], ['x' => ['in:1,2,3']]);
 
    $this->assertSame($expectation, $v->passes());
}

Regarding fix completeness: because (string) $value is explicitly cast to a string and $parameters are normalized to string elements by the validator's rule parser (and by Illuminate\Validation\Rules\In::__toString()), enforcing in_array(..., ..., true) guarantees a strict lexical comparison (string === string). Both scalar and array branches of validateIn now exhibit consistent comparison semantics, and validateNotIn inherits this strictness directly.

Exploitation

Exploiting CVE-2026-142649 requires no special network positioning or privileges beyond the ability to submit HTTP requests to a Laravel endpoint that validates numeric strings using in, Rule::in, or not_in without pairing them with strict type-checking rules (such as integer) or input trimming middleware covering the specific payload variation.

Consider a typical Laravel controller endpoint that validates a user-supplied role identifier or transaction state using an allowlist and then applies security controls or conditional branching based on the validated output:

// Vulnerable Application Pattern
public function updateAccountState(Request $request)
{
    // Allowlist permits status 1 (Standard) or 2 (Restricted)
    $validated = $request->validate([
        'status_code' => ['required', Rule::in(['1', '2'])],
    ]);
 
    // Downstream strict check against status '2'
    if ($validated['status_code'] === '2') {
        $this->applySecurityRestrictions($request->user());
    }
 
    // Value is persisted to a backend database that casts '02' or '2.0' to integer 2
    DB::table('accounts')
        ->where('user_id', $request->user()->id)
        ->update(['status_code' => $validated['status_code']]);
}

To bypass the application's conditional restriction check while still setting the database column to 2, an attacker submits an HTTP POST request containing a non-canonical representation of 2 that is not stripped by Laravel's default TrimStrings middleware (for example, '02', '+2', '2.0', or '2e0', or whitespace variants if TrimStrings is disabled or bypassed):

POST /account/state HTTP/1.1
Host: vulnerable-app.example.com
Content-Type: application/json
 
{
  "status_code": "02"
}

During execution, the attack proceeds through four stages:

  1. validateIn evaluates in_array('02', ['1', '2']). Because '02' == '2' is true in PHP, validation succeeds.
  2. $request->validate() returns ['status_code' => '02'].
  3. The downstream guard if ($validated['status_code'] === '2') evaluates '02' === '2', which is false. The call to applySecurityRestrictions() is skipped.
  4. When the database query executes against an integer column (e.g., MySQL INT), the database engine implicitly converts '02' to the integer 2, successfully persisting the restricted status code without triggering the application-layer security hook.

Similarly, if an application uses not_in to block a reserved identifier, and a downstream system compares the raw string without normalization, or conversely, if an attacker injects "1\n" into a parameter that is subsequently concatenated into a line-delimited backend protocol (such as a Redis command stream, custom header, or flat-file log), the embedded newline passes the in:1,2,3 check unhindered.

Impact Assessment

CVE-2026-142649 is assigned a CVSS v3.1 base score of 5.3 (Medium) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N. The vector reflects that the vulnerability is remotely exploitable over the network (AV:N) with low attack complexity (AC:L), requiring neither authentication (PR:N) nor user interaction (UI:N). The direct impact is confined to integrity (I:L), as the flaw allows attackers to introduce malformed or non-canonical data past the input validation boundary.

The concrete security consequences depend on how downstream application code and external systems consume the output of $request->validated() or $validator->valid(). Three primary failure modes arise from this vulnerability:

  • Validation-to-Processing Desynchronization: When the validation layer evaluates equality loosely (==) while downstream business logic uses strict equality (===), match() expressions (which use === in PHP 8), or hash-map key lookups ($map[$validated['id']]), the application fails to match expected execution branches or triggers unhandled UnhandledMatchError / undefined array key exceptions.
  • Cache Poisoning and Rate-Limit Evasion: If an application constructs cache keys or rate-limiting buckets using the raw validated parameter (e.g., Cache::remember("item:" . $validated['type'], ...)), an attacker can supply '1', '01', '001', '+1', '1.0', and '1e0' to generate multiple distinct cache entries for the same logical database record.
  • Downstream Parser Anomalies: When TrimStrings middleware is not applied to a route (such as certain API routes, CLI commands, or excluded attributes), payloads containing control characters like horizontal tabs ("\t1") or line feeds ("1\n") pass validation and can corrupt downstream line-oriented formats, CSV exports, or key-value lookups.

According to FIRST.org Exploit Prediction Scoring System (EPSS) metrics, CVE-2026-142649 holds an EPSS score of 0.00459 (0.46% probability of exploitation within 30 days), placing it in the 41.58th percentile. It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, and no weaponized public exploit modules currently exist outside of the vendor's regression test suite.

Remediation

Organizations utilizing laravel/framework on the 12.x or 13.x release branches should upgrade to a patched release immediately. The vulnerability is resolved in Laravel 12.67.0 and Laravel 13.26.0.

To apply the fix via Composer, update the laravel/framework dependency and verify the installed version:

composer update laravel/framework
composer show laravel/framework | grep versions

> [!NOTE] > Upgrading to 12.67.0 or 13.26.0 enforces strict string comparison (===) in validateIn. If an existing application inadvertently relied on loose matching—for example, expecting '01' or '1.0' to pass an in:1,2,3 rule—those requests will now properly fail validation.

For environments where an immediate framework upgrade cannot be performed, developers should implement defense-in-depth validation rules. Combining the integer rule (or numeric / digits as appropriate) with in or Rule::in ensures that scientific notation, floating-point decimals, embedded whitespace, and leading zeros are rejected before or alongside the allowlist evaluation:

// Workaround: Enforce strict integer format alongside Rule::in
$validated = $request->validate([
    'status_code' => ['required', 'integer', Rule::in([1, 2, 3])],
]);
 
// Explicitly cast the validated attribute before downstream strict comparisons
$statusCode = (int) $validated['status_code'];

Additionally, ensure that Laravel's Illuminate\Foundation\Http\Middleware\TrimStrings middleware remains globally active to strip leading and trailing whitespace (' 1', '1 ', "\t1", "1\n") from incoming request payloads prior to validation.

Official Patches

LaravelOfficial GitHub Security Advisory for CVE-2026-142649 / GHSA-h2hg-mfj4-rg7q
LaravelPull Request #61146 fixing loose comparison in validateIn
LaravelGit commit 0db83d4177675d9290bee91f33f90b2b5828e56e
LaravelLaravel Framework v12.67.0 Release
LaravelLaravel Framework v13.26.0 Release

Fix Analysis (1)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
EPSS Probability
0.46%
Top 58% most exploited

Affected Systems

laravel/framework

Affected Versions Detail

Product
Affected Versions
Fixed Version
laravel/framework
Laravel
< 12.67.012.67.0
laravel/framework
Laravel
>= 13.0.0, < 13.26.013.26.0
AttributeDetail
CVE IDCVE-2026-142649 (GHSA-h2hg-mfj4-rg7q)
CWE ClassificationCWE-697: Incorrect Comparison
CVSS v3.1 Score5.3 Medium (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N)
EPSS Score0.46% (41.58th Percentile)
Affected ComponentIlluminate\Validation\Concerns\ValidatesAttributes::validateIn
Attack VectorNetwork (Unauthenticated HTTP Request with Non-Canonical Numeric String)
Exploit StatusPoC (Unit tests in vendor patch)
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1565.001Data Manipulation: Stored Data Manipulation
Impact
CWE-697
Incorrect Comparison

The application compares two entities in a manner that does not yield the intended comparison results, leading to unexpected behavior or security boundaries being bypassed.

Known Exploits & Detection

GitHubOfficial patch commit containing PHPUnit test cases demonstrating the validation bypass vectors (' 1', '1 ', '\t1', '1\n', '01', '+1', '1.0', '1e0').

Vulnerability Timeline

Fix commit 0db83d4177675d9290bee91f33f90b2b5828e56e authored by Mior Muhammad Zaki (crynobone) in PR #61146
2026-08-13
GitHub Security Advisory GHSA-h2hg-mfj4-rg7q published
2026-12-02
CVE-2026-142649 published in NVD and CVE.org
2026-12-03

References & Sources

  • [1]GitHub Security Advisory GHSA-h2hg-mfj4-rg7q
  • [2]Laravel Framework Pull Request #61146
  • [3]Fix Commit 0db83d4177675d9290bee91f33f90b2b5828e56e
  • [4]Laravel v12.67.0 Release Notes
  • [5]Laravel v13.26.0 Release Notes
  • [6]NVD - CVE-2026-142649
  • [7]CVE.org - CVE-2026-142649

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-142652
7.7

CVE-2026-142652: SQL Injection in Agenta Tracing Full-Text Content Filter

An authenticated SQL injection vulnerability exists in Agenta prior to version 0.122.5 within the tracing database query layer. The full-text content filter handler in api/oss/src/dbs/postgres/tracing/utils.py interpolates user-supplied search strings directly into a SQLAlchemy text() construct without parameter binding or escaping. This flaw allows an authenticated user with read access to spans in a single project to execute arbitrary SQL conditions against the tracing database, bypassing project and tenant isolation boundaries to exfiltrate trace data across the entire platform.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 7 hours ago•GHSA-Q5PW-PP6J-MVFC
7.1

GHSA-q5pw-pp6j-mvfc: Arbitrary Command Execution via Argument Injection in Samsung/CredSweeper GitHub Action

The Samsung/CredSweeper GitHub Action between versions 1.11.6 and 1.16.x contains an argument injection vulnerability (CWE-88) in its composite action definition. The action accepts unvalidated strings for the 'error' and 'hashed' input parameters and passes them directly as command-line arguments to the CredSweeper CLI. An attacker capable of controlling these action inputs can inject the '--log_config' flag pointing to an attacker-controlled YAML file. Because CredSweeper loads this configuration using Python's logging.config.dictConfig, which supports instantiating arbitrary callables via the '()' factory key, this flaw leads to arbitrary command execution within the GitHub Actions runner environment.

Amit Schendel
Amit Schendel
8 views•11 min read
•about 8 hours ago•CVE-2026-92542
6.9

CVE-2026-92542: Blind VXLAN Injection into Encrypted Overlay Networks in Docker Engine and Moby

CVE-2026-92542 (GHSA-6m9p-4h64-m6vh) is an authentication bypass by spoofing and confused deputy vulnerability in the overlay network driver (libnetwork) of Docker Engine and Moby. The firewall rules responsible for marking outgoing VXLAN datagrams for IPsec encryption fail to distinguish between authentic VXLAN packets generated by the Linux kernel and forged UDP packets sent by local userspace processes. Consequently, an unprivileged user or process executing in the host network namespace of a Linux Docker Swarm node can transmit crafted VXLAN datagrams that the kernel automatically encrypts and routes to peer nodes, enabling blind injection of arbitrary Ethernet frames into encrypted overlay networks.

Amit Schendel
Amit Schendel
9 views•12 min read
•about 9 hours ago•CVE-2026-135389
9.1

CVE-2026-135389: Authentication Bypass via Premature Session Caching in Pion DTLS

A critical authentication bypass vulnerability exists in Pion DTLS (versions 2.1.0 through 3.1.13 and 4.0.0-rc.1 through 4.0.0-rc.5) within the DTLS 1.2 server handshake state machine. When a server is configured with a SessionStore and negotiates a certificate-based cipher suite, it prematurely persists the session ID and derived master secret immediately after processing the ClientKeyExchange message. Because this cache write occurs before validating the client's Certificate, CertificateVerify, and Finished messages, an unauthenticated remote attacker can abandon an incomplete initial handshake and immediately perform an abbreviated session resumption handshake using the derived master secret, bypassing mandatory client certificate authentication (RequireAnyClientCert, RequireAndVerifyClientCert) and custom VerifyConnection callbacks.

Amit Schendel
Amit Schendel
5 views•12 min read
•about 10 hours ago•CVE-2026-141546
5.0

CVE-2026-141546: Path Traversal and Arbitrary File Write in KiCad MCP Pro Variant Export Tools

CVE-2026-141546 (GHSA-wfmg-598x-58c5) is a path traversal vulnerability (CWE-22) in KiCad MCP Pro prior to version 4.20.1. Three variant export tools in src/kicad_mcp/tools/variants.py construct target output paths by joining unvalidated user-supplied arguments directly onto the validated output directory using Python's pathlib.Path concatenation operator. A caller invoking these tools with path traversal sequences or absolute file paths can bypass the KICAD_MCP_WORKSPACE_ROOT confinement boundary to create directories and write or overwrite arbitrary files on the host filesystem.

Alon Barad
Alon Barad
9 views•9 min read
•about 11 hours ago•CVE-2026-141553
5.5

CVE-2026-141553: Path Traversal and Arbitrary File Overwrite in termux-sync Restore Routine

CVE-2026-141553 (GHSA-x9x8-xcv7-5x5g) is a medium-severity path traversal and arbitrary file overwrite vulnerability in termux-sync prior to version 1.3.8. During backup restoration, the cmd_restore function computes the extraction containment boundary as the parent directory of the target backup folder ($PREFIX or .../files) rather than the specific subdirectory itself. Consequently, a crafted backup archive (such as usr_etc.tar.gz) can extract files into sibling directories like $PREFIX/bin, overwriting system executables such as $PREFIX/bin/sh and achieving arbitrary code execution within the Termux user context.

Alon Barad
Alon Barad
8 views•10 min read