[Medium] [Bug] Design slot 2 bypasses ENCHANT_MASTERY requirement in store action #367

Closed
opened 2026-06-10 19:29:50 +02:00 by Anexim · 1 comment
Owner

Severity: Medium
File: src/lib/game/stores/craftingStore.ts (lines 62-79) vs src/lib/game/crafting-actions/design-actions.ts (line 69)

Description:
In craftingStore.ts, startDesigningEnchantment() allows starting a design in slot 2 whenever slot 1 is occupied and slot 2 is free (line 68: else if (!state.designProgress2)). However, in design-actions.ts (line 69), the same function correctly checks for hasEnchantMastery before allowing slot 2.

The store version has no such check — any player can use two design slots without the mastery special.

Impact: The store's startDesigningEnchantment bypasses the ENCHANT_MASTERY requirement, giving all players dual-slot design capability. This is an exploit if the store version is the one wired to the UI.

Fix needed: Add the hasEnchantMastery check to the store's startDesigningEnchantment function, or remove the duplicate logic and have the store call the design-actions version.

**Severity:** Medium **File:** `src/lib/game/stores/craftingStore.ts` (lines 62-79) vs `src/lib/game/crafting-actions/design-actions.ts` (line 69) **Description:** In `craftingStore.ts`, `startDesigningEnchantment()` allows starting a design in slot 2 whenever slot 1 is occupied and slot 2 is free (line 68: `else if (!state.designProgress2)`). However, in `design-actions.ts` (line 69), the same function correctly checks for `hasEnchantMastery` before allowing slot 2. The store version has **no such check** — any player can use two design slots without the mastery special. **Impact:** The store's `startDesigningEnchantment` bypasses the `ENCHANT_MASTERY` requirement, giving all players dual-slot design capability. This is an exploit if the store version is the one wired to the UI. **Fix needed:** Add the `hasEnchantMastery` check to the store's `startDesigningEnchantment` function, or remove the duplicate logic and have the store call the design-actions version.
Anexim added the ai:todo label 2026-06-10 19:29:50 +02:00
n8n-gitea was assigned by Anexim 2026-06-10 19:29:50 +02:00
Anexim added ai:done and removed ai:todo labels 2026-06-11 11:38:06 +02:00
Author
Owner

Fixed: Added hasEnchantMastery check to craftingStore.startDesigningEnchantment before allowing design slot 2, matching the existing check in design-actions.ts.

Fixed: Added hasEnchantMastery check to craftingStore.startDesigningEnchantment before allowing design slot 2, matching the existing check in design-actions.ts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#367