Skip to content

ListCuenta restore-special account mapping lacks authorization re-check and CSRF token

Moderate
NeoRazorX published GHSA-f9xh-7rcj-jc8j Aug 22, 2026

Package

composer facturascripts/facturascripts (Composer)

Affected versions

<= v2026.4

Patched versions

None

Description

Summary

The FacturaScripts ListCuenta restore-special action overwrites the special-accounts mapping (cuentasesp) that drives accounting-entry generation, with no authorization re-check inside the handler and no anti-CSRF token. It is exploitable two ways: (a) broken access control — any non-admin with ListCuenta page access can invoke it directly; and (b) CSRF against an admin via top-level GET navigation.

Root Cause

restoreSpecialAccountsAction (ListCuenta.php:149-157) is dispatched from execPreviousAction with $action read via inputOrQuery (GET-reachable). It has NO validateFormToken and NO admin/permission re-check — the if ($this->user->admin) gate (:90) only wraps the UI-button rendering, not the handler. The sink CSVImport::updateTableSQL(CuentaEspecial::tableName())dataBase->exec() overwrites the cuentasesp table with packaged CSV defaults.

Impact

Corruption of the special-accounts mapping used to generate accounting entries (financial-integrity, I:H on that table). The broken-access-control path (non-admin accountant with menu='accounting' access) is deterministic and needs no victim interaction (PR:L/UI:N), scored as the primary vector.

Attack Chain

  1. Entry: GET /ListCuenta?action=restore-special (GET-reachable via inputOrQuery). Guard: admin-only restore button (:90) + expected token. Bypass proof: the if ($this->user->admin) gate only wraps UI-button rendering; the handler itself has no validateFormToken and no admin/permission re-check.
  2. Sink: CSVImport::updateTableSQL(CuentaEspecial)dataBase->exec() overwrites cuentasesp.
  3. Impact: special-accounts mapping overwritten → corrupted accounting-entry generation.

Bypass Evidence

  • Handler verified on v2026.4 to lack token + admin re-check; the admin check is only around button rendering.
  • $action GET-reachability via inputOrQuery verified.

Affected Versions

<= v2026.4.

Suggested Fix

Add validateFormToken() and an admin/permission re-check inside restoreSpecialAccountsAction.

Dedup

No published advisory covers this. Not a duplicate.


Reported by zx (Jace) — GitHub: @manus-use

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

CVE ID

CVE-2026-77530

Weaknesses

Cross-Site Request Forgery (CSRF)

The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. Learn more on MITRE.

Missing Authorization

The product does not perform an authorization check when an actor attempts to access a resource or perform an action. Learn more on MITRE.

Credits