Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-113612 Overview
CVE-2026-113612 is a missing authorization vulnerability [CWE-862] in SparkyFitness, an open-source nutrition and fitness tracking application. Versions prior to 0.17.0 fail to verify ownership before deleting food variant records. Any authenticated user can issue a DELETE /api/foods/food-variants/:id request against variant IDs they discovered through public food read endpoints. The server processes the deletion without confirming the caller owns the parent food entry. This allows attackers to destroy serving and nutrition variants attached to publicly shared foods belonging to other users.
Critical Impact
Authenticated users can permanently delete food variant data belonging to other users, including public shared library entries, resulting in integrity and availability loss across the application's shared food dataset.
Affected Products
- SparkyFitness versions prior to 0.17.0
- SparkyFitnessServer/services/foodCoreService.ts food variant deletion handler
- PostgreSQL Row Level Security (RLS) policies in rls_policies.sql for public.food_variants
Discovery Timeline
- 2026-10-20 - CVE-2026-113612 published to NVD
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-113612
Vulnerability Analysis
SparkyFitness exposes a REST endpoint, DELETE /api/foods/food-variants/:id, used to remove serving-size and nutrition variants from a food item. In versions through 0.16.9, the deletion handler in foodCoreService.ts resolves the parent food's owner but never compares that owner against the authenticated user making the request. Variant identifiers are not secret: public food read endpoints return them to any logged-in user browsing the shared food library.
An attacker with a valid session can enumerate variant IDs from public foods and submit targeted delete requests. The server executes each deletion and returns success, removing the victim's variants permanently. The flaw affects both the application-layer authorization check and the underlying PostgreSQL RLS policy, which conflated read and write access into a single FOR ALL policy for public.food_variants.
Root Cause
The root cause is twofold. First, the service function retrieves foodOwnerId but omits an equality check against authenticatedUserId before invoking foodRepository.deleteFoodVariant. Second, the RLS policy select_and_modify_policy grants modification rights to anyone with view access through has_library_access_with_public, which includes public viewers. This classifies as missing authorization [CWE-862].
Attack Vector
Exploitation requires only a low-privileged authenticated account. The attacker reads a public food to collect variant IDs, then issues HTTP DELETE requests against each variant ID. No elevated role, user interaction, or chained vulnerability is needed.
// Patch in SparkyFitnessServer/services/foodCoreService.ts
if (!foodOwnerId) {
throw new Error('Associated food not found.');
}
if (foodOwnerId !== authenticatedUserId) {
throw new Error(
'Forbidden: You do not have permission to delete this food variant.'
);
}
const success = await foodRepository.deleteFoodVariant(
variantId,
authenticatedUserId
);
// Source: https://github.com/CodeWithCJ/SparkyFitness/commit/79215eb4d6dda12262e1bb15b76dceb0e37f6fa1
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2026-113612
Indicators of Compromise
- Unexpected DELETE /api/foods/food-variants/:id requests in SparkyFitness server access logs, especially from accounts that did not create the parent food.
- Missing variant rows in the public.food_variants table for foods flagged with shared_with_public = true.
- User reports of disappearing serving sizes or nutrition entries on previously populated public foods.
Detection Strategies
- Correlate authenticated user IDs with the owner of the parent food on every observed variant deletion request and alert on mismatches.
- Enable PostgreSQL audit logging on public.food_variants to capture DELETE statements along with the session user and timestamp.
- Review web application firewall or reverse proxy logs for enumeration patterns against /api/foods/food-variants/ endpoints.
Monitoring Recommendations
- Baseline the normal rate of food variant deletions per account and alert on sudden spikes.
- Monitor for a single session issuing deletions across many distinct food_id values owned by different users.
- Track application error logs for the new Forbidden: You do not have permission to delete this food variant. message after upgrading, which indicates attempted abuse.
How to Mitigate CVE-2026-113612
Immediate Actions Required
- Upgrade SparkyFitness to version 0.17.0 or later as published in the SparkyFitness Release v0.17.0.
- Restore any deleted food variants from database backups if abuse is suspected.
- Audit recent DELETE activity on public.food_variants and identify accounts responsible for cross-owner deletions.
Patch Information
The fix is implemented in commit 79215eb and shipped in release v0.17.0. The patch adds an explicit ownership check comparing foodOwnerId to authenticatedUserId in foodCoreService.ts and splits the combined RLS policy into separate select_policy and modify_policy definitions. The modify policy now requires has_diary_access(f.user_id) rather than public library access. Full details are available in the GitHub Security Advisory GHSA-qph8-6xrr-7xjw and the VulnCheck Advisory on SparkyFitness.
Workarounds
- If immediate patching is not possible, temporarily restrict the DELETE /api/foods/food-variants/:id route at a reverse proxy and permit it only for trusted administrators.
- Apply the split RLS policies manually in PostgreSQL to enforce ownership on food_variants modifications until the upgrade can be scheduled.
- Disable public food sharing (shared_with_public = false) to reduce the pool of variant IDs discoverable by attackers.
# Apply the RLS policy fix manually (PostgreSQL)
DROP POLICY IF EXISTS select_and_modify_policy ON public.food_variants;
CREATE POLICY select_policy ON public.food_variants FOR SELECT TO PUBLIC
USING (
EXISTS (
SELECT 1 FROM public.foods f
WHERE f.id = food_variants.food_id
AND has_library_access_with_public(
f.user_id,
f.shared_with_public,
ARRAY['can_view_food_library', 'can_manage_diary']
)
)
);
CREATE POLICY modify_policy ON public.food_variants FOR ALL TO PUBLIC
USING (
EXISTS (
SELECT 1 FROM public.foods f
WHERE f.id = food_variants.food_id
AND has_diary_access(f.user_id)
)
);
# Source: https://github.com/CodeWithCJ/SparkyFitness/commit/79215eb4d6dda12262e1bb15b76dceb0e37f6fa1
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

