{"id":"CVE-2022-24743","aliases":["CVE-2022-24743","GHSA-mf3v-f2qq-pf9g"],"related":[],"kind":"vulnerability","state":"published","title":"Insufficient Session Expiration in Sylius","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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<?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->userRepository = $userRepository;\n        $this->metadata = $metadata;\n        $this->passwordUpdater = $passwordUpdater;\n    }\n\n    public function __invoke(ResetPassword $command): void\n    {\n        /** @var ShopUserInterface|null $user */\n        $user = $this->userRepository->findOneBy(['passwordResetToken' => $command->resetPasswordToken]);\n\n        Assert::notNull($user, 'No user found with reset token: ' . $command->resetPasswordToken);\n\n        $resetting = $this->metadata->getParameter('resetting');\n        $lifetime = new \\DateInterval($resetting['token']['ttl']);\n\n        if (!$user->isPasswordRequestNonExpired($lifetime)) {\n            throw new \\InvalidArgumentException('Password reset token has expired');\n        }\n\n        if ($command->resetPasswordToken !== $user->getPasswordResetToken()) {\n            throw new \\InvalidArgumentException('Password reset token does not match.');\n        }\n\n        $user->setPlainPassword($command->newPassword);\n\n        $this->passwordUpdater->updatePassword($user);\n        $user->setPasswordResetToken(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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Sylius es una plataforma de comercio electrónico de código abierto. En versiones anteriores a 1.10.11 y 1.11.2, el token de restablecimiento de contraseña no se establecía como nulo después de cambiar la contraseña. El mismo token podía ser usado varias veces, lo que podía resultar en un filtrado del token existente y a un cambio de contraseña no autorizado. El problema ha sido corregido en versiones 1.10.11 y 1.11.2. Como medida de mitigación, sobrescriba la clase \"Sylius\\Bundle\\ApiBundle\\CommandHandler\\ResetPasswordHandler\" con el código proporcionado por los mantenedores y regístrela en un contenedor. Más información sobre esta medida de mitigación está disponible en el aviso de seguridad de GitHub","source":"nvd"}],"published":"2022-03-14T21:00:14.000Z","modified":"2026-06-17T04:32:25.263Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","score":8.2,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:N","score":6.4,"rating":"MEDIUM"}],"cwes":["CWE-613"],"affected":[{"ranges":[{"version":"< 1.10.11","status":"affected"},{"version":">= 1.11.0, < 1.11.2","status":"affected"}],"vendor":"Sylius","product":"Sylius","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.10.0","status":"affected","fixed":"1.10.11"}],"ecosystem":"Packagist","package":"sylius/sylius","purl":"pkg:composer/sylius/sylius","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.11.0","status":"affected","fixed":"1.11.2"}],"ecosystem":"Packagist","package":"sylius/sylius","purl":"pkg:composer/sylius/sylius","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.10.0","fixed":"1.10.11"},{"status":"affected","introduced":"1.11.0","fixed":"1.11.2"}],"vendor":"sylius","product":"sylius","cpe":"cpe:2.3:a:sylius:sylius:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/Sylius/Sylius/releases/tag/v1.10.11","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Sylius/Sylius/releases/tag/v1.11.2","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Sylius/Sylius/security/advisories/GHSA-mf3v-f2qq-pf9g","tags":["exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24743","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Sylius/Sylius","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-22T15:49:17.884Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-24743","url":"https://www.cve.org/CVERecord?id=CVE-2022-24743","licence":"CVE Terms of Use","modified":"2025-04-22T18:18:50.307Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mf3v-f2qq-pf9g","url":"https://github.com/advisories/GHSA-mf3v-f2qq-pf9g","licence":"CC-BY-4.0","modified":"2023-11-08T04:08:34.760Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-24743","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24743","licence":"Public domain","modified":"2026-06-17T04:32:25.263Z"}],"updatedAt":"2026-11-25T22:58:10.097Z","epss":{"score":0.01252,"percentile":0.70266,"date":"2026-12-01T12:00:22.000Z"}}