This repository was archived by the owner on Aug 6, 2026. It is now read-only.
fix: require bearer-token auth on all admin routes - #1
Merged
Conversation
Every admin route shipped with security => false - ban, grant-currency, and broadcast were callable unauthenticated. Add asobi_admin_auth with a config-sourced token (ASOBI_ADMIN_TOKEN), constant-time comparison, and fail-closed behaviour when unconfigured or when the placeholder was never expanded. The live-dashboard ws authenticates in-protocol (first frame must be an auth message, idle timeout closes with 1008) since nova applies no route security to ws upgrades, has no pre-upgrade rejection path, and browsers cannot set ws headers - mirrors the asobi library's ws auth model. Also drop the unused arizona_core/arizona_nova deps (the novaframework mirror is gone, breaking fetch) and fix two ws specs to match OTP json's iodata return.
nova master's rebar.config overrides cowboy's deps to pin the vulnerable cowlib 2.16.1, so bumping nova cannot clear the advisory - only a top-level cowlib override in the consuming app supersedes nova's override (same fix asobi_saas already carries). Stop ignoring rebar.lock too: this is an application; the lock belongs in git so CI and releases resolve the same tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
security => false- ban, unban, grant-currency, economy mutation, and broadcast were callable unauthenticated. All/admin/api/*routes now requireAuthorization: Bearer <token>(ASOBI_ADMIN_TOKEN), verified with a constant-time digest compare.${detected) deny everything.{"type":"auth","token":...}, 5s idle timeout closes 1008): nova applies no route security to ws upgrades and has no pre-upgrade rejection path (nova_ws_handler: no way to reject a ws upgrade with a proper status code novaframework/nova#394), and browsers cannot set ws headers.vm.args.srcnow takes${RELEASE_COOKIE}from the environment (this repo is public; a committed cookie is a known credential for the node that can ban players and grant currency).rebar3 get-deps).Notes for deploy
ASOBI_ADMIN_TOKENandRELEASE_COOKIEset fails closed: admin API 401s everything. There is no prod sys.config yet (rebar3 as prod releasewas already broken - missingprod_sys.config.src); whoever adds it should carry the same env-var pattern.Testing