The decrypted gocryptfs passphrase is written to the fixed, predictable path <code>/tmp/aienos-unlock-pass</code>. <code>age -o</code> creates the file with mode <code>0666 & ~umask</code> (typically world-readable), so any local user on the Spark can read the master passphrase for the encrypted store during the window between decryption and <code>rm -f</code>. Additionally, the surrounding comments claim the passfile "lives only in RAM", but <code>/tmp</code> is not guaranteed to be a tmpfs on the live host, so the plaintext key may be written to the NVMe and remain recoverable after deletion. Use <code>mktemp</code> under a verified tmpfs with a restrictive umask (or pipe the passphrase to <code>gocryptfs</code> via <code>-passfile /dev/stdin</code>) instead of a fixed world-readable path.
Use a securely created temporary passfile instead of a fixed path, with restrictive permissions and guaranteed cleanup.</p> <p>Best fix in this snippet:</p> <ul> <li>In <code>scripts/collect_recovery_boot_evidence.sh</code> around lines 149–157: <ul> <li>Create a temp file with <code>mktemp</code> (unique, non-predictable path).</li> <li>Temporarily set <code>umask 077</code> while creating/decrypting to ensure owner-only access.</li> <li>Use that temp file for both <code>age -o</code> and <code>gocryptfs -passfile</code>.</li> <li>Always remove the temp file afterward.</li> </ul> </li> <li>Keep behavior/functionality identical: still decrypt once, mount read-only, check result, then cleanup.</li> </ul> <p>This avoids fixed-path races and reduces plaintext exposure without changing script flow.