CVE-2024-29376: Sylius/sylius Sylius Has Potential Cross Site Vulnerability

MODERATE
Advisory Identifier: GHSA-7prj-9ccr-hr3q
CWE-79
Published
Advisory Summary

CVE-2024-29376 is a MODERATE sylius has potential cross site vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Sylius/sylius libraries in the Packagist ecosystem. The issue involves sylius has potential cross site scripting vulnerability via the "province" field in the checkout and address book. Remediation is available by upgrading affected packages to version 1.9.12, 1.10.16, 1.11.17, 1.12.16, 1.13.1.

CVE-2024-29376 at a Glance

CVE Identifier CVE-2024-29376
GHSA Identifier GHSA-7prj-9ccr-hr3q
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Sylius/sylius
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2024-29376

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.12
Upgrade sylius/sylius to 1.9.12
sylius/sylius fixed: 1.10.16
Upgrade sylius/sylius to 1.10.16
sylius/sylius fixed: 1.11.17
Upgrade sylius/sylius to 1.11.17
sylius/sylius fixed: 1.12.16
Upgrade sylius/sylius to 1.12.16
sylius/sylius fixed: 1.13.1
Upgrade sylius/sylius to 1.13.1
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-2024-29376, 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.12), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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 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.9.12, 1.10.16, 1.11.17, 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="sylius_address_province"', `name="${provinceSelectFieldName}"${provinceSelectValue}`) .replace('id="sylius_address_province"', `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="sylius_address_province"', `name="${provinceInputFieldName}"${provinceInputValue}`) .replace('id="sylius_address_province"', `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. If you're using Gulp, update your `gulpfile.babel.js`: ```diff import chug from 'gulp-chug'; + import concat from 'gulp-concat'; import gulp from 'gulp'; import yargs from 'yargs'; const { argv } = ... + const rootPath = argv.rootPath || 'public/assets'; + const config = [...]; '--rootPath', argv.rootPath || '../../../../../../../public/assets', '--nodeModulesPath', argv.nodeModulesPath || '../../../../../../../node_modules', ]; ... export const buildShop = ... + export const patchShopJs = function patchShopJs() { + return gulp.src([ + `${rootPath}/shop/js/app.js`, + 'assets/shop/sylius-province-field.js', + ]) + .pipe(concat('app.js')) + .pipe(gulp.dest(`${rootPath}/shop/js`)); + }; + patchShopJs.description = 'Append shop security patches to built app.js.'; ... - export const build = gulp.parallel(buildAdmin, buildShop); + export const build = gulp.series( + gulp.parallel(buildAdmin, buildShop), + patchShopJs, + ); ... - gulp.task('shop', buildShop); + gulp.task('shop', gulp.series(buildShop, patchShopJs)); ... ``` 4. 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](https://github.com/Sylius/Sylius/issues) * Email us at security@sylius.com

CVE-2024-29376 Affected Sylius/sylius Versions

5 component(s)
Fixed Versions:
1.9.121.10.161.11.171.12.161.13.1
Product / Package Ecosystem Affected Versions Fixed Version
sylius/sylius
Packagist
< 1.9.12
1.9.12
sylius/sylius
Packagist
≥ 1.10.0-alpha.1
< 1.10.16
1.10.16
sylius/sylius
Packagist
≥ 1.11.0-alpha.1
< 1.11.17
1.11.17
sylius/sylius
Packagist
≥ 1.12.0-alpha.1
< 1.12.16
1.12.16
sylius/sylius
Packagist
≥ 1.13.0-alpha.1
< 1.13.1
1.13.1

References

Frequently Asked Questions

What is CVE-2024-29376?
CVE-2024-29376 is a security vulnerability in Sylius/sylius involving Sylius has potential Cross Site Scripting vulnerability via the "Province" field in the Checkout and Address Book under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Sylius/sylius versions are affected?
Affected versions include releases prior to 1.9.12, 1.10.16, 1.11.17, 1.12.16, 1.13.1 across affected packages: sylius/sylius.
What version fixes CVE-2024-29376?
Upgrading to 1.9.12, 1.10.16, 1.11.17, 1.12.16, 1.13.1 (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.12, 1.10.16, 1.11.17, 1.12.16, 1.13.1. Upgrade your dependency to 1.9.12, 1.10.16, 1.11.17, 1.12.16, 1.13.1 or later.
What CWE is associated with CVE-2024-29376?
CVE-2024-29376 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2024-29376?
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-7prj-9ccr-hr3q",
  "modified" : "2026-03-09T15:57:32Z",
  "published" : "2024-05-10T15:33:22Z",
  "aliases" : [ "CVE-2024-29376" ],
  "summary" : "Sylius has potential Cross Site Scripting vulnerability via the \"Province\" field in the Checkout and Address Book",
  "details" : "### Impact\n\nThere 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.\n\n### Patches\nThe issue is fixed in versions: 1.9.12, 1.10.16, 1.11.17, 1.12.16, 1.13.1 and above.\n\n### Workarounds\n\n1. Create new file `assets/shop/sylius-province-field.js`:\n\n```js\n// assets/shop/sylius-province-field.js\n\nfunction sanitizeInput(input) {\n  const div = document.createElement('div');\n  div.textContent = input;\n  return div.innerHTML; // Converts text content to plain HTML, stripping any scripts\n}\n\nconst getProvinceInputValue = function getProvinceInputValue(valueSelector) {\n  return valueSelector == undefined ? '' : `value=\"${sanitizeInput(valueSelector)}\"`;\n};\n\n$.fn.extend({\n  provinceField() {\n    const countrySelect = $('select[name$=\"[countryCode]\"]');\n\n    countrySelect.on('change', (event) => {\n      const select = $(event.currentTarget);\n      const provinceContainer = select.parents('.field').next('div.province-container');\n\n      const provinceSelectFieldName = select.attr('name').replace('country', 'province');\n      const provinceInputFieldName = select.attr('name').replace('countryCode', 'provinceName');\n\n      const provinceSelectFieldId = select.attr('id').replace('country', 'province');\n      const provinceInputFieldId = select.attr('id').replace('countryCode', 'provinceName');\n\n      const form = select.parents('form');\n\n      if (select.val() === '' || select.val() == undefined) {\n        provinceContainer.fadeOut('slow', () => {\n          provinceContainer.html('');\n        });\n\n        return;\n      }\n\n      provinceContainer.attr('data-loading', true);\n      form.addClass('loading');\n\n      $.get(provinceContainer.attr('data-url'), { countryCode: select.val() }, (response) => {\n        if (!response.content) {\n          provinceContainer.fadeOut('slow', () => {\n            provinceContainer.html('');\n\n            provinceContainer.removeAttr('data-loading');\n            form.removeClass('loading');\n          });\n        } else if (response.content.indexOf('select') !== -1) {\n          provinceContainer.fadeOut('slow', () => {\n            const provinceSelectValue = getProvinceInputValue((\n              $(provinceContainer).find('select > option[selected$=\"selected\"]').val()\n            ));\n\n            provinceContainer.html((\n              response.content\n                .replace('name=\"sylius_address_province\"', `name=\"${provinceSelectFieldName}\"${provinceSelectValue}`)\n                .replace('id=\"sylius_address_province\"', `id=\"${provinceSelectFieldId}\"`)\n                .replace('option value=\"\" selected=\"selected\"', 'option value=\"\"')\n                .replace(`option ${provinceSelectValue}`, `option ${provinceSelectValue}\" selected=\"selected\"`)\n            ));\n            provinceContainer.addClass('required');\n            provinceContainer.removeAttr('data-loading');\n\n            provinceContainer.fadeIn('fast', () => {\n              form.removeClass('loading');\n            });\n          });\n        } else {\n          provinceContainer.fadeOut('slow', () => {\n            const provinceInputValue = getProvinceInputValue($(provinceContainer).find('input').val());\n\n            provinceContainer.html((\n              response.content\n                .replace('name=\"sylius_address_province\"', `name=\"${provinceInputFieldName}\"${provinceInputValue}`)\n                .replace('id=\"sylius_address_province\"', `id=\"${provinceInputFieldId}\"`)\n            ));\n\n            provinceContainer.removeAttr('data-loading');\n\n            provinceContainer.fadeIn('fast', () => {\n              form.removeClass('loading');\n            });\n          });\n        }\n      });\n    });\n\n    if (countrySelect.val() !== '') {\n      countrySelect.trigger('change');\n    }\n\n    if ($.trim($('div.province-container').text()) === '') {\n      $('select.country-select').trigger('change');\n    }\n\n    const shippingAddressCheckbox = $('input[type=\"checkbox\"][name$=\"[differentShippingAddress]\"]');\n    const shippingAddressContainer = $('#sylius-shipping-address-container');\n    const toggleShippingAddress = function toggleShippingAddress() {\n      shippingAddressContainer.toggle(shippingAddressCheckbox.prop('checked'));\n    };\n    toggleShippingAddress();\n    shippingAddressCheckbox.on('change', toggleShippingAddress);\n  },\n});\n```\n\n2. Add new import in `assets/shop/entry.js`:\n\n```js\n// assets/shop/entry.js\n// ...\nimport './sylius-province-field';\n```\n\n3. If you're using Gulp, update your `gulpfile.babel.js`:\n\n```diff\n  import chug from 'gulp-chug';\n+ import concat from 'gulp-concat';\n  import gulp from 'gulp';\n  import yargs from 'yargs';\n\n  const { argv } = ...\n\n+ const rootPath = argv.rootPath || 'public/assets';\n+ \n  const config = [...];\n    '--rootPath',\n    argv.rootPath || '../../../../../../../public/assets',\n    '--nodeModulesPath',\n    argv.nodeModulesPath || '../../../../../../../node_modules',\n  ];\n\n  ...\n\n  export const buildShop = ...\n\n+ export const patchShopJs = function patchShopJs() {\n+   return gulp.src([\n+     `${rootPath}/shop/js/app.js`,\n+     'assets/shop/sylius-province-field.js',\n+   ])\n+     .pipe(concat('app.js'))\n+     .pipe(gulp.dest(`${rootPath}/shop/js`));\n+ };\n+ patchShopJs.description = 'Append shop security patches to built app.js.';\n\n ...\n\n- export const build = gulp.parallel(buildAdmin, buildShop);\n+ export const build = gulp.series(\n+   gulp.parallel(buildAdmin, buildShop),\n+   patchShopJs,\n+ );\n\n ...\n\n- gulp.task('shop', buildShop);\n+ gulp.task('shop', gulp.series(buildShop, patchShopJs));\n\n  ...\n```\n\n4. Rebuild your assets:\n\n```bash\nyarn build\n``` \n\n### Acknowledgements\n\nThis security issue has been reported by @r2tunes, thank you!\n\n### References\n\n- The original advisory: https://github.com/advisories/GHSA-mw82-6m2g-qh6c\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",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.10.0-alpha.1"
      }, {
        "fixed" : "1.10.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.11.0-alpha.1"
      }, {
        "fixed" : "1.11.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.12.0-alpha.1"
      }, {
        "fixed" : "1.12.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "sylius/sylius"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.13.0-alpha.1"
      }, {
        "fixed" : "1.13.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Sylius/Sylius/security/advisories/GHSA-7prj-9ccr-hr3q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-29376"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Sylius/Sylius/commit/fb0ecb275747e364f1d4744ed8605c57f9bd8a80"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Sylius/Sylius"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/r2tunes/Reports/blob/main/Sylius.md"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-10T15:33:22Z",
    "nvd_published_at" : null
  }
}