CVE-2022-24743
mediumpriority · track · 33EPSS 0.013 · 69 %ileEUUSEPSS · scored 2026-10-27
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 6.4–8.2
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (6)
Products and version ranges known to be affected.
advisories (1)
Vendor and ecosystem advisories describing this.
- GHSA-mf3v-f2qq-pf9gInsufficient Session Expiration in Sylius2022-03-14ghsa · osvUS
### Impact The 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. ### Patches The issue is fixed in versions: 1.10.11, 1.11.2 and above ### Workarounds You have to overwrite your `Sylius\Bundle\ApiBundle\CommandHandler\ResetPasswordHandler` class using this code: ```php <?php declare(strict_types=1); namespace App\CommandHandler\Account; use Sylius\Bundle\ApiBundle\Command\Account\ResetPassword; use Sylius\Component\Core\Model\ShopUserInterface; use Sylius\Component\Resource\Metadata\MetadataInterface; use Sylius\Component\User\Repository\UserRepositoryInterface; use Sylius\Component\User\Security\PasswordUpdaterInterface; use Symfony\Component\Messenger\Handler\MessageHandlerInterface; use Webmozart\Assert\Assert; final class ResetPasswordHandler implements MessageHandlerInterface { private UserRepositoryInterface $userRepository; private MetadataInterface $metadata; private PasswordUpdaterInterface $passwordUpdater; public function __construct( UserRepositoryInterface $userRepository, MetadataInterface $metadata, PasswordUpdaterInterface $passwordUpdater ) { $this->userRepository = $userRepository; $this->metadata = $metadata; $this->passwordUpdater = $passwordUpdater; } public function __invoke(ResetPassword $command): void { /** @var ShopUserInterface|null $user */ $user = $this->userRepository->findOneBy(['passwordResetToken' => $command->resetPasswordToken]); Assert::notNull($user, 'No user found with reset token: ' . $command->resetPasswordToken); $resetting = $this->metadata->getParameter('resetting'); $lifetime = new \DateInterval($resetting['token']['ttl']); if (!$user->isPasswordRequestNonExpired($lifetime)) { throw new \InvalidArgumentException('Password reset token has expired'); } if ($command->resetPasswordToken !== $user->getPasswordResetToken()) { throw new \InvalidArgumentException('Password reset token does not match.'); } $user->setPlainPassword($command->newPassword); $this->passwordUpdater->updatePassword($user); $user->setPasswordResetToken(null); } } ``` And register it in container: ```yaml App\CommandHandler\Account\ResetPasswordHandler: arguments: - '@sylius.repository.shop_user' - !service class: Sylius\Component\Resource\Metadata\MetadataInterface factory: [ '@sylius.resource_registry', 'get' ] arguments: - 'sylius.shop_user' - '@sylius.security.password_updater' tags: - { name: messenger.message_handler, bus: sylius.command_bus } - { name: messenger.message_handler, bus: sylius_default.bus } ``` ### For more information If you have any questions or comments about this advisory: * Open an issue in [Sylius issues](https://github.com/Sylius/Sylius/issues) * Email us at [security@sylius.com](mailto:security@sylius.com)
also known as (3)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (11)
External citations — patches, advisories, analysis.
- https://cxsecurity.com/cveshow/CVE-2022-24743/cnnvd
- https://github.com/Sylius/Sylius/releases/tag/v1.10.11cnnvd
- https://github.com/Sylius/Sylius/releases/tag/v1.11.2cnnvd
- https://github.com/Sylius/Sylius/security/advisories/GHSA-mf3v-f2qq-pf9gcnnvd
- https://www.cybersecurity-help.cz/vdb/SB2022031508cnnvd
- https://github.com/Sylius/Sylius/releases/tag/v1.10.11enisa_euvd
- https://github.com/Sylius/Sylius/releases/tag/v1.11.2enisa_euvd
- https://github.com/Sylius/Sylius/security/advisories/GHSA-mf3v-f2qq-pf9genisa_euvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan