Loading HuntDB...

GHSA-4jp3-q2qm-9fmw

GitHub Security Advisory

Improper Restriction of Rendered UI Layers or Frames in Sylius

✓ GitHub Reviewed MODERATE Has CVE

Advisory Details

### Impact

It is possible for a page controlled by an attacker to load the website within an iframe. This will enable a clickjacking attack, in which the attacker's page overlays the target application's interface with a different interface provided by the attacker

### Patches

The issue is fixed in versions: 1.9.10, 1.10.11, 1.11.2, and above.

### Workarounds

Every response from app should have an X-Frame-Options header set to: ``sameorigin``. To achieve that you just need to add a new **subscriber** in your app.

```php
<?php

// src/EventListener/XFrameOptionsSubscriber.php

namespace App\EventListener

final class XFrameOptionsSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
KernelEvents::RESPONSE => 'onKernelResponse',
];
}

public function onKernelResponse(ResponseEvent $event): void
{
if (!$this->isMainRequest($event)) {
return;
}

$response = $event->getResponse();

$response->headers->set('X-Frame-Options', 'sameorigin');
}

private function isMainRequest(ResponseEvent $event): bool
{
if (\method_exists($event, 'isMainRequest')) {
return $event->isMainRequest();
}

return $event->isMasterRequest();
}
}

```

And register it in the container:

```yaml
# config/services.yaml
services:
# ...
App\EventListener\XFrameOptionsSubscriber:
tags: ['kernel.event_subscriber']
```

### 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 [[email protected]](mailto:[email protected])

Affected Packages

Packagist sylius/sylius
Affected versions: 0 (fixed in 1.9.10)
Packagist sylius/sylius
Affected versions: 1.10.0 (fixed in 1.10.11)
Packagist sylius/sylius
Affected versions: 1.11.0 (fixed in 1.11.2)

Related CVEs

Key Information

GHSA ID
GHSA-4jp3-q2qm-9fmw
Published
March 14, 2022 9:55 PM
Last Modified
March 28, 2022 10:31 PM
CVSS Score
5.0 /10
Primary Ecosystem
Packagist
Primary Package
sylius/sylius
GitHub Reviewed
✓ Yes

Dataset

Last updated: July 12, 2025 6:29 AM

Data from GitHub Advisory Database. This information is provided for research and educational purposes.