{"id":"CVE-2026-42551","aliases":["CVE-2026-42551","GHSA-vxrr-w42w-w76g"],"related":[],"kind":"vulnerability","state":"published","title":"Flight: HTTP method override enabled by default enables CSRF escalation and middleware bypass in flightphp/core","summary":"Flight is an extensible micro-framework for PHP. Prior to 3.18.1, Request::getMethod() unconditionally honors the X-HTTP-Method-Override header and the $_REQUEST['_method'] parameter on any HTTP verb (including safe verbs such as GET), with no opt-in and no whitelist of permitted target methods. A GET request can silently become a DELETE or PUT, enabling CSRF escalation against destructive endpoints, bypass of middleware gated on unsafe verbs, and cache poisoning between CDN and origin. This vulnerability is fixed in 3.18.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Flight is an extensible micro-framework for PHP. Prior to 3.18.1, Request::getMethod() unconditionally honors the X-HTTP-Method-Override header and the $_REQUEST['_method'] parameter on any HTTP verb (including safe verbs such as GET), with no opt-in and no whitelist of permitted target methods. A GET request can silently become a DELETE or PUT, enabling CSRF escalation against destructive endpoints, bypass of middleware gated on unsafe verbs, and cache poisoning between CDN and origin. This vulnerability is fixed in 3.18.1.","source":"cvelist"},{"lang":"en","text":"### Summary\n`Request::getMethod()` unconditionally honors the `X-HTTP-Method-Override` header and the `$_REQUEST['_method']` parameter on **any** HTTP verb (including safe verbs such as GET), with no opt-in and no whitelist of permitted target methods. A GET request can silently become a DELETE or PUT, enabling CSRF escalation against destructive endpoints, bypass of middleware gated on unsafe verbs, and cache poisoning between CDN and origin.\n\n### Affected code\n`flight/net/Request.php` (≈ lines 281-292):\n\n```php\npublic static function getMethod(): string\n{\n    $method = self::getVar('REQUEST_METHOD', 'GET');\n    if (self::getVar('HTTP_X_HTTP_METHOD_OVERRIDE') !== '') {\n        $method = self::getVar('HTTP_X_HTTP_METHOD_OVERRIDE');\n    } elseif (isset($_REQUEST['_method']) === true) {\n        $method = $_REQUEST['_method'];\n    }\n    return strtoupper($method);\n}\n```\n\n`$_REQUEST` aggregates `$_GET` and `$_POST`; on PHP runtimes with `request_order=GPC` it also includes `$_COOKIE`.\n\n### Proof of concept\n```\nGET /item/42?_method=DELETE        HTTP/1.1\n```\nis dispatched as `DELETE /item/42`.\n\n```\nGET /item/42                       HTTP/1.1\nX-HTTP-Method-Override: DELETE\n```\nis also dispatched as `DELETE /item/42`.\n\nTrivial CSRF vector (no JavaScript required):\n```html\n<img src=\"https://victim.tld/item/42?_method=DELETE\">\n```\nloaded on any attacker-controlled page triggers the destructive DELETE on page load, bypassing Same-Origin Policy (image loads are not blocked).\n\nReproduced against `/poc4/item/42`.\n\n### Impact\n- GET → DELETE / PUT CSRF on any route registered for unsafe verbs.\n- Bypass of authentication, CSRF token, or rate-limiting middleware that is gated only on POST/DELETE.\n- CDN cache poisoning: the CDN caches the GET response body while the origin executed a DELETE.\n\n### Patch (fixed in `3.18.1`, commit `b8dd23a`)\nA new `flight.allow_method_override` setting controls both override vectors. Operators can set it to `false` to disable `X-HTTP-Method-Override` and `_method` entirely.\n\n### Credit\nDiscovered by **@Rootingg**.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Flight es un micro-framework extensible para PHP. Antes de la versión 3.18.1, Request::getMethod() honra incondicionalmente el encabezado X-HTTP-Method-Override y el parámetro $_REQUEST[’_method’] en cualquier verbo HTTP (incluyendo verbos seguros como GET), sin opción de activación y sin lista blanca de métodos objetivo permitidos. Una solicitud GET puede convertirse silenciosamente en un DELETE o PUT, lo que permite la escalada de CSRF contra puntos finales destructivos, eludir middleware restringido a verbos inseguros y el envenenamiento de caché entre CDN y origen. Esta vulnerabilidad está corregida en la versión 3.18.1.","source":"nvd"}],"published":"2026-05-06T21:38:16.000Z","modified":"2026-10-26T14:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-436"],"affected":[{"ranges":[{"version":"< 3.18.1","status":"affected"}],"vendor":"flightphp","product":"core","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.18.1"}],"ecosystem":"Packagist","package":"flightphp/core","purl":"pkg:composer/flightphp/core","source":"ghsa"}],"references":[{"url":"https://github.com/flightphp/core/security/advisories/GHSA-vxrr-w42w-w76g","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42551","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/flightphp/core/commit/b8dd23aaa828cb289fa3c84e75b2a3717cab50b0","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/flightphp/core","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/flightphp/core/releases/tag/v3.18.1","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-05-14T12:49:44.246Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42551","url":"https://www.cve.org/CVERecord?id=CVE-2026-42551","licence":"CVE Terms of Use","modified":"2026-05-14T12:49:48.236Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vxrr-w42w-w76g","url":"https://github.com/advisories/GHSA-vxrr-w42w-w76g","licence":"CC-BY-4.0","modified":"2026-05-14T20:52:31.715Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42551","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42551","licence":"Public domain","modified":"2026-10-26T14:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:21.657Z","epss":{"score":0.00351,"percentile":0.30721,"date":"2026-12-01T12:00:22.000Z"}}