Releases: luneth90/omamigrate
Releases · luneth90/omamigrate
Release list
OmaMigrate v1.1.9
Security & Hardening
- Bounded Staging Traversal & Resource Exhaustion Defense: Enforced strict aggregate limits on restored configuration files: maximum 50 files (
MAX_CONFIG_FILES = 50), maximum 5 MiB total aggregate bytes (MAX_CONFIG_TOTAL_BYTES = 5 * 1024 * 1024), and maximum 2 MiB per file (MAX_SINGLE_FILE_BYTES = 2 * 1024 * 1024). Traversal immediately breaks when limits are reached, preventing CPU, memory, or disk DoS by compromised or malicious workers. - Single-Pass Tar Streaming via Held Descriptors: Eliminated all multi-copy in-memory buffering (
validated_files,BytesIO, andgetvalue()). Configuration files are opened withO_RDONLY | O_NOFOLLOW, validated viafstat, and their descriptors are held open. Tar records are streamed directly from held descriptors into thesudo tarstdin pipe, maintaining minimal memory overhead and preventing staging swap / TOCTOU attacks. - Secure & Bounded Package Metadata (
missing_native_pkgs.txt): Replaced pathname reopen withO_RDONLY | O_NOFOLLOWdescriptor allocation andfstatvalidation (regular file, current user ownership, non-executable, size capped at <= 64 KiB). Package list size is hard-capped at 250 packages. - Archive Integrity Binding for Privileged Packages: Package names passed to privileged
pacmanare strictly validated and bound to either the explicit package manifest (pkg_meta/packages_explicit.txt) inside the selected archive or trusted core dependencies (CORE_ALLOWED_PKGS), rejecting any arbitrary package injections from staging workers. - Adversarial Regression Coverage (Test 7): Added Regression Test 7 to
tests/test_credential_isolation.shsimulating excessive file count flood (>50), aggregate byte flood (>5MB), oversized package metadata (>64KB), and unbound arbitrary package injection.
OmaMigrate v1.1.8
Security & Hardening
- Data/Code Decoupling & Elimination of Executable Restores: Completely purged arbitrary executable script restoration (
/usr/local/bin/sing-box-node-rotate) and archive-supplied systemd units (/etc/systemd/system/*.service,*.timer). The migration bundle strictly backs up and restores passive configuration data only (/etc/sing-box/*.json,/etc/mihomo/,/etc/v2raya/,/etc/xray/,/etc/v2ray/,/etc/daed/,/etc/proxychains.conf). - Staging Path Integrity & Trust Verification: The privileged runner strictly validates
stage_ready_diremitted by user-space workers, verifying canonical path prefixes, directory attributes (S_ISDIR), user ownership (st_uid == getuid()), non-world-writable permissions, and absence of symlinks. - Descriptor-Based Staging Transfer (
O_NOFOLLOW/ In-Memory Streams): Passive configuration files in user staging are opened exclusively viaos.openwithO_RDONLY | O_NOFOLLOW. File descriptors are validated viafstat(regular files onlyS_ISREG, execute bits strictly zeronot (st_mode & 0o111)), and file bytes are loaded directly into memory. In-memory tar streams are constructed and piped into roottar, completely eliminating TOCTOU staging-swap attacks and directory race conditions. - Audited Service Activation: System services (
sing-box.service,mihomo.service, etc.) are activated strictly from pacman package-managed units verified viasystemctl list-unit-files, completely eliminating archive-supplied unit file deployment and root command execution. - Adversarial Worker & Staging-Swap Regression Test: Added Regression Test 6 to
tests/test_credential_isolation.shsimulating concurrent staging-swap, executable payload injection, and unit tampering, proving that all attack vectors are strictly rejected.
Generalization & Universal Configurations
- Universal Configuration Focus: Cleaned up personal tailored workflows (
sing-box-node-rotateandicloud-mail-triage), generalizing systemd user unit handling and status reporting for official marketplace distribution. - Documentation & Descriptions: Updated documentation (
README.md,README.zh-CN.md,manifest.json,bin/omamigrate, andOmaMigrate.qml) to focus on universal desktop dotfiles, development environments, and security credential preservation.
OmaMigrate v1.1.7
Security & Hardening
- Prohibit Ambient Test Hooks (
OMAMIGRATE_TEST_*): Completely eliminated allOMAMIGRATE_TEST_*environment variable overrides (OMAMIGRATE_TEST_SUDO,OMAMIGRATE_TEST_VERIFY,OMAMIGRATE_TEST_UNREADABLE) from production code.sudo_pathis strictly hardcoded to/usr/bin/sudowith mandatory SetUID root validation, and test hooks cannot be manipulated from user space. - Strict Immutable Allowlist Operand Derivation: Privileged
tarbackup operands are strictly derived from an immutableALLOWLISTtuple (unreadable_operands = [item for item in unreadable if item in ALLOWLIST and not item.startswith("-") and ".." not in item]). Ambient or user-supplied paths can never bypass the allowlist. - Mandatory Option Terminators (
--): Inserted--option terminators across all privileged binary invocations (sudo,tar,pacman,systemctl,chown,chmod,usermod,modprobe,tee). This strictly prevents operand-to-flag option injection attacks even if malicious filenames or package names are encountered. - Relative Path Option Injection Defense: During system restoration, relative paths extracted from
system_rootstarting with-or containing..path traversals are strictly rejected before being passed totar. - Zero Test Variable Regression Enforcement: Added strict test assertions in
tests/test_migration_fuzz.pyto ensure production QML, backup, and restore scripts contain zeroOMAMIGRATE_TEST_occurrences, and updatedtests/test_credential_isolation.shwith active allowlist bypass tests.
OmaMigrate v1.1.6
Security & Hardening
- Pathname Reopening Elimination: Completely removed passing user-controlled staging file paths to the privileged
tarprocess. Privileged helper invokes/usr/bin/tar -C / -cf -streaming archive bytes directly to standard output pipe. Root never opens, reopens, or truncates any file path in user-controlled directories. - O_NOFOLLOW | O_EXCL Safe Descriptor Allocation: Staging archives are created and held directly by the unprivileged Python process using
os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOWwith mode0600and a cryptographically random 128-bit hex token (secrets.token_hex(16)). Pre-existing symlinks, collision attempts, or directory race attacks are strictly rejected by the kernel before any privileged operation is invoked. - Stdout Pipe-to-Descriptor Streaming: Tar output is streamed from the child process's stdout pipe to the securely held file descriptor with asynchronous stderr draining, completely eliminating file descriptor exposure, pipe deadlock risks, and symlink races.
- Symlink Traversal Prevention in System Restoration: Added symlink target resolution validation when walking
system_rootduring privileged deployment, rejecting any symlink pointing outsidesys_rootor using absolute/parent traversals (..). - Symlink Traversal & Race Condition Regression Tests: Added dedicated regression test in
tests/test_credential_isolation.shand contract assertions intests/test_migration_fuzz.py, formally proving that pre-created symlinks targeting sensitive files cannot cause root file truncation or path reopening.
OmaMigrate v1.1.5
Security & Hardening
- Two-Phase Privilege Separation Architecture: Decoupled mutable user-space worker scripts from all privileged system operations. User-space workers (
export.shandrestore.sh) execute in completely unprivileged environments with standard input bound to/dev/nulland zero ambient sudo credentials. - Strict In-Memory Privileged Helper: Implemented an in-memory, integrity- and ownership-bound runner in
OmaMigrate.qmlwith a narrow operation and argument allowlist. Privileged operations are strictly restricted to allowlisted targets (/etc/sing-box,/etc/mihomo,/etc/v2raya,/etc/xray,/etc/v2ray,/etc/daed,/etc/proxychains.conf,/usr/local/bin/sing-box-node-rotate, and systemd service units). - Package Name Sanitization: Enforce strict character allowlists (
^[a-zA-Z0-9_@.+-]+$) on all package restoration operations, preventing option injection or argument smuggling into/usr/bin/pacman. - Immediate Credential Revocation (
sudo -k): Guaranteed immediate sudo ticket revocation viasudo -kafter every privileged operation in both backup and restore flows. Sudo tickets are never left active across process boundaries, completely preventing rogue worker processes or same-UID processes from consuming reusable sudo timestamps. - Adversarial Privilege Capability Regression Tests: Added adversarial tests in
tests/test_credential_isolation.shdemonstrating that substituting a worker script with a malicious payload attemptingsudo -n idstrictly fails with zero capability leakage.
OmaMigrate v1.1.4
Security & Hardening
- Executable Identity & Absolute System Paths: Enforce fixed absolute paths (
/usr/bin/python3,/usr/bin/sudo,/usr/bin/bash) across all UI Process invocations and worker scripts. Eliminate PATH resolution vulnerability preventing user-session PATH spoofing and binary injection. - Environment Sanitization: Applied
clearEnvironment: trueand restrictedPATH="/usr/bin:/bin"to all privileged and shell execution processes inOmaMigrate.qml, eliminatingLD_PRELOAD,SUDO_ASKPASS, and environment variable injection vectors. - Privilege Boundary Integrity Verification: Implemented strict pre-execution integrity checks on
/usr/bin/sudo, verifying root:root ownership (UID 0, GID 0), SetUID mode (04755), and preventing group/world-writable permissions before routing any credentials. - Zero Credential Bytes to Mutable Plugin Workers: Completely eliminated
exportSecret,restoreSecret, andpendingSecretproperties from UI processes. Stream credentials exclusively to the isolated/usr/bin/sudoprivilege boundary in a dedicated session, redirecting standard input to/dev/nullprior to launching user-space worker scripts. Mutable plugin scripts never receive credential bytes, preventing TOCTOU worker substitution attacks. - PTY Session Privilege Isolation: Utilized an authentic in-memory PTY session bridge for GUI execution. This allows Linux Sudoers under default
timestamp_type = ttypolicies to establish valid terminal credentials and share them with non-interactive child workers (pacman,yay,modprobe) without piping raw secrets to user-side code. - Regression Test Suite: Added automated tests verifying PATH replacement immunity and worker substitution defense (proving neither fake PATH binaries nor replaced worker scripts can intercept credentials).
OmaMigrate v1.1.3
Fixed
- Restore Engine Hang & Yay Infinite Loop: Removed
--sudoloopfrom theyayAUR package installation routine inlib/restore.sh. Yay's upstream--sudoloopenters an unthrottled infinite retry loop whensudo -vfails in non-terminal environments (sudo: a terminal is required to read the password). Restore routines already maintain their own background keepalive loop, rendering yay's--sudoloopredundant. - Fail-Fast AUR Package Installation: Added
--sudoflags "-n"and standard input redirection (< /dev/null) toyay, ensuring package manager elevation operates strictly non-interactively and fails fast without blocking or looping when terminal input is unavailable. - Archive Extraction Input Guard: Redirected standard input to
/dev/nullduringtararchive extraction inbin/omamigrateto guarantee stdin credentials stream cleanly to the restore engine without premature consumption.
Added
- Top-Right Force Close Button: Added an independent
✕close button in the top-right corner of the OmaMigrate modal card (z: 1000), positioned above the processing shield. Users can now forcibly terminate active background processes (backup, restore, authorization, or scanning) and immediately close the window with a mouse click at any time.
v1.1.2
Fixed
- GUI Process Privilege Elevation: Fix non-TTY sudo privilege elevation where
sudochild processes inside subshells could not access Quickshell's parent process credentials under standardtimestamp_type = tty/ppidpolicies. - Pipeline Stdin Credential Delivery: Directly forward validated credentials via standard input pipe into
export.shandrestore.sh, authenticating within the execution process tree with immediate zeroing of secrets from memory, maintaining full compliance with process isolation rules (noargv, noenviron, no disk artifacts). - Interactive Terminal Sudo Prompt: Explicitly prompt with
sudo -vin interactive terminal sessions before running protected archive pipelines to ensure seamless execution.
OmaMigrate v1.1.1
Security & Hardening
- Process Credential Isolation: Eliminate password exposure in process command-line metadata (
argv) and environment variables (OMAMIGRATE_SUDO_PASS). - Direct Stdin Authentication Streaming: Stream authentication password directly to
sudo -S -p "" -vvia standard input pipe using QuickshellstdinEnabledwithout invoking intermediate shell arguments, immediately purging memory buffers upon transmission. - Sudo Credential Cache Re-use: Execute backup and restore routines strictly against the active sudo credential cache (
sudo -n), with background keepalive loops and automatic lifecycle cleanup on process exit. - Zero Disk Artifacts: Remove transient
askpassscript generation in restore routines, guaranteeing no sensitive credentials ever touch the filesystem. - Automated Process-Level Inspection Test: Added
tests/test_credential_isolation.shto dynamically inspect spawned processes, verifying that canary secrets are strictly absent from/proc/*/cmdlineand/proc/*/environ.
OmaMigrate v1.1.0
Added
- Expanded AI Developer Tool Persistence: Full credential, session, and configuration migration support for Pi, Oh My Pi (OMP) (named profiles, XDG &
PI_CODING_AGENT_DIR), and OpenCode (opencode.dbSQLite state, configuration, and workspace state) alongside Antigravity CLI (agy), OpenAI Codex, Claude Code, and xAI Grok. - Dual Migration Modes (Standard vs. Complete):
- Standard Mode: Strict allowlist of credentials and configurations, excluding conversation histories and plugins to keep backups minimal and fast.
- Complete Mode: Full migration including session histories, conversation memories, skills, and plugins with transactionally consistent SQLite live snapshots and integrity verification (
ai_manifest.sha256).
- Proxy Ecosystem Expansion: Full configuration and service restoration support for Mihoro (
mihoro.toml) and user-levelmihomo.service. - Automatic Kernel TUN Module Persistence: Automatically loads and configures
/etc/modules-load.d/99-omamigrate-sing-box-tun.conffor VPN/proxy requirements before service start.
Fixed
- Atomic Shell Configuration Restoration: Exclude
~/.config/omarchy/shell.jsonfrom bulk archive extractions and injectluneth90.omamigrateinto the JSON structure prior to writing to disk. This prevents Quickshell's inotify watcher from detecting a transient missing state and hot-unloading OmaMigrate during active restoration. - Active Agent Process Lock Guard: Refuse restoration while supported AI CLI agents are actively executing, preventing race conditions and database/WAL corruption.
- Package Manager Resilient Fallback: Split native packages and AUR packages during restore, preventing pacman transaction aborts when
yayis absent. - Structured Path Adaptation: Ensure old username paths in session files and configs are accurately translated to the current
$HOMEwithout altering user prompt or response content.