CVE-2024-29376: XSS

Published Apr 22, 2024
·
Updated

Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-7prj-9ccr-hr3q. This link is maintained to preserve external references.

Original Description Sylius 1.12.13 is vulnerable to Cross Site Scripting (XSS) via the "Province" field in Address Book.

Other sources

Impact

There is a possibility to save XSS code in province field in the Checkout and Address Book and then execute it on these pages. The problem occurs when you open the address step page in the checkout or edit the address in the address book. This only affects the base UI Shop provided by Sylius.

Patches The issue is fixed in versions: 1.12.16, 1.13.1 and above.

Workarounds

1. Create new file assets/shop/sylius-province-field.js:

js // assets/shop/sylius-province-field.js

function sanitizeInput(input) { const div = document.createElement('div'); div.textContent = input; return div.innerHTML; // Converts text content to plain HTML, stripping any scripts }

const getProvinceInputValue = function getProvinceInputValue(valueSelector) { return valueSelector == undefined ? '' : value="${sanitizeInput(valueSelector)}"; };

$.fn.extend({ provinceField() { const countrySelect = $('select[name$="[countryCode]"]');

countrySelect.on('change', (event) => { const select = $(event.currentTarget); const provinceContainer = select.parents('.field').next('div.province-container');

const provinceSelectFieldName = select.attr('name').replace('country', 'province'); const provinceInputFieldName = select.attr('name').replace('countryCode', 'provinceName');

const provinceSelectFieldId = select.attr('id').replace('country', 'province'); const provinceInputFieldId = select.attr('id').replace('countryCode', 'provinceName');

const form = select.parents('form');

if (select.val() === '' || select.val() == undefined) { provinceContainer.fadeOut('slow', () => { provinceContainer.html(''); });

return; }

provinceContainer.attr('data-loading', true); form.addClass('loading');

$.get(provinceContainer.attr('data-url'), { countryCode: select.val() }, (response) => { if (!response.content) { provinceContainer.fadeOut('slow', () => { provinceContainer.html('');

provinceContainer.removeAttr('data-loading'); form.removeClass('loading'); }); } else if (response.content.indexOf('select') !== -1) { provinceContainer.fadeOut('slow', () => { const provinceSelectValue = getProvinceInputValue(( $(provinceContainer).find('select > option[selected$="selected"]').val() ));

provinceContainer.html(( response.content .replace('name="syliusaddressprovince"', name="${provinceSelectFieldName}"${provinceSelectValue}) .replace('id="syliusaddressprovince"', id="${provinceSelectFieldId}") .replace('option value="" selected="selected"', 'option value=""') .replace(option ${provinceSelectValue}, option ${provinceSelectValue}" selected="selected") )); provinceContainer.addClass('required'); provinceContainer.removeAttr('data-loading');

provinceContainer.fadeIn('fast', () => { form.removeClass('loading'); }); }); } else { provinceContainer.fadeOut('slow', () => { const provinceInputValue = getProvinceInputValue($(provinceContainer).find('input').val());

provinceContainer.html(( response.content .replace('name="syliusaddressprovince"', name="${provinceInputFieldName}"${provinceInputValue}) .replace('id="syliusaddressprovince"', id="${provinceInputFieldId}") ));

provinceContainer.removeAttr('data-loading');

provinceContainer.fadeIn('fast', () => { form.removeClass('loading'); }); }); } }); });

if (countrySelect.val() !== '') { countrySelect.trigger('change'); }

if ($.trim($('div.province-container').text()) === '') { $('select.country-select').trigger('change'); }

const shippingAddressCheckbox = $('input[type="checkbox"][name$="[differentShippingAddress]"]'); const shippingAddressContainer = $('#sylius-shipping-address-container'); const toggleShippingAddress = function toggleShippingAddress() { shippingAddressContainer.toggle(shippingAddressCheckbox.prop('checked')); }; toggleShippingAddress(); shippingAddressCheckbox.on('change', toggleShippingAddress); }, });

2. Add new import in assets/shop/entry.js:

js // assets/shop/entry.js // ... import './sylius-province-field';

3. Rebuild your assets:

bash yarn build

Acknowledgements

This security issue has been reported by @r2tunes, thank you!

References

- The original advisory: https://github.com/advisories/GHSA-mw82-6m2g-qh6c

For more information If you have any questions or comments about this advisory: Open an issue in Sylius issues Email us at security@sylius.com

— GitHub

Affected Software

4 affected componentsFixes available
composer/sylius/sylius>=1.13.0-alpha.1<1.13.1
1.13.1
composer/sylius/sylius>=1.12.0-alpha.1<1.12.16
1.12.16
composer/sylius/sylius<=1.12.13
Sylius Sylius=1.12.13

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/sylius/sylius to a version that resolves this vulnerability.

    Fixed in 1.13.1
  2. Upgrade

    Upgrade composer/sylius/sylius to a version that resolves this vulnerability.

    Fixed in 1.12.16
  3. Upgrade

    Upgrade sylius/sylius to a version that resolves this vulnerability.

    Fixed in 1.12.16
  4. Upgrade

    Upgrade sylius/sylius to a version that resolves this vulnerability.

    Fixed in 1.13.1
  5. Operational

    Rebuild the Sylius assets by running `yarn build`.

Event History

Apr 22, 2024
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·07:15 PM
Description
Data Sourced
via NVD·07:15 PM
SeverityWeaknessAffected Software
Advisory Published
via GitHub·09:31 PM
May 10, 2024
Withdrawn
via GitHub·03:31 PM

Frequently Asked Questions

1

What is the severity of CVE-2024-29376?

CVE-2024-29376 is classified as a Cross Site Scripting (XSS) vulnerability.

2

How do I fix CVE-2024-29376?

To fix CVE-2024-29376, upgrade Sylius to version 1.12.16 or 1.13.1.

3

Which versions of Sylius are affected by CVE-2024-29376?

Sylius versions up to 1.12.13 are affected by CVE-2024-29376.

4

What component of Sylius is vulnerable in CVE-2024-29376?

The vulnerability in CVE-2024-29376 affects the "Province" field in the Address Book.

5

Is CVE-2024-29376 a duplicate vulnerability?

Yes, CVE-2024-29376 has been withdrawn as it is a duplicate of GHSA-7prj-9ccr-hr3q.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203