{"id":"GHSA-jq87-2wxp-8349","aliases":[],"url":"https://o3.security/vulnerability/GHSA-jq87-2wxp-8349","summary":"ZendFramework Route Parameter Injection Via Query String in `Zend\\Mvc`","details":"In Zend Framework 2, `Zend\\Mvc\\Router\\Http\\Query` is used primarily to allow appending query strings to URLs when assembled. However, due to the fact that it captures any query parameters into the RouteMatch, and the fact that RouteMatch parameters are merged with any parent routes, this can lead to overriding already captured routing parameters, bypassing constraints defined in the parents.\n\nAs an example, consider the following route definition:\n```\narray(\n    'user' => array(\n        'type' => 'segment',\n        'options' => array(\n            'route' => '/user/:key',\n            'defaults' => array(\n                'controller' => 'UserController',\n                'action'     => 'show-action',\n            ),\n            'constraints' => array(\n                'key' => '[a-z0-9]+',\n            ),\n        ),\n        'child_routes' => array(\n            'query' => array('type' => 'query'),\n        ),\n    ),\n)\n```\nIf the request URI was /user/foo/?controller=SecretController&key=invalid_value, the RouteMatch returned after routing would contain the following:\n```\narray(\n    'controller' => 'SecretController',\n    'action'     => 'show-action',\n    'key'        => 'invalid_value',\n)\n```\nThis would lead to execution of a different controller than intended, with a value for the key parameter that bypassed the constraints outlined in the parent route.","published":"2024-06-07T20:15:48Z","modified":"2024-12-04T05:39:51.381754Z","cvss":{"score":7.5,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"zendframework/zendframework","fixedVersion":"2.0.8"},{"ecosystem":"Packagist","name":"zendframework/zendframework","fixedVersion":"2.1.4"}],"fix":{"url":"https://github.com/zendframework/zendframework/commit/0a7ec3407f02db29ea2ffd6daa71ead6fd151cfe","label":"zendframework/zendframework@0a7ec34"},"references":[{"type":"WEB","url":"https://github.com/zendframework/zendframework/commit/0a7ec3407f02db29ea2ffd6daa71ead6fd151cfe"},{"type":"WEB","url":"https://github.com/zendframework/zendframework/commit/7fcb88ebc2d56f74aa943909f2b6b53f5c86b081"},{"type":"WEB","url":"https://framework.zend.com/security/advisory/ZF2013-01"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework/ZF2013-01.yaml"},{"type":"PACKAGE","url":"https://github.com/zendframework/zendframework"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2024-12-04T05:39:51.381754Z"}}