You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constplaintext: Buffer[]=[]letmessageHeader: MessageHeader|false=falsestream.once('MessageHeader',(header: MessageHeader)=>{messageHeader=header}).on('data',(chunk: Buffer)=>plaintext.push(chunk))// This will check both Uint8Array|Bufferif(ciphertextinstanceofUint8Array){stream.end(ciphertext)}elseif(typeofciphertext==='string'){stream.end(Buffer.from(ciphertext,encoding))}elseif(ciphertext.readable){ciphertext.pipe(stream)}else{thrownewError('Unsupported ciphertext format')}awaitfinishedAsync(stream)if(!messageHeader)thrownewError('Unknown format')return{plaintext: Buffer.concat(plaintext),
messageHeader,}
The Buffer.concat(plaintext) will result in a new Buffer. However, the const plaintext: Buffer[] = [] seem not zero-out where sensitive data might remain in memory until gc.
The text was updated successfully, but these errors were encountered:
Thank you for cutting this issue. We have looked at this matter closely.
An attacker would need access to the Node Process's memory to exploit this.
Such privileged access grants an adversary a number of other exploits.
We believe that any Threat Model that considers the Node Process’ memory access vulnerable needs a more holistic solution than just zeroing out the buffer.
However, what you have written is accurate,
therefore we are going to leave this open as the following Feature Request:
The AWS Encryption SDK for JavaScript SHOULD use a more privileged memory allocation for the plaintext Buffer in Decrypt.ts.
Much Obliged,
AWS Crypto Tools
texastony
changed the title
Zero-out intermediate array of plaintext buffer in decrypt function.
Use more privileged memory allocation for the plaintext Buffer in Decrypt
Jun 30, 2023
Problem:
https://github.com/aws/aws-encryption-sdk-javascript/blob/master/modules/decrypt-node/src/decrypt.ts
The
Buffer.concat(plaintext)
will result in a new Buffer. However, theconst plaintext: Buffer[] = []
seem not zero-out where sensitive data might remain in memory until gc.The text was updated successfully, but these errors were encountered: