CVE-2022-24743: Sylius/sylius Insufficient Session Expiration Vulnerability
HIGHCVE-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
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).
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.
Upgrade sylius/sylius to 1.10.11
Upgrade sylius/sylius to 1.11.2
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
CVE-2022-24743 Affected Sylius/sylius Versions
2 component(s)| 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?
Which Sylius/sylius versions are affected?
What version fixes CVE-2022-24743?
Is sylius/sylius affected?
What is the CVSS score of CVE-2022-24743?
What CWE is associated with CVE-2022-24743?
How can I check Packagist dependencies for CVE-2022-24743?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}