Safeguard
Application Security•

ASVS 5.0 V11.4.3: Pick Hashes With Enough Output Bits

ASVS V11.4.3 sets hash output minimums: 256 bits when collision resistance matters, 128 bits for second preimage only. Check signatures and integrity checks.

Safeguard Security Team
1 min read

ASVS 5.0 V11.4.3 (Level 2) requires hash functions used in signatures, data authentication or integrity checks to be collision resistant with suitable length. If collision resistance matters, output must be at least 256 bits. If only second preimage resistance matters, 128 bits is enough.

Why it matters

Collisions let an attacker craft two different inputs with the same digest, which breaks signatures and file integrity checks. SHA-1 and MD5 collisions are practical.

How to implement it

Default to SHA-256, SHA-384, SHA-512 or SHA-3 for signatures and integrity. A truncated hash is fine only if the result stays above the bar for the property you need.

sum := sha256.Sum256(data)

For checksums published with releases, use SHA-256 and sign the checksum file.

How to test it

Grep for md5, sha1, SHA1withRSA and truncation calls. Inspect signing configs and certificate signature algorithms with openssl x509 -text.

Common mistakes

  • Using SHA-1 for git style content addressing in a security role
  • Truncating a digest to 64 bits for convenience
  • Assuming a non security checksum cannot be abused

Quick check

Minimum output for collision resistance?

256 bits.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.