T09 · Insecure Skill Coding Practices
- Location
scripts/verify.sh:30- Finding
Verification Trusts an Attacker-Supplied Public Key
- Content
View full analysis
Vulnerability Details
File Location:
scripts/verify.sh:30-40
Vulnerability Type: Untrusted key acceptance / missing identity binding
Risk Level: MediumVulnerable Code
bash # Create public key file cat > "$TMPDIR/pubkey.pem" << EOF -----BEGIN PUBLIC KEY----- ${PUBKEY} -----END PUBLIC KEY----- EOF # Verify if openssl pkeyutl -verify -pubin -inkey "$TMPDIR/pubkey.pem" \ -in "$TMPDIR/payload.txt" -sigfile "$TMPDIR/sig.bin" 2>/dev/null; then echo "✅ Signature Verified Successfully"Technical Analysis
The verifier accepts the public key from the same untrusted input that provides the content and signature. Cryptographic verification therefore proves only that the supplied signature was created by the private key corresponding to the supplied public key. It does not prove that this key belongs to the claimed Moltbook identity.
Although
SKILL.mdrecommends publishing a public key through a profile and another platform, the verification script does not load a previously trusted key, compare key fingerprints, or otherwise bind the supplied key to an authenticated identity.Attack Path
- An attacker generates an independent Ed25519 keypair.
- The attacker creates content impersonating another Moltbook identity.
- The attacker signs that content with the attacker-controlled private key.
- The attacker supplies the resulting signature and attacker-controlled public key to
verify.sh. - The script verifies the internally consistent signature and reports
Signature Verified Successfully. - A user may interpret this result as proof that the content came from the impersonated identity, even though no identity binding was checked.
Impact Assessment
An attacker does not gain operating-system privileges, access to the victim's private key, or execution rights. However, the attacker can produce arbitrary posts that pass the provided verification workflow when ...[truncated 275 chars]
- Remediation
View remediation
Remediation Suggestions
- Require a public-key file or fingerprint obtained independently through a trusted channel rather than trusting a key embedded in the post.
- Maintain an explicit mapping between Moltbook identities and trusted public-key fingerprints.
- Compare the supplied key's fingerprint with the trusted fingerprint before verifying the signature.
- Display both the verified identity and complete key fingerprint in the success output.
- Distinguish between “signature is mathematically valid” and “signer identity is authenticated.”
- Reject unknown keys by default or require an explicit trust-on-first-use enrollment step with clear warnings.
- Consider changing the interface to accept a trusted key file:
bash ./scripts/verify.sh "$CONTENT" "$TIMESTAMP" "$SIGNATURE" /path/to/trusted-pubkey.pemThe verifier should use that trusted file directly instead of reconstructing a key from post-controlled input.
