Users of Swift Crypto should update to 5.1.2 as soon as practically possible, which addresses the following security issues:
KDF.Scrypt.deriveKey does not enforce the provided maxMemory parameter
An attacker who can choose the scrypt cost parameters an application derives keys with may be able to exhaust memory on the host, even when the application passes maxMemory to bound it.
Affected versions: >= 4.0.0, <= 5.1.1
For more details, please read the GitHub Security Advisory: KDF.Scrypt.deriveKey does not enforce the provided maxMemory parameter · Advisory · apple/swift-crypto · GitHub
Thanks to Karan Kurani for reporting this issue.
X25519 key agreement accepts low-order public keys and returns an all-zero shared secret
An attacker who can present a peer public key for X25519 key agreement may be able to force the shared secret to a known all-zero value, and so derive the same key material as their victim.
Affected versions: <= 5.1.1
For more details, please read the GitHub Security Advisory: X25519 key agreement accepts low-order public keys and returns an all-zero shared secret · Advisory · apple/swift-crypto · GitHub
Thanks to Darshan U for reporting this issue.