CVE-2022-24743: Sylius/sylius Insufficient Session Expiration Vulnerability

HIGH
Advisory Identifier: GHSA-mf3v-f2qq-pf9g
CVSS 7.1
CWE-613
Published
Advisory Summary

CVE-2022-24743 is a HIGH (CVSS 7.1) insufficient session expiration vulnerability (CWE-613: Insufficient Session Expiration) affecting Sylius/sylius libraries in the Packagist ecosystem. The issue involves insufficient session expiration in sylius. Remediation is available by upgrading affected packages to version 1.10.11, 1.11.2.

CVE-2022-24743 at a Glance

CVE Identifier CVE-2022-24743
GHSA Identifier GHSA-mf3v-f2qq-pf9g
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product Sylius/sylius
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2022-24743

To remediate this vulnerability, upgrade all affected Sylius/sylius dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sylius/sylius fixed: 1.10.11
Upgrade sylius/sylius to 1.10.11
sylius/sylius fixed: 1.11.2
Upgrade sylius/sylius to 1.11.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for sylius/sylius

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-24743, inspect your project dependencies for Sylius/sylius:

inspect dependencies for sylius/sylius

Analyze the terminal output to locate any version of Sylius/sylius in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.11), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In Sylius/sylius, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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)

CVE-2022-24743 Affected Sylius/sylius Versions

2 component(s)
Fixed Versions:
1.10.111.11.2
Product / Package Ecosystem Affected Versions Fixed Version
sylius/sylius
Packagist
≥ 1.10.0
< 1.10.11
1.10.11
sylius/sylius
Packagist
≥ 1.11.0
< 1.11.2
1.11.2

References

Frequently Asked Questions

What is CVE-2022-24743?
CVE-2022-24743 is a security vulnerability in Sylius/sylius involving Insufficient Session Expiration in Sylius under CWE-613: Insufficient Session Expiration.
Which Sylius/sylius versions are affected?
Affected versions include releases prior to 1.10.11, 1.11.2 across affected packages: sylius/sylius.
What version fixes CVE-2022-24743?
Upgrading to 1.10.11, 1.11.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sylius/sylius affected?
Yes, sylius/sylius is affected in releases prior to 1.10.11, 1.11.2. Upgrade your dependency to 1.10.11, 1.11.2 or later.
What is the CVSS score of CVE-2022-24743?
CVE-2022-24743 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2022-24743?
CVE-2022-24743 is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check Packagist dependencies for CVE-2022-24743?
Run the dependency tree command: 'inspect dependencies for sylius/sylius'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mf3v-f2qq-pf9g",
  "modified" : "2022-03-15T21:48:34Z",
  "published" : "2022-03-14T22:30:46Z",
  "aliases" : [ "CVE-2022-24743" ],
  "summary" : "Insufficient Session Expiration in Sylius",
  "details" : "### 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)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.10.0"
      }, {
        "fixed" : "1.10.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.11.0"
      }, {
        "fixed" : "1.11.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Sylius/Sylius/security/advisories/GHSA-mf3v-f2qq-pf9g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24743"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Sylius/Sylius"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Sylius/Sylius/releases/tag/v1.10.11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Sylius/Sylius/releases/tag/v1.11.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-613" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-14T22:30:46Z",
    "nvd_published_at" : "2022-03-14T21:15:00Z"
  }
}