luci-app-lxc: fix authenticated path traversal and ACL bypass (host root)
authorDirk Brenken <redacted>
Tue, 12 May 2026 19:28:44 +0000 (21:28 +0200)
committerPaul Donald <redacted>
Wed, 27 May 2026 11:21:12 +0000 (14:21 +0300)
commitfdc8eb01d0ee2d1c62cdecae80908f3d495e3469
treec2b2cda46cc6fc26d25fcef0249e518c09f8c7b5
parent63ed3e6388f2c0958bced2c189fb85f93999793a
luci-app-lxc: fix authenticated path traversal and ACL bypass (host root)

* ucode fixes:
  - tighten `is_valid_lxc_name` regex to `^[A-Za-z0-9_][A-Za-z0-9_-]{0,63}$`
  - apply the validator in `lxc_configuration_get` and `lxc_configuration_set` before any filesystem access
  - reject the `'lxc error: …'` sentinel string returned by `lxc_get_config_path()` on failure,
    rather than concatenating it into a path.
  - shellquote `LXC_URL` in `lxc_get_downloadable` and `lxc_create`
* ACL fix: add `depends.acl = ["luci-app-lxc"]` to each of the five backend entries,
   so the routes share the same authorization gate as the view

Signed-off-by: Dirk Brenken <redacted>
applications/luci-app-lxc/root/usr/share/luci/menu.d/luci-app-lxc.json
applications/luci-app-lxc/ucode/controller/lxc.uc
git clone https://git.99rst.org/PROJECT