Bouncy Castle fixes an incorrect message comparison in ISO 9796-2 PSS verification
The lightweight Java ISO9796d2PSSSigner could accept a valid signature for a different message of the same length when the difference was in the part recovered from the signature. Bouncy Castle reports the fix in version 1.87.
Broken implementation. The underlying math is not broken by this. The failure is in code, hardware, or how the primitive is used.
Background
ISO 9796-2 PSS with message recovery lets a verifier reconstruct some message bytes from the signature. When a caller supplies those bytes too, the verifier has to check that they agree. In the affected lightweight class, the recovered bytes replaced the supplied bytes before the comparison. The check could therefore succeed even though the caller had supplied different data.
The vendor's disclosure concerns this message-recovery class in the lightweight Java API. The relevant question for an application is whether its verifier uses that class. Ordinary RSASSA-PSS verification uses a different signature format.
Sources
- primary disclosureBouncy Castle Java 1.87 tagged release notesBouncy Castle, github.com
- primary disclosureBouncy Castle Java release downloads and notesBouncy Castle, bouncycastle.org