BBLABS v2BBLABSv2
>Home>Labs
>New labs

Latest 3 labs

Loading…

View all labs →
>Creators>Ranking
>Learn

Learn bug bounty

AcademyGuides, cheatsheets and glossaryVulnerabilitiesXSS, SQLi, IDOR, SSRF and moreHunter RoadmapYour step-by-step bug bounty pathBlogBug bounty guides and news
>Business>Pricing
ES
Log inLog in
>Home>Labs>New labs>Creators>Ranking>Learn>Business>Pricing
ES
Sign inCreate account
  1. Home
  2. Labs
  3. self_svg_XSS — Self-XSS → Bot-Assisted ATO via SVG upload
Medium$75015 min

Contact

Practice, learn and hack

Bug bounty practice platform with labs based on real reports. Learn ethical hacking in safe environments.

contact→

Follow us

YouTube
@0xGorka
X
@gorkaelbochi
LinkedIn
gorka-el-bochi-morillo
Instagram
@_.gorkaaa.b
Email
team@bblabs.es

Access every lab from €7.99/mo

New labs every week. Cancel anytime.

Create account

BBLabs is the bug bounty labs platform where you learn bug bounty with real vulnerabilities extracted from paid reports on HackerOne, Bugcrowd and Intigriti. Here you practice web hacking —XSS, SQLi, IDOR, SSRF, CSRF and more— in downloadable environments, capture the flag, read the writeup and apply the technique on active bug bounty programs.

BBLabs is the alternative to HackTheBox, TryHackMe and PentesterLab for those who want to practice bug bounty with real reports instead of artificial CTFs. From €7.99/mo, no commitment.

→ Learn bug bounty from scratch→ How to do bug bounty step by step→ Real bug bounty reports→ BBLabs for companies and academiesLabsAcademyVulnerabilitiesToolsHunter rankingXSS labsIDOR labsSSRF labsCSRF labsHackTheBox alternativeHack4u alternativeTryHackMe alternativePortSwigger alternativePentesterLab alternativeBug Bounty Labs comparisonHackerOne to practiceOffSec / OSCP alternativeINE / eWPT alternativeHTB Academy alternativeDVWA alternativeJuice Shop alternativeVulnHub alternativePentesterAcademy alternativeRoot-Me alternativeHackTheBox vs TryHackMeBest bug bounty platforms 2026BlogSpoilersWhat is bug bounty?How much do you earn in bug bounty?OWASP Top 10 explainedBest sites to practice web hackingHow to become an ethical hacker from scratchBurp Suite tutorial (Spanish)OSCP guide and prepGoogle Dorks for bug bountyHow much an ethical hacker earns in SpainBug bounty tools 2026Best cybersecurity certifications 2026Burp Suite tutorialsqlmap tutorialffuf web fuzzingnuclei tutorialHTTP Request SmugglingWAF bypassPrompt injection (LLM)Google Dorks
Made withand code
TermsPrivacyComparisonES

© 2026 BBLABS v2 — All rights reserved

self_svg_XSS — Self-XSS → Bot-Assisted ATO via SVG upload

By @gorka

Chain an SVG upload, a `blob:` URL, a chat invite and a headless admin helper bot to turn a Self-XSS into full admin account takeover

532 views16 completedUpdated Aug 2026
Log in to start

Learn to find this bug

This bug paid $750 on HackerOne.

Create your account and practice real bugs that got paid. Download the environment, find it and learn the exact technique — your path to your first bounty.

hunters training
650

hunters training

labs from real reports
50

labs from real reports

completions
380

completions

in bounties practiced
$200,000

in bounties practiced

40 flags captured this week
Create account
I already have an account

Access to all labs · no commitment · cancel anytime

Hunters who solved it· 8

VA1
@vazquezdv1820055 days ago
AL2
@alndrwla6 days ago
MA3
@mattkingst11 days ago
flyingwhales
@flyingwhales15 days ago
AL
@alex.burja.200029 days ago
0xyo
@0xyoJun 2026
PI
@pippen_3Jun 2026
w4tchw0lf
@w4tchw0lfJun 2026

