aws / aws/aws-encryption-sdk-java

CryptoOutputStream outputs invalid message when used to encrypt empty plaintext

オープン
#218 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Java
スター
240
フォーク
125
PR マージ指標
30日以内にマージされた PR はありません

説明

In order to perform the "encrypt a zero length plaintext" using a CryptoOutputStream, the correct setup would be to create the CryptoOutputStream, don't write any bytes to it, then immediately call `close()`.

This results in the CryptoOutputStream only writing bytes for an empty final frame (and possibly a footer). It does not write any header bytes, resulting in an invalid message that cannot be parsed by any AWS Encryption SDK implementation.

This should be fixed such that this use case will correctly write header bytes before the message body and footer, resulting in a message that can be successfully decrypted into the plaintext "".

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

CryptoOutputStream から始め、平文を書き込まずに close() を呼び出すケースを再現します。空の最終フレームがどのように出力されるかを追跡し、結果のメッセージを AWS Encryption SDK の実装で解析および復号して、空の平文になることを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
cryptography, security
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。