Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Tools/GitHubGitHub/toanln-cov/cve-2026-76564
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationWeb SecurityPapers & Research
GitHubtoanln-cov/cve-2026-76564

CVE-2026-76564

Stored XSS via User-Agent in Admin Order View in PhocaCart

View Repository
3 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Stored XSS via User-Agent in Admin Order View in PhocaCart

PhocaCart ≤ 6.1.7 — Unauthenticated Attacker Stores XSS Payload via Checkout. Executes in Admin Browser Context

CVE CVSS v4.0 CWE-79 Affected Researcher


SUMMARY

PhocaCart 6.1.7 for Joomla stores the raw HTTP User-Agent header from checkout requests in the orders database table when the store_user_agent configuration option is enabled. The stored value is subsequently rendered without HTML encoding into the administrator order edit view via itemText() in Adminview.php.

An unauthenticated attacker can place an order with a crafted User-Agent containing a JavaScript payload. When an administrator opens the order in the backend, the payload executes in the admin browser context — enabling session hijacking, credential theft, or unauthorized administrative actions.

Download Tool

The vulnerability requires store_user_agent = 1 (non-default) to be enabled. Because this option is a deliberate administrator choice to collect browser statistics, affected shops are those where the shop owner has enabled the feature — making exploitation fully silent from the attacker's perspective.


AFFECTED VERSIONS

COMPONENTVULNERABLETESTED ONFIXED
PhocaCart (com_phocacart)5.0.0 – 6.1.7Joomla 5.4.7 + PhocaCart 6.1.7 + MariaDB 10.66.1.8

VULNERABILITY DETAILS

Type: Stored XSS (CWE-79) — admin-targeted Authentication required: None to inject. Administrator to trigger CSRF token required: Yes (standard Joomla CSRF token required for checkout) File: administrator/components/com_phocacart/libraries/Phoca/Render/Adminview.php:382

Root Cause

When store_user_agent = 1, the method PhocacartUtils::getUserAgent() returns $_SERVER['HTTP_USER_AGENT'] without any sanitization. This raw string is stored in #__phocacart_orders (truncated at 200 characters — insufficient to prevent XSS). When an administrator views the order in the backend, itemText() concatenates the stored value directly into the HTML response with no call to htmlspecialchars().

Data flow:

root@kitploit:~
Attacker sends checkout request:
  User-Agent: <script>alert(document.domain)</script>

    utils.php:334   PhocacartUtils::getUserAgent()
    └─ return (string) $_SERVER['HTTP_USER_AGENT']   // raw, no sanitization
        order.php:413  $d['user_agent'] = substr($user_agent, 0, 200)
        └─ INSERT INTO #__phocacart_orders (user_agent) VALUES ('<script>...</script>')

Admin opens order in backend:
    edit.php:84    echo $r->itemText($this->itemcommon->user_agent, ...)
    Adminview.php:382  '<div class="controls >' . $item . '</div>'
                                           // → NO htmlspecialchars()
    → Browser renders: <div><script>alert(document.domain)</script></div>
    → XSS fires in administrator's browser

ORDER.PHP — STORE PHASE (VULNERABLE SOURCE)

administrator/components/com_phocacart/libraries/phocacart/order/order.php:424

root@kitploit:~
$user_agent = PhocacartUtils::getUserAgent(); // reads $_SERVER['HTTP_USER_AGENT'] raw
$d['user_agent'] = substr($user_agent, 0, 200); // stored in DB unfiltered

ADMINVIEW.PHP:382 — RENDER PHASE (VULNERABLE SINK)

root@kitploit:~
// No htmlspecialchars() applied:
$output .= '  <div class="controls ' . $class . '">' . $item . '</div>' . "\n";

Called from administrator/components/com_phocacart/views/phocacartorder/tmpl/edit.php:84:

root@kitploit:~
echo $r->itemText($this->itemcommon->user_agent, Text::_('COM_PHOCACART_USER_AGENT'), '', 'user_agent');

The itemText() function passes $item (the stored user_agent value) directly into the HTML output with no encoding, making it the primary sink. Fixing it at the sink level protects all callers of itemText().


PROOF OF CONCEPT

The attack requires completing a full checkout flow with a malicious User-Agent header. The CSRF token must be obtained first since Joomla's checkout controller validates it.

0. Prerequisite — Enable Store User Agent Information

In Joomla admin, navigate to Components → Phoca Cart → Options → Main tab → Statistics Options. Set Store User Agent Information = Yes and save.

Prerequisite: Store User Agent Information = Yes

1. Obtain CSRF Token

The attacker visits the shop frontend to extract a valid Joomla CSRF token required by the checkout controller. The token appears in the HTML source or JavaScript config of any shop page.

Step 1: Attacker obtains CSRF token from shop frontend via Burp Suite

2. Add Product to Cart

The attacker adds a product to cart via the AJAX checkout endpoint using a benign User-Agent. This transitions the checkout session to the next state.

Step 2: Add product to cart — POST checkout.add

3. Save Billing Address

The attacker submits billing information to advance the checkout state machine.

Step 3: Save billing address — Burp Suite

4. Save Shipping Method

The attacker selects a shipping method to proceed to payment.

Step 4: Save shipping method — Burp Suite

5. Save Payment Method

The attacker selects a payment method (e.g., Cash on Delivery).

Step 5: Save payment method — Burp Suite

6. Inject Payload — Place Order with Malicious User-Agent

Critical injection step. The attacker places the final order via task=checkout.order with the User-Agent header set to the XSS payload. The checkout.order task reads raw HTTP_USER_AGENT and stores it unescaped in #__phocacart_orders.user_agent.

root@kitploit:~
POST /index.php/shop/checkout HTTP/1.1
Host: TARGET
User-Agent: <script>alert(document.domain)</script>
Content-Type: application/x-www-form-urlencoded

phcheckouttac=1&task=checkout.order&option=com_phocacart&return=&<CSRF_TOKEN>=1

Result: Order created. Database stores user_agent = '<script>alert(document.domain)</script>'.

Step 6: Order placement with malicious User-Agent — payload injected into database

7. Admin Views Order List

Administrator navigates to Components → Phoca Cart → Orders. The injected order appears in the list. XSS is not yet triggered at this stage.

Step 7: Admin order list in Joomla backend — injected order visible

8. XSS Fires — Admin Opens Order Detail

When the administrator clicks the order to open the edit view, the stored user_agent is rendered unescaped via itemText(). JavaScript executes immediately.

Trigger URL:

root@kitploit:~
/administrator/index.php?option=com_phocacart&view=phocacartorder&layout=edit&id=<ORDER_ID>

Step 8: XSS payload executes in administrator's browser — alert(document.domain) confirms execution context


IMPACT

  1. Admin Session Hijacking — The XSS payload can exfiltrate the administrator's session cookie, granting full backend access without credentials.
  2. Unauthorized Admin Actions — Executing in the admin browser context, the payload can perform any backend action: create privileged accounts, install malicious extensions, or modify content.
  3. Persistent Backdoor — A payload that installs a web shell or creates a rogue admin account persists beyond the XSS event itself, giving the attacker durable access to the server.

REFERENCES

  • CVE: https://www.cve.org/CVERecord?id=CVE-2026-76564
  • NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-76564
  • GitHub Advisory: https://github.com/advisories/GHSA-98mw-pj3j-99v2
  • Vendor Repository: https://github.com/PhocaDesign/PhocaCart