Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
webmin-detach-xss — Webmin 2.670 - High 8.0 - Remote - Stored XSS - anonymous mail; detach.cgi serves unclosed script as text/html | Kitploit
Tools/GitHubGitHub/abraxas/webmin-detach-xss
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityLabs & Practice
GitHubabraxas/webmin-detach-xss

webmin-detach-xss

Webmin 2.670 - High 8.0 - Remote - Stored XSS - anonymous mail; detach.cgi serves unclosed script as text/html

View Repository
7 days agoNot yet reviewed
Share

Abraxas Labs - webmin-detach-xss

webmin-detach-xss

Webmin already treated SVG mail as a script problem. HTML attachments still go through a filter that only strips a <script> when the closing tag is sitting there too. A stranger who can send mail plants an unclosed script. The admin who clicks View loads it as text/html on the Webmin origin they are already logged into. The session cookie is HttpOnly, so document.cookie is empty. Same-origin requests still carry it.

Class: Stored XSS Reach: Remote (anonymous mail sender; victim opens View)

Webmin 2.670 (3a2b2b86) - Webmin

I planted a mailbox file, logged in as root, opened the message, and fetched the View URL. detach.cgi answered 200 text/html, no CSP, witness still in the body, no </script>. That is the leftover. Not CVE-2026-49102.

IDno CVE yet
ClassStored XSS
ReachRemote (anonymous mail sender; victim opens View)
CWECWE-79
CVSSHigh: 8.0 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
ProductWebmin
Affected2.670 tag 2.670 (3a2b2b8671c0669c129f5275b3dd1853106ae02b)
Authnone on Webmin. Attacker sends mail. Victim is a mailboxes user who clicks View
LicenseGNU Affero GPL v3.0
Labloopback 127.0.0.1:18410. Compose webminh07.

What an attacker can do

Needs a mailbox Webmin will read and one click on View. In ordinary words: the sender never logs into Webmin. The person who opens the attachment is running the sender's script as themselves on the admin site.

PrivilegeMethod / sinkRecon / integrity / availabilityLab-proven or inferred
Plant an unclosed <script> as a text/html attachmentmailbox file with Content-Disposition: attachmentIntegrity (stored markup)Lab-proven. /var/mail/root
Keep the part out of the sandboxed body iframefind_body skips Content-Disposition: attachmentReconLab-proven. Attachment table on view_mail.cgi
Serve that part as HTML on the Webmin originGET /mailboxes/detach.cgi/... View linkIntegrity (origin)Lab-proven. content-type=text/html
Keep the script after filter_javascriptunclosed <script> (no </script>)IntegrityLab-proven. script=1 close=0 witness=1
Skip CSP on that responsedetach.cgi never calls header()IntegrityLab-proven. csp=0
Act as the victim on same-origin Webmin CGIsbrowser script, sid cookie still sentIntegrity of whatever that session can touchInferred. Lab is HTTP, not a browser. Cookie is HttpOnly

Stays closed on this leftover

AxisMethod / sinkWhy it is closed
IntegritySVG attachmentCVE-2026-49102. Forced text/plain at detach.cgi:76-83
IntegrityHTML message bodyiframe sandbox without allow-scripts
Recondocument.cookiesid is HttpOnly by default
Integritysave=1 downloadContent-Disposition: Attachment; not the View link
IntegrityUnauthenticated detach.cgiminiserv session still required
IntegrityOverwrite on detachCVE-2026-49103. Different bug

The default CSP in header() would have allowed 'unsafe-inline' anyway. Calling header() is still the missing hook. The filter is the actual hole.

How I found it

Mailboxes is a core module. Root has it on a default install. I went looking for the sibling of the SVG mail XSS that 2.670 already closed.

mailboxes/detach.cgi prints Content-type from the part and, for text/html, runs safe_urls(filter_javascript()). filter_javascript deletes a script element only when both tags are present:

$rv =~ s/<\s*script[^>]*>([\000-\377]*?)<\s*\/script\s*>//gi;

An unclosed script never matches. View is a same-origin GET from view_mail.cgi, so the referer check passes.

Wrong turns: treating this as CVE-2026-49102; treating the sandboxed body iframe as the sink; treating HttpOnly as a stop; using the type= override that skips the filter. The View link does not set type=. The leftover is the filtered path.

Lab

python3 webmin-detach-xss-Abraxas-Labs.py

or:

cd lab
./run.sh

Clones webmin/webmin tag 2.670 (3a2b2b8671c0669c129f5275b3dd1853106ae02b) into lab/src and reuses webmin-lab:2.670 when present. Loopback only. Docker, git, python3.

IOC planted-mbox /var/mail/root unclosed-script
IOC detach status=200 content-type=text/html csp=0 script=1 close=0 witness=1
SUCCESS WEBMIN-H07-DETACH-XSS detach.cgi text/html unclosed-script WEBMIN-H07-XSS-WITNESS

The fix

Make filter_javascript strip an unclosed <script> as well as a matched pair, or always serve attachments as text/plain / download. Call header() from detach.cgi so the response actually gets a CSP. 'unsafe-inline' in that CSP is still a problem for this class.

References

  • github.com/webmin/webmin tag 2.670 (3a2b2b8671c0669c129f5275b3dd1853106ae02b)
  • mailboxes/detach.cgi
  • filter_javascript in web-lib-funcs.pl
  • Nearby patched (not this path): CVE-2026-49102 SVG forced text/plain; CVE-2026-49103 detach overwrite
  • CWE-79

License

GNU Affero GPL v3.0. See LICENSE. Loopback lab only. No warranty.

Abraxas Labs [email protected]

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    772
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    505
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    420
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    345
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    260
  • 6

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    251

Explore all tools

Browse our collection of tools

View all tools →