{"id":"CVE-2022-24743","aliases":["EUVD-2022-1476","GHSA-mf3v-f2qq-pf9g"],"status":"published","title":"Insufficient Session Expiration in Sylius","description":"Sylius is an open source eCommerce platform. Prior to versions 1.10.11 and 1.11.2, the reset password token was not set to null after the password was changed. The same token could be used several times, which could result in leak of the existing token and unauthorized password change. The issue is fixed in versions 1.10.11 and 1.11.2. As a workaround, overwrite the `Sylius\\Bundle\\ApiBundle\\CommandHandler\\ResetPasswordHandler` class with code provided by the maintainers and register it in a container. More information about this workaround is available in the GitHub Security Advisory.","severity":{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.01252,"percentile":0.69633,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-613"],"published":"2022-03-14T21:00:14Z","modified":"2026-10-28T02:31:09Z","fixes":[{"ecosystem":"Packagist","package":"sylius/sylius","fixed_in":["1.10.11","1.11.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"sylius/sylius","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.10.0"},{"fixed":"1.10.11"}]}]},{"source":"ghsa","ecosystem":"Packagist","package":"sylius/sylius","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.11.0"},{"fixed":"1.11.2"}]}]},{"source":"osv","ecosystem":"Packagist","package":"sylius/sylius","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.10.0"},{"fixed":"1.10.11"}]}],"versions":["v1.10.0","v1.10.1","v1.10.10","v1.10.2","v1.10.3","v1.10.4","v1.10.5","v1.10.6","v1.10.7","v1.10.8","v1.10.9"]},{"source":"osv","ecosystem":"Packagist","package":"sylius/sylius","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.11.0"},{"fixed":"1.11.2"}]}],"versions":["v1.11.0","v1.11.1"]}],"products":[{"vendor":"sylius","product":"sylius"}],"references":[{"url":"https://github.com/Sylius/Sylius/releases/tag/v1.10.11","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web"]},{"url":"https://github.com/Sylius/Sylius/releases/tag/v1.11.2","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web"]},{"url":"https://github.com/Sylius/Sylius/security/advisories/GHSA-mf3v-f2qq-pf9g","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Third Party Advisory","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24743","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-mf3v-f2qq-pf9g"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24743.json","tags":["advisory"]},{"url":"https://github.com/Sylius/Sylius","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-24743","title":"Insufficient Session Expiration in Sylius","description":"Sylius is an open source eCommerce platform. Prior to versions 1.10.11 and 1.11.2, the reset password token was not set to null after the password was changed. The same token could be used several times, which could result in leak of the existing token and unauthorized password change. The issue is fixed in versions 1.10.11 and 1.11.2. As a workaround, overwrite the `Sylius\\Bundle\\ApiBundle\\CommandHandler\\ResetPasswordHandler` class with code provided by the maintainers and register it in a container. More information about this workaround is available in the GitHub Security Advisory.","status":"published","published":"2022-03-14T21:00:14Z","modified":"2025-04-22T18:18:50.307Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","level":"high","assessor":"cna"}],"cwes":["CWE-613"],"updated_at":"2026-11-02T14:34:34.940806Z"}],"euvd":[{"id":"EUVD-2022-1476","description":"Sylius is an open source eCommerce platform. Prior to versions 1.10.11 and 1.11.2, the reset password token was not set to null after the password was changed. The same token could be used several times, which could result in leak of the existing token and unauthorized password change. The issue is fixed in versions 1.10.11 and 1.11.2. As a workaround, overwrite the `Sylius\\Bundle\\ApiBundle\\CommandHandler\\ResetPasswordHandler` class with code provided by the maintainers and register it in a container. More information about this workaround is available in the GitHub Security Advisory.","status":"published","published":"2022-03-14T21:00:14Z","modified":"2025-04-22T18:18:50Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","level":"high"}],"updated_at":"2026-11-02T20:52:15.026784Z"}],"ghsa":[{"id":"GHSA-mf3v-f2qq-pf9g","title":"Insufficient Session Expiration in Sylius","description":"### Impact\nThe reset password token was not set to null after the password was changed. This is causing behaviour in which the same token can be used several times, so it can result in a leak of the existing token and an unauthorised password change.\n\n### Patches\nThe issue is fixed in versions: 1.10.11, 1.11.2 and above\n\n### Workarounds\nYou have to overwrite your `Sylius\\Bundle\\ApiBundle\\CommandHandler\\ResetPasswordHandler` class using this code:\n\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nnamespace App\\CommandHandler\\Account;\n\nuse Sylius\\Bundle\\ApiBundle\\Command\\Account\\ResetPassword;\nuse Sylius\\Component\\Core\\Model\\ShopUserInterface;\nuse Sylius\\Component\\Resource\\Metadata\\MetadataInterface;\nuse Sylius\\Component\\User\\Repository\\UserRepositoryInterface;\nuse Sylius\\Component\\User\\Security\\PasswordUpdaterInterface;\nuse Symfony\\Component\\Messenger\\Handler\\MessageHandlerInterface;\nuse Webmozart\\Assert\\Assert;\n\nfinal class ResetPasswordHandler implements MessageHandlerInterface\n{\n    private UserRepositoryInterface $userRepository;\n    private MetadataInterface $metadata;\n    private PasswordUpdaterInterface $passwordUpdater;\n\n    public function __construct(\n        UserRepositoryInterface $userRepository,\n        MetadataInterface $metadata,\n        PasswordUpdaterInterface $passwordUpdater\n    ) {\n        $this-\u003euserRepository = $userRepository;\n        $this-\u003emetadata = $metadata;\n        $this-\u003epasswordUpdater = $passwordUpdater;\n    }\n\n    public function __invoke(ResetPassword $command): void\n    {\n        /** @var ShopUserInterface|null $user */\n        $user = $this-\u003euserRepository-\u003efindOneBy(['passwordResetToken' =\u003e $command-\u003eresetPasswordToken]);\n\n        Assert::notNull($user, 'No user found with reset token: ' . $command-\u003eresetPasswordToken);\n\n        $resetting = $this-\u003emetadata-\u003egetParameter('resetting');\n        $lifetime = new \\DateInterval($resetting['token']['ttl']);\n\n        if (!$user-\u003eisPasswordRequestNonExpired($lifetime)) {\n            throw new \\InvalidArgumentException('Password reset token has expired');\n        }\n\n        if ($command-\u003eresetPasswordToken !== $user-\u003egetPasswordResetToken()) {\n            throw new \\InvalidArgumentException('Password reset token does not match.');\n        }\n\n        $user-\u003esetPlainPassword($command-\u003enewPassword);\n\n        $this-\u003epasswordUpdater-\u003eupdatePassword($user);\n        $user-\u003esetPasswordResetToken(null);\n    }\n}\n```\nAnd register it in container:\n\n```yaml\n\nApp\\CommandHandler\\Account\\ResetPasswordHandler:\n    arguments:\n        - '@sylius.repository.shop_user'\n        - !service\n              class: Sylius\\Component\\Resource\\Metadata\\MetadataInterface\n              factory: [ '@sylius.resource_registry', 'get' ]\n              arguments:\n                    - 'sylius.shop_user'\n                    - '@sylius.security.password_updater'\n    tags:\n        - { name: messenger.message_handler, bus: sylius.command_bus }\n        - { name: messenger.message_handler, bus: sylius_default.bus }\n         \n```\n\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues)\n* Email us at [security@sylius.com](mailto:security@sylius.com)\n","status":"published","published":"2022-03-14T22:30:46Z","modified":"2023-01-27T05:00:41Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","level":"high"}],"cwes":["CWE-613"],"updated_at":"2026-11-02T14:36:14.825433Z"}],"nvd":[{"id":"CVE-2022-24743","description":"Sylius is an open source eCommerce platform. Prior to versions 1.10.11 and 1.11.2, the reset password token was not set to null after the password was changed. The same token could be used several times, which could result in leak of the existing token and unauthorized password change. The issue is fixed in versions 1.10.11 and 1.11.2. As a workaround, overwrite the `Sylius\\Bundle\\ApiBundle\\CommandHandler\\ResetPasswordHandler` class with code provided by the maintainers and register it in a container. More information about this workaround is available in the GitHub Security Advisory.","status":"published","published":"2022-03-14T21:15:07.947Z","modified":"2026-06-17T04:32:25.263Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","level":"high","assessor":"secondary"},{"version":"3.1","score":8.2,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","level":"high","assessor":"primary"},{"version":"2.0","score":6.4,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-613"],"updated_at":"2026-11-02T14:07:13.7085Z"}],"osv":[{"id":"CVE-2022-24743","title":"Insufficient Session Expiration in Sylius","description":"Sylius is an open source eCommerce platform. Prior to versions 1.10.11 and 1.11.2, the reset password token was not set to null after the password was changed. The same token could be used several times, which could result in leak of the existing token and unauthorized password change. The issue is fixed in versions 1.10.11 and 1.11.2. As a workaround, overwrite the `Sylius\\Bundle\\ApiBundle\\CommandHandler\\ResetPasswordHandler` class with code provided by the maintainers and register it in a container. More information about this workaround is available in the GitHub Security Advisory.","status":"published","published":"2022-03-14T21:00:14Z","modified":"2026-10-28T02:31:09.153504325Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","level":"high"}],"cwes":["CWE-613"],"updated_at":"2026-11-02T15:44:24.428403Z"},{"id":"GHSA-mf3v-f2qq-pf9g","title":"Insufficient Session Expiration in Sylius","description":"### Impact\nThe reset password token was not set to null after the password was changed. This is causing behaviour in which the same token can be used several times, so it can result in a leak of the existing token and an unauthorised password change.\n\n### Patches\nThe issue is fixed in versions: 1.10.11, 1.11.2 and above\n\n### Workarounds\nYou have to overwrite your `Sylius\\Bundle\\ApiBundle\\CommandHandler\\ResetPasswordHandler` class using this code:\n\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nnamespace App\\CommandHandler\\Account;\n\nuse Sylius\\Bundle\\ApiBundle\\Command\\Account\\ResetPassword;\nuse Sylius\\Component\\Core\\Model\\ShopUserInterface;\nuse Sylius\\Component\\Resource\\Metadata\\MetadataInterface;\nuse Sylius\\Component\\User\\Repository\\UserRepositoryInterface;\nuse Sylius\\Component\\User\\Security\\PasswordUpdaterInterface;\nuse Symfony\\Component\\Messenger\\Handler\\MessageHandlerInterface;\nuse Webmozart\\Assert\\Assert;\n\nfinal class ResetPasswordHandler implements MessageHandlerInterface\n{\n    private UserRepositoryInterface $userRepository;\n    private MetadataInterface $metadata;\n    private PasswordUpdaterInterface $passwordUpdater;\n\n    public function __construct(\n        UserRepositoryInterface $userRepository,\n        MetadataInterface $metadata,\n        PasswordUpdaterInterface $passwordUpdater\n    ) {\n        $this-\u003euserRepository = $userRepository;\n        $this-\u003emetadata = $metadata;\n        $this-\u003epasswordUpdater = $passwordUpdater;\n    }\n\n    public function __invoke(ResetPassword $command): void\n    {\n        /** @var ShopUserInterface|null $user */\n        $user = $this-\u003euserRepository-\u003efindOneBy(['passwordResetToken' =\u003e $command-\u003eresetPasswordToken]);\n\n        Assert::notNull($user, 'No user found with reset token: ' . $command-\u003eresetPasswordToken);\n\n        $resetting = $this-\u003emetadata-\u003egetParameter('resetting');\n        $lifetime = new \\DateInterval($resetting['token']['ttl']);\n\n        if (!$user-\u003eisPasswordRequestNonExpired($lifetime)) {\n            throw new \\InvalidArgumentException('Password reset token has expired');\n        }\n\n        if ($command-\u003eresetPasswordToken !== $user-\u003egetPasswordResetToken()) {\n            throw new \\InvalidArgumentException('Password reset token does not match.');\n        }\n\n        $user-\u003esetPlainPassword($command-\u003enewPassword);\n\n        $this-\u003epasswordUpdater-\u003eupdatePassword($user);\n        $user-\u003esetPasswordResetToken(null);\n    }\n}\n```\nAnd register it in container:\n\n```yaml\n\nApp\\CommandHandler\\Account\\ResetPasswordHandler:\n    arguments:\n        - '@sylius.repository.shop_user'\n        - !service\n              class: Sylius\\Component\\Resource\\Metadata\\MetadataInterface\n              factory: [ '@sylius.resource_registry', 'get' ]\n              arguments:\n                    - 'sylius.shop_user'\n                    - '@sylius.security.password_updater'\n    tags:\n        - { name: messenger.message_handler, bus: sylius.command_bus }\n        - { name: messenger.message_handler, bus: sylius_default.bus }\n         \n```\n\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues)\n* Email us at [security@sylius.com](mailto:security@sylius.com)\n","status":"published","published":"2022-03-14T22:30:46Z","modified":"2023-11-08T04:08:34.760416Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","level":"high"}],"cwes":["CWE-613"],"updated_at":"2026-11-02T15:46:51.811331Z"}]}}
