CVE-2022-24742: Sylius/sylius Sensitive Information Exposure Vulnerability

MODERATE
Advisory Identifier: GHSA-7563-75j9-6h5p
CVSS 5.0
CWE-213 CWE-668 CWE-200
Published
Advisory Summary

CVE-2022-24742 is a MODERATE (CVSS 5.0) sensitive information exposure vulnerability (CWE-213: Exposure of Sensitive Information Due to Incompatible Policies) affecting Sylius/sylius libraries in the Packagist ecosystem. The issue involves sensitive information exposure in sylius. Remediation is available by upgrading affected packages to version 1.9.10, 1.10.11, 1.11.2.

CVE-2022-24742 at a Glance

CVE Identifier CVE-2022-24742
GHSA Identifier GHSA-7563-75j9-6h5p
Severity MODERATE
CVSS v3.1 Base Score 5.0
CWE Classification CWE-213: Exposure of Sensitive Information Due to Incompatible Policies
Affected Product Sylius/sylius
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.0

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

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

How to Fix CVE-2022-24742

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.9.10
Upgrade sylius/sylius to 1.9.10
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-24742, 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.9.10), 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-213: Exposure of Sensitive Information Due to Incompatible Policies, where the product's intended functionality exposes information to certain actors in accordance with the developer's security policy, but this information is regarded as sensitive according to the intended security policies of other stakeholders such as the product's administrator, users, or others whose information is being processed. 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 Any other user can view the data if the browser tab remains open after logging out. Once someone logs out and leaves the browser open, the potential attacker may use the back button to see the content exposed on given screens. No action may be performed though, and any website refresh will block further reads. It may, however, lead to a data leak, like for example customer details, payment gateway configuration, etc.- but only if these were pages checked by the administrator. This vulnerability requires full access to the computer to take advantage of it. ### Patches The issue is fixed in versions: 1.9.10, 1.10.11, 1.11.2 and above. ### Workarounds The application must strictly redirect to the login page even when the browser back button is pressed. Another possibility is to set more strict cache policies for restricted content (like no-store). It can be achieved with the following class: ```php <?php declare(strict_types=1); namespace App\EventListener; use App\SectionResolver\ShopCustomerAccountSubSection; use Sylius\Bundle\AdminBundle\SectionResolver\AdminSection; use Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\HttpKernel\KernelEvents; final class CacheControlSubscriber implements EventSubscriberInterface { /** @var SectionProviderInterface */ private $sectionProvider; public function __construct(SectionProviderInterface $sectionProvider) { $this->sectionProvider = $sectionProvider; } public static function getSubscribedEvents(): array { return [ KernelEvents::RESPONSE => 'setCacheControlDirectives', ]; } public function setCacheControlDirectives(ResponseEvent $event): void { if ( !$this->sectionProvider->getSection() instanceof AdminSection && !$this->sectionProvider->getSection() instanceof ShopCustomerAccountSubSection ) { return; } $response = $event->getResponse(); $response->headers->addCacheControlDirective('no-cache', true); $response->headers->addCacheControlDirective('max-age', '0'); $response->headers->addCacheControlDirective('must-revalidate', true); $response->headers->addCacheControlDirective('no-store', true); } } ``` After that register service in the container: ```yaml services: App\EventListener\CacheControlSubscriber: arguments: ['@sylius.section_resolver.uri_based_section_resolver'] tags: - { name: kernel.event_subscriber, event: kernel.response } ``` The code above requires changes in `ShopUriBasedSectionResolver` in order to work. To backport mentioned logic, you need to replace the `Sylius\Bundle\ShopBundle\SectionResolver\ShopUriBasedSectionResolver` class with: ```php <?php declare(strict_types=1); namespace App\SectionResolver; use Sylius\Bundle\CoreBundle\SectionResolver\SectionInterface; use Sylius\Bundle\CoreBundle\SectionResolver\UriBasedSectionResolverInterface; use Sylius\Bundle\ShopBundle\SectionResolver\ShopSection; final class ShopUriBasedSectionResolver implements UriBasedSectionResolverInterface { /** @var string */ private $shopCustomerAccountUri; public function __construct(string $shopCustomerAccountUri = 'account') { $this->shopCustomerAccountUri = $shopCustomerAccountUri; } public function getSection(string $uri): SectionInterface { if (str_contains($uri, $this->shopCustomerAccountUri)) { return new ShopCustomerAccountSubSection(); } return new ShopSection(); } } ``` ```yaml services: sylius.section_resolver.shop_uri_based_section_resolver: class: App\SectionResolver\ShopUriBasedSectionResolver tags: - { name: sylius.uri_based_section_resolver, priority: -10 } ``` You also need to define a new subsection for the Customer Account that is used in the above services: ```php <?php declare(strict_types=1); namespace App\SectionResolver; use Sylius\Bundle\ShopBundle\SectionResolver\ShopSection; class ShopCustomerAccountSubSection extends ShopSection { } ``` ### References * Originally published at https://huntr.dev/ ### 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

