Repository navigation
Description
Summary
mise's default decryption path, sops.rops = true, refuses any SOPS file that contains an empty-string value. The sops CLI reads the same file without complaint, so sops.rops = false is the only way to use such a file with mise.
This is not an exotic shape: sops deliberately leaves empty values unencrypted. aes/cipher.go's Encrypt returns early for isEmpty(plaintext), so a key whose value is "" is written to the SOPS file as a bare "" with no ENC[ prefix. rops requires every leaf to start with ENC[ and rejects the whole file.
Any file with a placeholder key - a credential not yet issued, a token blanked out rather than deleted - hits this.
The root cause is already fixed upstream in rops, but the fix has never been released, so mise cannot pick it up with a version bump. See Cause.
Environment
- Reproduced on mise 2026.9.3, 2026.10.6 and 2026.10.15 (latest release), all
linux-x64, in both YAML and JSON. - Source checked against
v2026.10.15(597c1897dfed28d1c0dea9f98fba581059e42cd3). - Container:
debian:stable-slimwith the mise binary bind-mounted. Needs network; it installs sops 3.13.3 and age 1.2.1 through mise.
Reproduction
rops-repro.sh:
#!/bin/bash
# Minimal repro: a sops file with one empty-string value.
# The sops CLI reads it; mise's built-in rops decryptor refuses it.
set -u
export HOME=/root MISE_DATA_DIR=/root/.local/share/mise
export PATH=/usr/local/bin:/usr/bin:/bin MISE_YES=1 MISE_MINIMUM_RELEASE_AGE=0
mkdir -p /root/.config/mise /tools /proj
printf '[tools]\nsops = "3.13.3"\nage = "1.2.1"\n' > /root/.config/mise/config.toml
mise install --quiet >/dev/null 2>&1
cp "$(mise which sops)" "$(mise which age-keygen)" /tools/
/tools/age-keygen -o /root/key.txt 2>/dev/null # throwaway key
PUB=$(sed -n 's/.*public key: //p' /root/key.txt)
# One real secret, one key whose value is the empty string.
printf 'REAL_SECRET: hello\nEMPTY_TOKEN: ""\n' > /tmp/plain.yaml
/tools/sops encrypt --age "$PUB" --input-type yaml --output-type yaml \
/tmp/plain.yaml > /proj/secrets.yaml
printf '{"REAL_SECRET":"hello","EMPTY_TOKEN":""}\n' > /tmp/plain.json
/tools/sops encrypt --age "$PUB" --input-type json --output-type json \
/tmp/plain.json > /proj/secrets.json
echo "=== what sops wrote: the empty value is left verbatim, with no ENC prefix ==="
sed -n '1,2p' /proj/secrets.yaml | cut -c1-72
printf '[tools]\nage = "1.2.1"\n' > /root/.config/mise/config.toml
export MISE_SOPS_AGE_KEY_FILE=/root/key.txt
cd /proj
for f in secrets.yaml secrets.json; do
printf '[env]\n_.file = "%s"\n' "$f" > /proj/mise.toml
mise trust /proj/mise.toml >/dev/null 2>&1
for r in true false; do
echo "--- $f sops.rops=$r (mise $(mise --version | head -1)) ---"
MISE_SOPS_ROPS=$r PATH=/tools:$PATH mise env 2>&1 \
| grep -vE '^export PATH' | grep -E 'ERROR|^export' | head -5
done
donerops-drive.sh:
#!/bin/bash
# usage: ./rops-drive.sh <path-to-mise-binary>
docker run --rm --pids-limit 400 --memory 2g \
-v "$(readlink -f "$1")":/usr/local/bin/mise:ro -v "$PWD/rops-repro.sh":/r.sh:ro \
debian:stable-slim bash -c \
'apt-get update -qq >/dev/null 2>&1; apt-get install -y -qq ca-certificates >/dev/null 2>&1; bash /r.sh'./rops-drive.sh ./mise-2026.10.15Results
The file sops writes, with the empty value left verbatim:
REAL_SECRET: ENC[AES256_GCM,data:bqbozMY=,iv:GHmmSfzJFGomf2a2sJ1QWjttEAD...
EMPTY_TOKEN: ""
Identical on all three versions, for both secrets.yaml and secrets.json:
--- secrets.yaml sops.rops=true ---
mise ERROR failed to decrypt sops file
mise ERROR invalid encrypted map format; unable to parse encrypted value components: missing ENC prefix
mise ERROR unable to parse encrypted value components: missing ENC prefix
mise ERROR missing ENC prefix
--- secrets.yaml sops.rops=false ---
export EMPTY_TOKEN=''
export REAL_SECRET=hello
| mise | sops.rops = true |
sops.rops = false |
|---|---|---|
| 2026.9.3 | missing ENC prefix, YAML and JSON |
both keys exported |
| 2026.10.6 | missing ENC prefix, YAML and JSON |
both keys exported |
| 2026.10.15 | missing ENC prefix, YAML and JSON |
both keys exported |
Secondary: with sops.strict = false the file vanishes silently
sops.strict defaults to true, so the failure above is loud. With strict = false, the same run exports nothing at all - not even REAL_SECRET, which the CLI decrypts fine - and prints no warning:
--- secrets.yaml sops.rops=true MISE_SOPS_STRICT=false ---
(no output)
The non-strict branch logs at debug! only, so a config that sets strict = false for an unrelated reason turns this into silently missing environment variables rather than an error.
Cause
- mise parses the file directly through rops at
src/sops.rs:86-90. - The non-strict swallow is at
src/sops.rs:105-112. - mise depends on
rops = "0.1", locked to0.1.7. - The defect is rops', not mise's: Empty-string and null leaves break sops compatibility (both decrypt and encrypt) gibbz00/rops#298, "Empty-string and null leaves break sops compatibility", with exactly this error text.
- It was fixed by fix: skip empty string as done in SOPS gibbz00/rops#299, "fix: skip empty string as done in SOPS", merged 2026-05-17.
- But rops has published no release since
0.1.7, tagged 2026-02-14 - three months before that fix merged.https://crates.io/api/v1/crates/ropsstill reportsmax_version: 0.1.7, newest0.1.7, published 2026-02-14. So the fix is on ropsmainand unreachable from crates.io, androps = "0.1"cannot resolve to it.
Suggested fix
Any of these would do, roughly in order of preference:
- Ask gibbz00/rops for a
0.1.8release carrying bug: fix automatic plugin install onrtx i nodejs@latest#299, then bump the dependency. Cleanest, but it is not mise's to schedule. - Pin the dependency to a git revision past bug: fix automatic plugin install on
rtx i nodejs@latest#299 until a release exists. - Fall back to the
sopsCLI when rops fails to parse a file, rather than failing. The CLI is already implemented in the same function forsops.rops = false, so this is a fallback rather than new code. That also covers whatever other rops/sops format divergences remain. - At minimum, make the non-strict path warn rather than
debug!when decryption fails, and say in thesops.ropssetting docs that empty values needsops.rops = false. This one is worth doing regardless of 1-3, since silently dropping secrets is the worst of the outcomes above.
Related
- sops CLI decryption re-enters mise through its own
sopsshim when the configured sops version is not installed (unbounded process recursion) #14799 - the other sops bug I filed today. The two interact badly: an empty value forcessops.rops = false, andsops.rops = falseis the precondition for the shim recursion in sops CLI decryption re-enters mise through its ownsopsshim when the configured sops version is not installed (unbounded process recursion) #14799. A user who hits this one is pushed onto the path that has the other. - Empty-string and null leaves break sops compatibility (both decrypt and encrypt) gibbz00/rops#298 and fix: skip empty string as done in SOPS gibbz00/rops#299 - the root cause and its unreleased fix.
- discussion rops fails to parse age key files with multiple keys: invalid Bech32 encoding #8262 -
rops fails to parse age key files with multiple keys, another rops/sops divergence surfacing through mise.
AI disclosure: an AI agent (Claude Code) investigated this and wrote this report. The container runs above are its own output on an x86-64 Linux host, and the source, crates.io and rops references were checked against the commits and endpoints cited.
Activity