{"id":"CVE-2024-37297","aliases":["EUVD-2024-2028","GHSA-cv23-q6gh-xfrf"],"status":"published","title":"WooCommerce has a Cross-Site Scripting Vulnerability in checkout \u0026 registration forms","description":"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 \u0026 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 \u0026 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.","severity":{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00483,"percentile":0.42127,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79","CWE-80"],"published":"2024-06-12T15:05:46Z","modified":"2026-11-11T10:30:50Z","fixes":[{"ecosystem":"Packagist","package":"woocommerce/woocommerce","fixed_in":["8.8.5","8.9.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"woocommerce/woocommerce","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"8.8.0"},{"fixed":"8.8.5"}]}]},{"source":"ghsa","ecosystem":"Packagist","package":"woocommerce/woocommerce","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"8.9.0"},{"fixed":"8.9.3"}]}]},{"source":"osv","ecosystem":"Packagist","package":"woocommerce/woocommerce","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"8.8.0"},{"fixed":"8.8.5"}]}]},{"source":"osv","ecosystem":"Packagist","package":"woocommerce/woocommerce","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"8.9.0"},{"fixed":"8.9.3"}]}]}],"products":[{"vendor":"automattic","product":"woocommerce"},{"vendor":"woocommerce","product":"woocommerce"}],"references":[{"url":"https://github.com/woocommerce/woocommerce/security/advisories/GHSA-cv23-q6gh-xfrf","tags":["x_refsource_CONFIRM","x_transferred","Patch","advisory","web"]},{"url":"https://github.com/woocommerce/woocommerce/commit/0e9888305d0cb9557e58f558526ab11cb3bcc4b4","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/woocommerce/woocommerce/commit/915e32a42762916b745a7e663c8b69a698da8b67","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://developer.woocommerce.com/2024/06/10/developer-advisory-xss-vulnerability-8-8-0","tags":["x_refsource_MISC","x_transferred","Press/Media Coverage","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-37297","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-cv23-q6gh-xfrf"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/37xxx/CVE-2024-37297.json","tags":["advisory"]},{"url":"https://github.com/woocommerce/woocommerce","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-37297","title":"WooCommerce has a Cross-Site Scripting Vulnerability in checkout \u0026 registration forms","description":"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 \u0026 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 \u0026 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.","status":"published","published":"2024-06-12T15:05:46.468Z","modified":"2024-08-02T03:50:56.092Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-79","CWE-80"],"updated_at":"2026-11-02T14:34:00.585327Z"}],"euvd":[{"id":"EUVD-2024-2028","description":"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 \u0026 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 \u0026 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.","status":"published","published":"2024-06-12T15:05:46Z","modified":"2024-08-02T03:50:56Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-03T03:50:19.46851Z"}],"ghsa":[{"id":"GHSA-cv23-q6gh-xfrf","title":"WooCommerce has a Cross-Site Scripting (XSS) Vulnerability in checkout \u0026 registration forms","description":"### Impact\nA vulnerability introduced in WooCommerce 8.8 allows for cross-site scripting. A bad actor can manipulate a link to include malicious HTML \u0026 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 \u0026 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 += `\u003cinput type=\"hidden\" name=\"${params.prefix}${fieldName}\" value=\"${value}\"/\u003e`;\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 \u0026\u0026 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/\n","status":"published","published":"2024-06-12T19:40:16Z","modified":"2024-07-24T15:10:14Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79","CWE-80"],"updated_at":"2026-11-02T14:37:56.530214Z"}],"nvd":[{"id":"CVE-2024-37297","description":"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 \u0026 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 \u0026 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.","status":"published","published":"2024-06-12T15:15:52.677Z","modified":"2026-06-17T07:38:05.597Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79","CWE-80"],"updated_at":"2026-11-02T14:10:04.804473Z"}],"osv":[{"id":"CVE-2024-37297","title":"WooCommerce has a Cross-Site Scripting Vulnerability in checkout \u0026 registration forms","description":"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 \u0026 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 \u0026 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.","status":"published","published":"2024-06-12T15:05:46.468Z","modified":"2026-11-11T10:30:50.279690351Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79","CWE-80"],"updated_at":"2026-11-11T11:06:29.137385Z"},{"id":"GHSA-cv23-q6gh-xfrf","title":"WooCommerce has a Cross-Site Scripting (XSS) Vulnerability in checkout \u0026 registration forms","description":"### Impact\nA vulnerability introduced in WooCommerce 8.8 allows for cross-site scripting. A bad actor can manipulate a link to include malicious HTML \u0026 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 \u0026 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 += `\u003cinput type=\"hidden\" name=\"${params.prefix}${fieldName}\" value=\"${value}\"/\u003e`;\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 \u0026\u0026 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/\n","status":"published","published":"2024-06-12T19:40:16Z","modified":"2026-09-10T03:50:15.338605138Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-79","CWE-80"],"updated_at":"2026-11-02T15:46:45.639885Z"}]}}