CVE-2022-24742 Affected Sylius/sylius Versions

3 component(s)
Fixed Versions:
1.9.101.10.111.11.2
Product / Package Ecosystem Affected Versions Fixed Version
sylius/sylius
Packagist
< 1.9.10
1.9.10
sylius/sylius
Packagist
≥ 1.10
< 1.10.11
1.10.11
sylius/sylius
Packagist
≥ 1.11
< 1.11.2
1.11.2

References

Frequently Asked Questions

What is CVE-2022-24742?
CVE-2022-24742 is a security vulnerability in Sylius/sylius involving Sensitive Information Exposure in Sylius under CWE-213: Exposure of Sensitive Information Due to Incompatible Policies.
Which Sylius/sylius versions are affected?
Affected versions include releases prior to 1.9.10, 1.10.11, 1.11.2 across affected packages: sylius/sylius.
What version fixes CVE-2022-24742?
Upgrading to 1.9.10, 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.9.10, 1.10.11, 1.11.2. Upgrade your dependency to 1.9.10, 1.10.11, 1.11.2 or later.
What is the CVSS score of CVE-2022-24742?
CVE-2022-24742 has a CVSS v3.1 base score of 5.0 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-24742?
CVE-2022-24742 is classified under CWE-213: Exposure of Sensitive Information Due to Incompatible Policies (The product's intended functionality exposes information to certain actors in accordance with the developer's security policy, but this information is regarded as sensitive according to the intended security policies of other stakeholders such as the product's administrator, users, or others whose information is being processed.).
How can I check Packagist dependencies for CVE-2022-24742?
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-7563-75j9-6h5p",
  "modified" : "2022-03-15T21:47:08Z",
  "published" : "2022-03-14T22:26:58Z",
  "aliases" : [ "CVE-2022-24742" ],
  "summary" : "Sensitive Information Exposure in Sylius",
  "details" : "### Impact\nAny other user can view the data if the browser tab remains open after logging out. Once someone logs out and leaves the browser open, the potential attacker may use the back button to see the content exposed on given screens. No action may be performed though, and any website refresh will block further reads. It may, however, lead to a data leak, like for example customer details, payment gateway configuration, etc.- but only if these were pages checked by the administrator. \n\nThis vulnerability requires full access to the computer to take advantage of it.\n\n### Patches\nThe issue is fixed in versions: 1.9.10, 1.10.11, 1.11.2 and above.\n\n### Workarounds\nThe application must strictly redirect to the login page even when the browser back button is pressed. Another possibility is to set more strict cache policies for restricted content (like no-store). It can be achieved with the following class:\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace App\\EventListener;\n\nuse App\\SectionResolver\\ShopCustomerAccountSubSection;\nuse Sylius\\Bundle\\AdminBundle\\SectionResolver\\AdminSection;\nuse Sylius\\Bundle\\CoreBundle\\SectionResolver\\SectionProviderInterface;\nuse Symfony\\Component\\EventDispatcher\\EventSubscriberInterface;\nuse Symfony\\Component\\HttpKernel\\Event\\ResponseEvent;\nuse Symfony\\Component\\HttpKernel\\KernelEvents;\n\nfinal class CacheControlSubscriber implements EventSubscriberInterface\n{\n    /** @var SectionProviderInterface */\n    private $sectionProvider;\n\n    public function __construct(SectionProviderInterface $sectionProvider)\n    {\n        $this->sectionProvider = $sectionProvider;\n    }\n\n    public static function getSubscribedEvents(): array\n    {\n        return [\n            KernelEvents::RESPONSE => 'setCacheControlDirectives',\n        ];\n    }\n\n    public function setCacheControlDirectives(ResponseEvent $event): void\n    {\n        if (\n            !$this->sectionProvider->getSection() instanceof AdminSection &&\n            !$this->sectionProvider->getSection() instanceof ShopCustomerAccountSubSection\n        ) {\n            return;\n        }\n\n        $response = $event->getResponse();\n\n        $response->headers->addCacheControlDirective('no-cache', true);\n        $response->headers->addCacheControlDirective('max-age', '0');\n        $response->headers->addCacheControlDirective('must-revalidate', true);\n        $response->headers->addCacheControlDirective('no-store', true);\n    }\n}\n```\n\nAfter that register service in the container:\n\n```yaml\nservices:\n    App\\EventListener\\CacheControlSubscriber:\n        arguments: ['@sylius.section_resolver.uri_based_section_resolver']\n        tags:\n            - { name: kernel.event_subscriber, event: kernel.response }\n```\n\nThe code above requires changes in `ShopUriBasedSectionResolver` in order to work. To backport mentioned logic, you need to replace the `Sylius\\Bundle\\ShopBundle\\SectionResolver\\ShopUriBasedSectionResolver` class with:\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace App\\SectionResolver;\n\nuse Sylius\\Bundle\\CoreBundle\\SectionResolver\\SectionInterface;\nuse Sylius\\Bundle\\CoreBundle\\SectionResolver\\UriBasedSectionResolverInterface;\nuse Sylius\\Bundle\\ShopBundle\\SectionResolver\\ShopSection;\n\nfinal class ShopUriBasedSectionResolver implements UriBasedSectionResolverInterface\n{\n    /** @var string */\n    private $shopCustomerAccountUri;\n\n    public function __construct(string $shopCustomerAccountUri = 'account')\n    {\n        $this->shopCustomerAccountUri = $shopCustomerAccountUri;\n    }\n\n    public function getSection(string $uri): SectionInterface\n    {\n        if (str_contains($uri, $this->shopCustomerAccountUri)) {\n            return new ShopCustomerAccountSubSection();\n        }\n\n        return new ShopSection();\n    }\n}\n```\n\n```yaml\nservices:\n    sylius.section_resolver.shop_uri_based_section_resolver:\n        class: App\\SectionResolver\\ShopUriBasedSectionResolver\n        tags:\n            - { name: sylius.uri_based_section_resolver, priority: -10 }\n```\n\nYou also need to define a new subsection for the Customer Account that is used in the above services:\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace App\\SectionResolver;\n\nuse Sylius\\Bundle\\ShopBundle\\SectionResolver\\ShopSection;\n\nclass ShopCustomerAccountSubSection extends ShopSection\n{\n}\n```\n\n### References\n* Originally published at https://huntr.dev/\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\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.10"
      }, {
        "fixed" : "1.10.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.11"
      }, {
        "fixed" : "1.11.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Sylius/Sylius/security/advisories/GHSA-7563-75j9-6h5p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24742"
  }, {
    "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"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Sylius/Sylius/releases/tag/v1.9.10"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-213", "CWE-668" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-14T22:26:58Z",
    "nvd_published_at" : "2022-03-14T20:15:00Z"
  }
}