moo.core.tests.test_security_sandbox_relations
Security tests: sandbox traversal across Django relations.
These cover attack paths where verb code starts with a legitimate MOO Object and then walks Django reverse relations or foreign keys into raw auth, site, mail, or parser metadata rows.
Functions
|
Create a MOO Object plus Django auth Player row outside the sandbox. |
|
Create a UserKey row outside the sandbox. |
|
Execute verb source with the same restricted globals used by verbs. |
Comprehensions iterate via _getiter_ too; yields must be guarded. |
|
Looping over readable MOO Objects keeps working. |
|
A plain list of restricted model rows must not yield instances to a loop. |
|
received_messages/sent_messages must not expose raw mail ORM rows. |
|
A non-wizard player cannot read another player's mailbox via get_mailbox(). |
|
Object.name and relation managers must honor the object's read ACL. |
|
PrepositionSpecifier rows reachable from a Verb cannot be changed by non-wizards. |
|
A player-owned verb cannot reach Player/User rows through avatar.player_set. |
|
print() of a restricted model instance must not leak its __str__. |
|
Wizards see the real str() of non-sandbox model instances. |
|
|
send_message() binds non-wizard sends to context.player. |
|
Object.site must not hand a mutable django.contrib.sites Site to verb code. |
|
A raw UserKey passed into globals cannot be inspected or mutated by sandbox code. |
Verb.code must honor the verb's read ACL. |
|
Wizards keep raw access to non-sandbox model rows. |