{"id":"CVE-2024-37297","aliases":["CVE-2024-37297","GHSA-cv23-q6gh-xfrf"],"related":[],"kind":"vulnerability","state":"published","title":"WooCommerce has a Cross-Site Scripting Vulnerability in checkout & registration forms","summary":"WooCommerce is an open-source e-commerce platform built on WordPress. A vulnerability introduced in WooCommerce 8.8 allows for cross-site scripting. A bad actor can manipulate a link to include malicious HTML & JavaScript content. While the content is not saved to the database, the links may be sent to victims for malicious purposes. The injected JavaScript could hijack content & data stored in the browser, including the session. The URL content is read through the `Sourcebuster.js` library and then inserted without proper sanitization to the classic checkout and registration forms. Versions 8.8.5 and 8.9.3 contain a patch for the issue. As a workaround, one may disable the Order Attribution feature.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"WooCommerce is an open-source e-commerce platform built on WordPress. A vulnerability introduced in WooCommerce 8.8 allows for cross-site scripting. A bad actor can manipulate a link to include malicious HTML & JavaScript content. While the content is not saved to the database, the links may be sent to victims for malicious purposes. The injected JavaScript could hijack content & data stored in the browser, including the session. The URL content is read through the `Sourcebuster.js` library and then inserted without proper sanitization to the classic checkout and registration forms. Versions 8.8.5 and 8.9.3 contain a patch for the issue. As a workaround, one may disable the Order Attribution feature.","source":"cvelist"},{"lang":"en","text":"### Impact\nA vulnerability introduced in WooCommerce 8.8 allows for cross-site scripting. A bad actor can manipulate a link to include malicious HTML & JavaScript content. While the content is not saved to the database, the links may be sent to victims for malicious purposes. The injected JavaScript could hijack content & data stored in the browser, including the session.\nThe URL content is read through the Sourcebuster.js library and then inserted without proper sanitization to the classic checkout and registration forms.\n\n### Patches\n```diff\ndiff --git a/plugins/woocommerce/client/legacy/js/frontend/order-attribution.js b/plugins/woocommerce/client/legacy/js/frontend/order-attribution.js\nindex 79411e928e1..25eaa721c54 100644\n--- a/plugins/woocommerce/client/legacy/js/frontend/order-attribution.js\n+++ b/plugins/woocommerce/client/legacy/js/frontend/order-attribution.js\n@@ -155,12 +155,16 @@\n \t\t * but it's not yet supported in Safari.\n \t\t */\n \t\tconnectedCallback() {\n-\t\t\tlet inputs = '';\n+\t\t\tthis.innerHTML = '';\n+\t\t\tconst inputs = new DocumentFragment();\n \t\t\tfor( const fieldName of this._fieldNames ) {\n-\t\t\t\tconst value = stringifyFalsyInputValue( this.values[ fieldName ] );\n-\t\t\t\tinputs += `<input type=\"hidden\" name=\"${params.prefix}${fieldName}\" value=\"${value}\"/>`;\n+\t\t\t\tconst input = document.createElement( 'input' );\n+\t\t\t\tinput.type = 'hidden';\n+\t\t\t\tinput.name = `${params.prefix}${fieldName}`;\n+\t\t\t\tinput.value = stringifyFalsyInputValue( ( this.values && this.values[ fieldName ] ) || '' );\n+\t\t\t\tinputs.appendChild( input );\n \t\t\t}\n-\t\t\tthis.innerHTML = inputs;\n+\t\t\tthis.appendChild( inputs );\n \t\t}\n \n \t\t/**\n```\n\n### Workarounds\nDisabling the Order Attribution feature \n\n### References\nA8C SIRT: p3btAN-2L2-p2 (internal)\nPublic disclosure: https://developer.woocommerce.com/2024/06/10/developer-advisory-xss-vulnerability-8-8-0/","format":"markdown","source":"ghsa"},{"lang":"es","text":"WooCommerce es una plataforma de comercio electrónico de código abierto construida sobre WordPress. Una vulnerabilidad introducida en WooCommerce 8.8 permite cross-site scripting. Un mal actor puede manipular un enlace para incluir contenido HTML y JavaScript malicioso. Si bien el contenido no se guarda en la base de datos, los enlaces pueden enviarse a las víctimas con fines maliciosos. El JavaScript inyectado podría secuestrar el contenido y los datos almacenados en el navegador, incluida la sesión. El contenido de la URL se lee a través de la librería `Sourcebuster.js` y luego se inserta sin la sanitización adecuada en los formularios clásicos de pago y registro. Las versiones 8.8.5 y 8.9.3 contienen un parche para el problema. Como workaround, se puede desactivar la función de atribución de pedidos.","source":"nvd"}],"published":"2024-06-12T15:05:46.468Z","modified":"2026-09-10T03:50:15.338Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79","CWE-80"],"affected":[{"ranges":[{"version":">= 8.8.0, < 8.8.5","status":"affected"},{"version":">= 8.9.0, < 8.9.3","status":"affected"}],"vendor":"woocommerce","product":"woocommerce","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"8.8.0","status":"affected","fixed":"8.8.5"}],"ecosystem":"Packagist","package":"woocommerce/woocommerce","purl":"pkg:composer/woocommerce/woocommerce","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"8.9.0","status":"affected","fixed":"8.9.3"}],"ecosystem":"Packagist","package":"woocommerce/woocommerce","purl":"pkg:composer/woocommerce/woocommerce","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"8.8","fixed":"8.8.5"},{"status":"affected","introduced":"8.9.0","fixed":"8.9.3"}],"vendor":"woocommerce","product":"woocommerce","cpe":"cpe:2.3:a:woocommerce:woocommerce:*:*:*:*:*:wordpress:*:*","source":"nvd"}],"references":[{"url":"https://github.com/woocommerce/woocommerce/security/advisories/GHSA-cv23-q6gh-xfrf","tags":["patch","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/woocommerce/woocommerce/commit/0e9888305d0cb9557e58f558526ab11cb3bcc4b4","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/woocommerce/woocommerce/commit/915e32a42762916b745a7e663c8b69a698da8b67","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://developer.woocommerce.com/2024/06/10/developer-advisory-xss-vulnerability-8-8-0","tags":["press/media-coverage","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-37297","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/woocommerce/woocommerce","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-06-13T19:59:12.949Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-37297","url":"https://www.cve.org/CVERecord?id=CVE-2024-37297","licence":"CVE Terms of Use","modified":"2024-08-02T03:50:56.092Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cv23-q6gh-xfrf","url":"https://github.com/advisories/GHSA-cv23-q6gh-xfrf","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:15.338Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-37297","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-37297","licence":"Public domain","modified":"2026-06-17T07:38:05.597Z"}],"updatedAt":"2026-11-25T22:58:41.748Z","epss":{"score":0.00483,"percentile":0.43244,"date":"2026-12-01T12:00:22.000Z"}}