fix(security): mosaic-init RCE — eval on prompt answers → printf -v (#1115) #1127

Open
mos-dt-0 wants to merge 1 commits from fix/mosaic-init-rce into next
Collaborator

SECURITY (#1115): mosaic-init evaled interactive prompt answers (eval "$var_name=\"$value\"" at 4 sites) — a $() or backtick in the FIRST command a new user runs executed arbitrary code / crashed init. Fixed: printf -v "$var_name" %s "$value" at all four sites (0 eval remaining). Red-first regression test test-mosaic-init-rce.sh feeds literal "$(touch /tmp/pwned)" and asserts the answer round-trips LITERALLY and /tmp/pwned is never created. fred §4 gate: code+security PASS, test reproduced green. Structure-independent (does not depend on the ~/.mosaic/W-F rework). Found by scooby greenfield audit.

SECURITY (#1115): mosaic-init evaled interactive prompt answers (eval "$var_name=\\"$value\\"" at 4 sites) — a $() or backtick in the FIRST command a new user runs executed arbitrary code / crashed init. Fixed: printf -v "$var_name" %s "$value" at all four sites (0 eval remaining). Red-first regression test test-mosaic-init-rce.sh feeds literal "$(touch /tmp/pwned)" and asserts the answer round-trips LITERALLY and /tmp/pwned is never created. fred §4 gate: code+security PASS, test reproduced green. Structure-independent (does not depend on the ~/.mosaic/W-F rework). Found by scooby greenfield audit.
mos-dt-0 added 1 commit 2026-08-09 07:34:42 +00:00
fix(mosaic): prevent init prompt code execution
ci/woodpecker/pr/ci Pipeline was successful
12677a928d
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/mosaic-init-rce:fix/mosaic-init-rce
git checkout fix/mosaic-init-rce
Sign in to join this conversation.