Akaunting 3.3.0 - Stored XSS through imported item names

7

High

Detected by

Fluid Attacks AI SAST Scanner

Disclosed by

Miguel Gómez

Abstract

Fluid Attacks' AI SAST detected CVE-2026-118368, a high-severity stored cross-site scripting (XSS) vulnerability (CWE-79) in Akaunting 3.3.0. An authenticated Manager can execute JavaScript code within the browsers of other users. It has a CVSS v4.0 base score of 7.0. Fluid Attacks assigned this CVE as a CNA, and this advisory includes a proof of concept.

Summary

Full name

Akaunting 3.3.0 - Stored XSS through imported item names in invoice line items

Code name

State

Public

Release date

Affected product

Akaunting

Vendor

Akaunting

Affected version(s)

3.3.0

Vulnerability name

Stored cross-site scripting (XSS)

Remotely exploitable

Yes

CVSS v4.0 vector string

CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:A/VC:H/VI:H/VA:N/SC:L/SI:L/SA:N

CVSS v4.0 base score

7.0

Exploit available

Yes

Description

Akaunting 3.3.0 contains a stored cross-site scripting vulnerability in the XLSX item-import workflow. An authenticated Manager can import an item whose name contains HTML with an event handler. When another authenticated user adds that item while creating an invoice or bill, the document-line component inserts the stored name as HTML and the payload executes in the victim's authenticated Akaunting origin.

Vulnerability

Root cause

The Items spreadsheet importer maps a row and returns new Model($row) directly. It does not invoke CreateItem or UpdateItem; commit 80ef6d3b applies strip_tags() to name in those normal write paths. The shared import base only normalizes invalid UTF-8; its request validation accepts any string up to 255 characters and does not remove markup.

The item-autocomplete endpoint returns the stored name in JSON. During document creation the client copies it into row.name, and the line-item Blade/Vue template renders row.name with Vue v-html. Consequently, an HTML payload persisted by the importer is parsed in the victim's browser rather than rendered as text.

Source-to-sink path

  1. A Manager uploads an XLSX item row with attacker-controlled name to the Items import route. Common\\Items::import() calls importExcel(new Import, ...) (app/Http/Controllers/Common/Items.php:117-131).

  2. Imports\\Common\\Sheets\\Items::map() preserves name, and model() returns new Model($row) (app/Imports/Common/Sheets/Items.php:22-41). This bypasses CreateItem::handle() and UpdateItem::handle(), whose tag stripping was added by 80ef6d3b.

  3. Abstracts\\Import::map() changes encoding and import metadata but does not HTML-sanitize spreadsheet values (app/Abstracts/Import.php:48-108). The item request rule for name is only required|string|max:255 (app/Http/Requests/Common/Item.php:47).

  4. Common\\Items::autocomplete() serializes the matching Item models as JSON (app/Http/Controllers/Common/Items.php:248-332).

  5. The document client copies the selected value into the row model (resources/assets/js/views/common/documents.js:860-862), and the line-item template renders it using <div v-html="row.name"></div> (resources/views/components/documents/form/line-item.blade.php:36-40). This is the executable HTML sink.

Impact

The attacker can execute JavaScript in the victim's authenticated Akaunting origin when the victim selects the imported item. Code running in that origin can read data exposed to the victim's browser and submit same-origin actions authorized for that user. In an administrator session this can include user-management actions; in a normal member session the impact is confined to that member's accessible data and actions.

PoC

Preconditions

The test configuration uses Akaunting 3.3.0, company ID 1, a Manager account, and a separate Administrator account. The Manager imports Items; the Administrator creates an invoice or bill. The companion workbook lineitem-admin-impact.xlsx contains one enabled row in items, header-only item_taxes, and a handler targeting /1/auth/users with companies:[1]. Separate browser profiles preserve the Manager and Administrator sessions.

Step-by-step

  1. Install the released 3.3.0 tag in a local test environment and complete Akaunting's normal installation. Create a test company and confirm the running version in Settings → About or the footer.

  2. With the initial Administrator, create a disposable user in that company with the predefined Manager role only. Complete registration in a separate browser profile, then sign in as the Manager.

  3. As the Manager, open Importer → Import Items (GET /{company}/common/import/common/items). Import one enabled product row whose name is XSS marker <img src=x onerror="alert('Stored XSS')">, with sale_price and purchase_price set to 1 and category_name set to General. The browser submits the import in the multipart import field to POST /{company}/common/items/import.

  4. Open Items and confirm that the imported item is present.

  5. Sign out. In a separate browser profile or private window, sign in as the disposable Administrator. Open Sales → Invoices → New Invoice (GET /{company}/sales/invoices/create) or Purchases → Bills → New Bill.

  6. Select Add an item, search for XSS marker, and select the imported item once. The application retrieves the item from GET /{company}/common/items/autocomplete and assigns its stored name to the document row.

  7. The browser displays its native alert modal with the exact text Stored XSS when the line-item component renders the name through <div v-html="row.name"></div>. The invoice or bill does not need to be saved.

  8. The browser modal confirms execution when the item is selected in the Administrator session.

Evidence of Exploitation

  • Video of exploitation:

  • Static evidence:

Our security policy

We have reserved the ID CVE-2026-118368 to refer to this issue from now on.

Disclosure policy

System information

  • Product: Akaunting

  • Version: 3.3.0

  • Operating System: Any supported Akaunting deployment

References

Solution and Workaround

Solution

Apply an upstream fix that normalizes imported item names through the same shared write-path logic as standard item creation and updates. Replace the document line-item v-html binding with Vue text interpolation or a text-content binding. Verify the deployed change by importing markup-bearing item names and confirming that invoice and bill line items render the value as text.

Workaround and temporary mitigation

Until the fix is deployed, restrict item-import permission to trusted administrators. Review imported item names for markup, normalize existing values, and avoid selecting untrusted items in document line items. This reduces exposure but does not remove the vulnerability.

Credits

The vulnerability was detected by AI SAST Scanner and disclosed by Miguel Gómez from Fluid Attacks' Offensive Team.

Timeline

Vulnerability discovered

Vendor contacted

Public disclosure

Does your application use this vulnerable software?

During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.