Skip to main content
Menu
Advisories

Out-of-bounds write in padded block cipher decryption in AWS-LC

GHSA-XV35-XP83-5WRFPublished Updated GitHub

Description

aws-lc-rs is a Rust cryptographic library that uses AWS-LC, through the aws-lc-sys and aws-lc-fips-sys crates, for its cryptographic operations. An issue exists where, under certain circumstances, StreamingDecryptingKey could write past the minimum accepted output buffer size when ciphertext was decrypted with a padded block cipher across multiple calls.

Impact

This issue affects applications that use StreamingDecryptingKey with cbc_pkcs7 or ecb_pkcs7, call update or less_safe_update more than once, and pass an output buffer of the minimum accepted size. In that case, update can write 1 byte past the end of the buffer, and less_safe_update can write up to one block (16 bytes for AES) past it.

Single-call decryption (one update followed by finish) and the CTR and CFB modes are not affected. aws-lc-sys and aws-lc-fips-sys contain code from AWS-LC, so applications that call EVP_DecryptUpdate directly through them are affected in the same way as AWS-LC (CVE-[####-#####]).

Customers of AWS services do not need to take action. Applications using aws-lc-rs, aws-lc-sys, or aws-lc-fips-sys should upgrade to the most recent releases.

Impacted versions:

  • aws-lc-rs >= v1.8.0, < v1.17.4
  • aws-lc-rs v1.18.0
  • aws-lc-sys < v0.45.0
  • aws-lc-fips-sys < v0.13.17
  • aws-lc-fips-sys >= v0.14.0, < v0.14.2

Patches

This issue has been addressed in aws-lc-rs v1.17.4 and v1.18.1, aws-lc-sys v0.45.0, and aws-lc-fips-sys v0.13.17 and v0.14.2. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.

Workarounds

Applications that decrypt with a single update call followed by finish, or that provide an output buffer of at least input.len() plus one block, are not affected.

Otherwise, there is no workaround and applications using aws-lc-rs, aws-lc-sys, or aws-lc-fips-sys should upgrade to the most recent releases.

References

If you have any questions or comments about this advisory, we ask that you contact AWS Security via our vulnerability reporting page or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.

Affected versions

References

GitHub · aws/aws-lc-rs