Objectives

1
Identify how file previews are rendered (→ `window.open(URL.createObjectURL(blob))`)
2
Realize that SVGs opened as blob-URL documents execute `<script>`
3
Confirm that JWT auth tokens are kept in `localStorage['nc_token']`
4
Notice the in-app chat-invite feature and the admin helper bot
5
Craft an SVG that exfiltrates the admin JWT to `/api/exfil/<your id>`
6
Invite the admin, wait for the bot, harvest the token, hit `/api/admin`

Information

Platform
HackerOne
Difficulty
Medium
Duration
15 min
Bounty
$750
Completed
16
Creator
gorka@gorka

Achievement you'll earn

Solve this lab to unlock this shareable achievement

BBLABS.ESLab Solved
Medium$750
// achievement_unlocked

self_svg_XSS — Self-XSS → Bot-Assisted ATO via SVG upload

XSS
Aug 2026
gorka
solved_by@gorkaMember since Mar 2026
bblabs.es// real bug bounty practice

Community writeups

Attack Chain

Root causes (what makes the chain work)

  1. Unsanitized SVG upload. The server preserves Content-Type: image/svg+xml
    and serves uploads inline (files.ts).
  2. Top-level blob-URL open. FileAttachment.tsx builds a blob URL from the
    downloaded file and calls window.open(blobUrl). A blob URL loaded as a
    document inherits the creator's origin, so the SVG's <script> runs inside
    NeuroChat's origin.
  3. JWT in localStorage. auth.ts returns the token in the JSON response
    body and the client stores it in localStorage['nc_token'] — reachable from
    any script running in the origin.
  4. Open chat invites. Any user can invite anyone (including admin@) into
    any chat they own.
  5. Eager admin helper. A headless Chromium bot loads the chat and clicks the
    "Open in new tab" button on each attachment, firing the payload.

How to solve

1) Exploration

  • Sign in as attacker, upload an SVG that visibly renders (e.g. a simple shape)
  • Click Open in new tab — observe it opens on a blob: URL
  • Inspect Network tab: /api/files/:id returns Content-Type: image/svg+xml

2) Proof of script exec

Upload an SVG such as:

<svg xmlns="http://www.w3.org/2000/svg" width="120" height="40">
  <text y="25">hi</text>
  <script>alert(document.domain)</script>
</svg>

Click Open in new tab → alert pops on localhost:1338 → Self-XSS confirmed.

3) Weaponize

Your user id is visible in any decoded JWT (or in /admin if seen, but you are
not admin yet — use atob(token.split('.')[1])). Build an SVG that POSTs your
localStorage to /api/exfil/<id> (see exploit.py).

4) Deliver

Upload the weaponized SVG to a chat. Invite admin@neurochat.ai. The bot polls
every ~15s; it will accept, visit the chat, and click the attachment.

5) Harvest

Open /stolen in the UI (or poll /api/exfil). A capture with
email = admin@neurochat.ai will appear.

6) Takeover

Click Hijack session on that capture (or copy the token into
localStorage['nc_token']). Browse to /admin → flag.

Or: just run the exploit

python3 exploit.py

Proof of Concept (automated)

exploit.py automates steps 1–6 end-to-end. Typical run:

[1] Login as attacker@neurochat.ai
    ✓ logged in as #1 (Alex Morgan) · role=user
[2] Create attacker-owned chat
    ✓ chat id = 5
[3] Craft SVG payload (exfil → /api/exfil/1)
    ✓ 1.4 KB
[4] Upload dashboard-mockup.svg
    ✓ mime preserved as image/svg+xml
[5] Post message referencing file
[6] Invite admin@neurochat.ai
[7] Poll /api/exfil for captured admin token
    ✓ captured admin JWT
[8] Hit /api/admin with stolen JWT
      FLAG{e7a15c…}
Collaborators
antoniorivera@antoniorivera
Updated
Aug 2026

Download the environment

Reproduce it and find the bug yourself

Create account

Tools

Burp Suite

Prerequisites

  • Python 3 with `requests` (for `exploit.py`)
  • Familiarity with browsers'

Tags

XSS