mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 03:36:48 +00:00
clone only required "view" access, so a user with clone_instances and the global view_instances permission could clone anyone's VM and read its disks. It also copied every POST field into clone_data, which let the client override the server-set disk_owner_uid/gid, and disk-<dev> values went unvalidated into volume XML and os.path.join. - Require change permission on the source VM, except for templates, which any user who can view them may clone. - Build clone_data from an allowlist: name, title and description for everyone; disk names and MAC addresses only from superusers. - For non-superusers, derive disk names (get_clone_disk_name) and MAC addresses (DHCP or random) on the server; their form only sent the source VM's own values, which could never work. - Validate every MAC address (not only the first) and every disk name; a missing MAC is an error message instead of a KeyError. |
||
|---|---|---|
| .. | ||
| api | ||
| fixtures | ||
| migrations | ||
| templates | ||
| templatetags | ||
| __init__.py | ||
| apps.py | ||
| forms.py | ||
| models.py | ||
| test_clone_permission.py | ||
| test_create_instance.py | ||
| test_index.py | ||
| test_root_pass.py | ||
| test_security_mutations.py | ||
| tests.py | ||
| urls.py | ||
| utils.py | ||
| views.py | ||