/

CVE-2026-71233

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in InvoiceNinja Portal Terms Field

CVE-2026-71233

Received

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-Side Code Execution, Session Theft, and Account Takeover

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

InvoiceNinja v5-stable stores and renders invoice or quote terms without sanitizing HTML, allowing attacker-controlled content to execute in a client portal user's browser. An authenticated user with invoice creation or update access may abuse this behavior to target clients when they view the affected invoice, potentially stealing session data or taking over client accounts.

Affected context

The vulnerability occurs in the InvoiceNinja client portal when invoice or quote terms are rendered with Laravel Blade's raw output directive. It is relevant when an authenticated account can create or update invoices through the REST API, the terms value is stored without HTML sanitization, and a client later views the affected document in a browser. This is a separate rendering path from invoice line-item description handling.

Exploit preconditions

  • Attack surface: Invoice and quote creation or update functionality exposed through the REST API
  • Required access: An authenticated user with permission to create or modify invoices
  • Trigger point: A client or other portal user viewing an invoice or quote containing the stored terms value
  • Why exploitation is possible: The terms field is persisted with insufficient content filtering and later inserted into the portal page as raw HTML

Why this happens

The underlying bug is a failure to treat user-controlled invoice terms as untrusted content before browser rendering. The application uses a raw Blade output directive and applies only newline removal rather than context-appropriate HTML sanitization or safe encoding. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, because attacker-controlled data can become executable browser content.

Potential impact

  • Session identifiers or other sensitive browser-accessible data may be exposed
  • Client portal accounts could be compromised
  • Malicious actions could be performed in the context of an affected user
  • Invoice and quote content may be altered or used for phishing
  • Additional users may be targeted through shared or widely viewed documents

General mitigation guidance

Mitigation generally centers on treating invoice terms as untrusted input throughout storage and rendering.

Common defensive patterns include:

  • Prefer context-appropriate output encoding over raw template rendering
  • Apply a narrowly defined, allowlisted HTML sanitization policy when formatted terms are required
  • Validate and constrain terms content at the application boundary while retaining safe rendering controls
  • Use secure browser policies such as an appropriately restrictive Content Security Policy as defense in depth
  • Limit invoice-editing permissions according to least privilege
  • Avoid relying on newline stripping or other normalization as a substitute for sanitization

How teams detect issues like this

Organizations commonly detect stored XSS risks through:

  • Static analysis rules identifying raw template output of request or model fields
  • Code review checks for unsanitized values in Blade templates and other server-rendered views
  • Data-flow analysis tracing API input fields into HTML responses
  • Dynamic testing that verifies executable markup is not persisted or rendered in authenticated portal workflows
  • Policy enforcement requiring output encoding or approved sanitization libraries for user-controlled HTML
  • Monitoring for unusual invoice content changes and suspicious portal activity

Sources

SourceLink
github.comgithub.com/invoiceninja/invoiceninja

Frequently asked

questions

It can be exercised through the application's invoice or quote API when the attacker has the required authenticated permissions and a target later views the affected document.

The attacker needs an account authorized to create or update invoices or quotes. The target generally needs to access the affected document through the client portal.

Render terms using context-appropriate output encoding by default. If formatted text is a business requirement, use a tightly restricted HTML allowlist sanitizer before rendering and retain defense-in-depth browser controls.

Treat all API-supplied and stored content as untrusted, review data flows into templates, prohibit raw output for untrusted values, and include authenticated end-to-end XSS tests in security and CI processes.

Find out what's already
exploitable in your codebase.