github rcarmo/pve-microvm v0.4.5

latest release: v0.4.6
2 hours ago

v0.4.5 — security, command-builder, CLI and Web UI audit fixes

Version 0.4.5 resolves findings from a multi-pass security and correctness
audit across the command builder, live patcher, guest CLI tools, Web UI,
packaging, and documentation.

Host and guest boundary hardening

  • Unpacked OCI rootfs confinement: pve-microvm-template, pve-oci-import,
    and build-exo-template.sh resolve unpacked directory paths strictly inside
    the guest rootfs while supporting merged-/usr (sbin -> usr/sbin) and
    /var/run symlinks. Build cleanup decodes findmnt hex escapes as raw
    bytes, fails closed when mount state cannot be verified, and blocks
    mkfs.ext4 if any mount remains under the work tree. Standard and full
    template builds execute package managers inside a host-root chroot and
    require trusted base images.
  • VM-bound SSH agent forwarding: pve-microvm-ssh-agent replaces the open
    socat vsock listener with a non-blocking AF_VSOCK selectors relay that
    accepts connections only from CID == VMID + 1000, monitors the target
    microVM's live QEMU (pid, starttime) and host SSH_AUTH_SOCK inode,
    propagates half-closes without EOF CPU spin, and closes lock file descriptors
    before detaching.
  • Locked 0700 share state: pve-microvm-share and pve-microvm-9p
    enforce 0700 non-symlink runtime directories (upgrading pre-existing 0755
    directories on package configure), require qm status to confirm a stopped
    VM before changing shares, verify (pid, starttime) before signalling
    virtiofsd, and locate /usr/libexec/virtiofsd on stock Debian/Proxmox
    hosts.
  • Web UI input validation and actions: Create µVM validates and
    shell-quotes every field, checks /cluster/nextid, and opens a copyable
    command dialog with a Sys.Console-gated Open Node Shell action.
    PVE.window.Clone receives guestType: 'qemu' in CmdMenu and
    TemplateMenu, Serial Console invokes openConsoleWindow('xtermjs', 'kvm', ...), and Options renders (n/a for microvm) without mutating
    store records.

Command builder, live patcher and CLI fixes

  • MicroVM.pm and QemuServer.pm schema: pve-microvm-patch registers
    virtio-mem in QemuServer.pm (qm set <vmid> --virtio-mem <MiB>).
    MicroVM.pm enforces 2 MiB block alignment and at least 256 MiB of base RAM,
    switches vmem0 to memory-backend-memfd,share=on when virtiofs is
    active, uses virtio-balloon-device on NetBSD MMIO guests (rejecting
    PCIe-only options), expands PVE x86-64-v2/v2-AES/v3/v4 qemu64 flag
    sets plus phys-bits/guest-phys-bits/custom CPU models, tokenises args
    once with balanced-quote validation, sorts drives deterministically by bus
    and numeric index after scsi0, escapes commas, and leaves caller $conf
    unmutated.
  • Atomic, serialised patching: pve-microvm-patch serialises apply and
    revert under flock, replaces Perl modules, backups, and UI files via
    fsynced sibling temp files, validates </head> and active <script> tags in
    index.html.tpl, and watches /usr/share/pve-manager/index.html.tpl with a
    dpkg file trigger so pve-manager upgrades re-apply the UI hook.
  • Template, import and ephemeral runner fixes: pve-microvm-template
    restores the missing OSv loader download, skips package and first-boot
    setup under --profile minimal, sets --agent 0 when the guest agent is
    disabled, honours explicit --no-* flags after --profile, and reads
    qm config --current 1 in --list. pve-oci-import refuses to overwrite an
    existing scsi0 unless --replace-root is passed. build-exo-template.sh
    removes its hardcoded root password and configures key-only SSH and the
    direct /dev/vport1p1 guest-agent unit. pve-microvm-run separates stderr
    warnings from qm guest exec JSON stdout, adds --timeout, maps signalled
    guest exits to 128 + signal, and attaches directly to the serial socket in
    interactive (-it) mode.

Packaging, kernel initrd and verification

  • Makefile and debian/rules share one install-internal target; python3
    is declared in Depends and virtiofsd in Recommends. Release CI verifies
    that the Git tag matches debian/changelog, enforces REQUIRE_KERNEL=1
    (vmlinuz, initrd, and build.config present in the .deb), and checks
    the oras SHA-256 digest.
  • kernel/build-kernel.sh checks static BusyBox applets compatible with Ubuntu
    24.04 before downloading Linux, downloads tarballs atomically, cleans its
    work directory on exit, and updates the initrd /init to parse rootwait
    and init= before waiting on root devices while failing closed if an
    explicit root= device does not appear.
  • The local regression suite passes 106/106 checks (make test and paired
    Valgrind CPU/allocation passes). The shipped guest kernel remains Linux
    6.12.113 with AppArmor selected by default; running guests do not need to
    restart when upgrading the host package unless picking up new QEMU device or
    kernel flags. See the audit summary.

Don't miss a new pve-microvm release

NewReleases is sending notifications on new releases.