Mealie: Stored XSS via Tag Name to Account Takeover
A group owner creates a tag with HTML in its name; every recipe card showing that tag runs JavaScript in the Mealie origin and exposes the viewer's access token, across group boundaries as well.
Advisory ID: TP-2026-127
Product: Mealie (self-hosted recipe manager and meal planner)
Vulnerability type: Stored cross-site scripting (CWE-79)
CVE: requested, assignment pending
CVSS 3.1: 8.7 (High) · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
Affected versions: < 3.20.0
Vendor advisory: GHSA-ffx9-4vvj-2rrq
Fixed in: 3.20.0
Reported: 29 May 2026
Summary
Mealie shows the names of tags, categories and tools as chips on recipe cards. The RecipeChips.vue component assigns the raw name to innerHTML to measure the text length, and the names are stored verbatim. A user with the can_organize permission, which group owners hold by default, creates a crafted tag. Anyone who renders a card carrying that tag runs the script in the Mealie origin; because the access token sits in a cookie without HttpOnly, a signed-in viewer loses the account, including a member of a different group who opens the attacker's public recipe page.
Root Cause
truncateText runs node.innerHTML = text on an element created from the live document, so an <img onerror> in the name loads and fires its handler (frontend/app/components/Domain/Recipe/RecipeChips.vue:53-54). The chip template calls truncateText(category.name) with the unsanitized name (RecipeChips.vue:21), and only recipe cards pass :truncate="true" (RecipeCard.vue:61). The CategoryIn schema defines name: str without validation (mealie/schema/recipe/recipe_category.py:9-10), and POST /api/organizers/tags checks only can_organize and stores the name unchanged (mealie/routes/organizers/controller_tags.py:51-54). The access token is written with useCookie without httpOnly (frontend/app/composables/use-auth-backend.ts:33-40). Mealie sends no Content-Security-Policy that would stop the script.
Proof of Concept
POST /api/organizers/tags HTTP/1.1
Authorization: Bearer <owner-jwt>
Content-Type: application/json
{"name":"<img src=x onerror=\"document.title=document.cookie\">x"}
HTTP/1.1 201 Created
{"id":"...","name":"<img src=x onerror=...>x","slug":"img-srcx-onerror-x","groupId":"..."}
Then attach the tag to a recipe, make the recipe public with settings.public=true and the group public with privateGroup=false, and open /g/{groupSlug}. Verified on 29 May 2026 against an unmodified ghcr.io/mealie-recipes/mealie:v3.19.2 container: a signed-out browser session loaded the group page and the onerror handler ran in the Mealie origin.
Impact
- Arbitrary JavaScript in the Mealie origin, with no Content-Security-Policy in the way.
- A signed-in user who renders the tag loses the access token and with it the account.
- All groups share one origin, so members of other groups who open the attacker's public recipe page are exposed too.
- An administrator who opens an affected recipe list loses the whole instance.
- The attacker needs an account with
can_organize; the viewer only has to open the page.
References
Is Something Like This in Your Software?
Our team found this vulnerability in the course of its work. Have your applications tested by the same specialists, with a penetration test from turingpoint.
