{"id":"GHSA-v33j-v3x4-42qg","aliases":["GHSA-v33j-v3x4-42qg"],"related":[],"kind":"vulnerability","state":"published","title":"Regex literal in Hurl files are not escaped when exported to HTML, allowing injections","summary":"Given this Hurl file:\n\nregex.hurl:\n\n```\nGET https://foo.com\nHTTP 200\n[Asserts]\njsonpath \"$.body\" matches /<img src=\"\" onerror=\"alert('Hi!')\">/\n```\n\nWhen exported to HTML:\n\n```\n$ hurlfmt --out html regex.hurl\n<pre><code class=\"language-hurl\"><span class=\"hurl-entry\"><span class=\"request\"><span class=\"line\"><span class=\"method\">GET</span> <span class=\"url\">https://foo.com</span></span>\n</span><span class=\"response\"><span class=\"line\"><span class=\"version\">HTTP</span> <span class=\"number\">200</span></span>\n<span class=\"line\"><span class=\"section-header\">[Asserts]</span></span>\n<span class=\"line\"><span class=\"query-type\">jsonpath</span> <span class=\"string\">\"$.body\"</span> <span class=\"predicate-type\">matches</span> <span class=\"regex\">/<img src=\"\" onerror=\"alert('Hi!')\">/</span></span>\n</span></span><span class=\"line\"></span>\n</code></pre>\n```\n\nThe regex literal `/<img src=\"\" onerror=\"alert('Hi!')\">/` is not escaped:\n\n`<span class=\"regex\">/<img src=\"\" onerror=\"alert('Hi!')\">/</span></span>`\n\nWhen opened in a browser, the code is run without user interaction:\n\n![regex](https://github.com/user-attachments/assets/9c20a2ff-900f-4420-b38b-1e7648749119)","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"Given this Hurl file:\n\nregex.hurl:\n\n```\nGET https://foo.com\nHTTP 200\n[Asserts]\njsonpath \"$.body\" matches /<img src=\"\" onerror=\"alert('Hi!')\">/\n```\n\nWhen exported to HTML:\n\n```\n$ hurlfmt --out html regex.hurl\n<pre><code class=\"language-hurl\"><span class=\"hurl-entry\"><span class=\"request\"><span class=\"line\"><span class=\"method\">GET</span> <span class=\"url\">https://foo.com</span></span>\n</span><span class=\"response\"><span class=\"line\"><span class=\"version\">HTTP</span> <span class=\"number\">200</span></span>\n<span class=\"line\"><span class=\"section-header\">[Asserts]</span></span>\n<span class=\"line\"><span class=\"query-type\">jsonpath</span> <span class=\"string\">\"$.body\"</span> <span class=\"predicate-type\">matches</span> <span class=\"regex\">/<img src=\"\" onerror=\"alert('Hi!')\">/</span></span>\n</span></span><span class=\"line\"></span>\n</code></pre>\n```\n\nThe regex literal `/<img src=\"\" onerror=\"alert('Hi!')\">/` is not escaped:\n\n`<span class=\"regex\">/<img src=\"\" onerror=\"alert('Hi!')\">/</span></span>`\n\nWhen opened in a browser, the code is run without user interaction:\n\n![regex](https://github.com/user-attachments/assets/9c20a2ff-900f-4420-b38b-1e7648749119)","format":"markdown","source":"ghsa"}],"published":"2025-06-11T14:46:37.000Z","modified":"2025-06-11T14:46:37.000Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"7.0.0"}],"ecosystem":"crates.io","package":"hurl","purl":"pkg:cargo/hurl","source":"ghsa"}],"references":[{"url":"https://github.com/Orange-OpenSource/hurl/security/advisories/GHSA-v33j-v3x4-42qg","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/Orange-OpenSource/hurl/commit/248ac41cfa1797c52241c6ef756490d90027cdf2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/Orange-OpenSource/hurl/commit/7dcdbd1796785392b1e829d1f07c6687b9a8f27d","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/Orange-OpenSource/hurl","tags":["package"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-v33j-v3x4-42qg","url":"https://github.com/advisories/GHSA-v33j-v3x4-42qg","licence":"CC-BY-4.0","modified":"2025-06-11T14:46:37.000Z"}],"updatedAt":"2026-11-25T22:56:42.794Z"}