The "Change Currency Symbol"/"Change Currency Name" modals in
/economy dashboard only validated input length, then interpolated
the raw value directly into src/config/bot.js's source code via
string templates before writing it to disk.
A value containing a double quote (e.g. `",a`, which passes the
1-3 character length check) breaks the generated JS syntax, and
since bot.js is imported at process startup, this corrupts the
bot's central config file and prevents it from starting on the
next restart until manually repaired.
Fix:
- Serialize the symbol/name with JSON.stringify() instead of raw
template interpolation, so quotes/backslashes are always
properly escaped in the generated source.
- Add an explicit character whitelist (isSafeCurrencyInput) that
rejects quotes, backslashes, and backticks up front, giving
users a clear validation error instead of relying solely on
the escaping to hold.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
The "Change Currency Symbol" / "Change Currency Name" modals in /economy dashboard only validate input length (1-3 / 1-20 chars), then interpolate the raw value directly into src/config/bot.js's source code via string templates before writing it to disk.
A value containing a double quote — e.g. ",a (3 characters, passes the length check) — breaks the generated JS syntax. Since bot.js is imported at process startup, this corrupts the bot's central config file and the bot fails to start on the next restart/redeploy until someone manually fixes the file.
Fix
Test plan
🤖 Generated with Claude Code