Skip to content

fix: rank XP auth bypass and economy balance inflation - #150

Closed
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-a293
Closed

cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-a293

Conversation

@cursor

@cursor cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Critical bug inspection found two high-severity issues on main (missed during #130 security hardening):

1. /rank reset and /rank set auth bypass

2. Economy money inflation via Math.abs

  • Impact: Concurrent /deposit or /withdraw requests could create money from nothing.
  • Root cause: After a race drove wallet/bank negative, Math.abs() coerced the deficit into a positive balance.
  • Fix: Remove Math.abs and fail closed when post-update balances would be negative.

Validation

  • npm test — 53/53 passing
  • Added regression tests: tests/rank-admin-gate.test.js, tests/economy-balance-guard.test.js

Notes

Open in Web View Automation 

cursoragent and others added 2 commits September 13, 2026 02:22
Any member could run /rank reset or /rank set on other users, wiping or
inflating XP. Gate these subcommands on ManageGuild to match other admin
commands hardened in #130.

Co-authored-by: Daan Vrieling <contact@zvapor.xyz>
Concurrent deposit/withdraw requests could drive wallet or bank negative;
Math.abs then coerced the deficit into free money. Fail closed when the
post-update balance would be negative.

Co-authored-by: Daan Vrieling <contact@zvapor.xyz>
@zVapor-Dev
zVapor-Dev marked this pull request as ready for review September 16, 2026 22:51
@zVapor-Dev zVapor-Dev closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants