Repository navigation
Close the admin's file and search doors, and Google takeovers - #194
Merged
Merged
Conversation
- Avo's attachments and search controllers sat outside every policy gate, and Avo Community's own check allows everything: a curator could delete or replace a traveller's avatar or a tour's audio and search accounts by email. AdminAttachmentGate asks the record's policy for update? before an upload or a delete; AdminSearchGate asks the resource's policy for index?. Each hole has a test that fails without its gate. - Linking Google to an unconfirmed account found by email now replaces its password and ends its sessions before confirming it, so a stranger who registered with someone else's address loses the account to its owner. A confirmed account keeps its password. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JEmikXtNoH7wAg6veTjbyT
Under the full suite the shared browser answered the map's catalogue from an earlier test's HTTP cache, so the map drew no places and the test failed one run in two. Its own session starts with an empty cache, and its broken storage reaches no other test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JEmikXtNoH7wAg6veTjbyT
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The two security gaps from the first review of the repository, now fixed and each proven by a test.
Avo's attachments and search controllers sat outside every policy gate, and Avo Community's own authorization allows everything. A curator could:
AdminAttachmentGatenow asks the record's policy forupdate?before an upload or a delete.AdminSearchGateasks the resource's policy forindex?. All three Avo gates are registered inconfig/initializers/avo_gates.rb.A Google sign-in could hand an account to a stranger. Anyone could register with someone else's address, since an unconfirmed account works for three days. When the owner later signed in with Google, the account was linked and confirmed with the stranger's password and sessions intact. Now an unconfirmed account found by email gets a new password and ends every session before it's confirmed. A confirmed account keeps its password.
A flaky test, fixed along the way: the refused-storage browser test from Work on phones from iOS 15 and Android browsers of about 2019 #190 failed about one run in two under the full suite. It read the map's catalogue from an earlier test's HTTP cache in the shared browser. It now runs in a browser session of its own.
Test plan
test/integration/admin_engine_gates_test.rb:bin/cion the pushed commit is green: 2491 unit runs and 72 browser runs, 0 failures, signed off.🤖 Generated with Claude Code
https://claude.ai/code/session_01JEmikXtNoH7wAg6veTjbyT