GHSA-v33j-v3x4-42qg Regex literal in Hurl files are not escaped when exported to HTML, allowing injections

Not scored Published

Hurl CLI fails to escape regex literals in HTML exports, allowing attackers to inject malicious scripts that execute when the generated HTML is viewed.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is GHSA-v33j-v3x4-42qg?

GHSA-v33j-v3x4-42qg is a cross-site scripting vulnerability in hurl, published on 11 Jun 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Given this Hurl file:

regex.hurl:

GET https://foo.com
HTTP 200
[Asserts]
jsonpath "$.body" matches /<img src="" onerror="alert('Hi!')">/

When exported to HTML:

$ hurlfmt --out html regex.hurl
<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>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<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>
</span></span><span class="line"></span>
</code></pre>

The regex literal /<img src="" onerror="alert('Hi!')">/ is not escaped:

<span class="regex">/<img src="" onerror="alert('Hi!')">/</span></span>

When opened in a browser, the code is run without user interaction:

regex

Which versions are affected by GHSA-v33j-v3x4-42qg?

2 open source packages ship an affected version, including hurl.

PackageAffectedFixed in
hurl crates.ioAll versions7.0.0
hurl crates.ioAll versions7.0.0

How do I fix GHSA-v33j-v3x4-42qg?

Upgrade hurl to 7.0.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is GHSA-v33j-v3x4-42qg being exploited?

There is no known exploitation of GHSA-v33j-v3x4-42qg in the wild and no public exploit code.

Sources

Is GHSA-v33j-v3x4-42qg in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free