New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rijndael encryption service: Possible data corruption when using rotating encryption keys v5.2.x #2998
Conversation
aff34f5
to
157d655
Compare
157d655
to
9b3bdec
Compare
079c2b1
to
74b6780
Compare
abf7005
to
afb8207
Compare
IDictionary<string, byte[]> keys; | ||
IList<byte[]> decryptionKeys; // Required, as we decrypt in the configured order. | ||
|
||
public RijndaelEncryptionService( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonCropp @indualagarsamy What do you think of this? I don't like this dependency of objects and configuration but don't know how to improve it. I read something about abstract factory but I don't know if this should be applied at this implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ramonsmits sorry i dont understand what the problem is
…tion data and Base64 support for encryption keys.
…Timeout' into hotfix-5.2.9
afb8207
to
d3f80b0
Compare
Summary
We have discovered a scenario with the current implementation of property encryption that might lead to data corruption (this is NOT a security issue).
The issue affects all versions of NServiceBus that have the Rijndael encryption service when multiple encryption keys are used.
Along with fixing this bug, we are also taking this opportunity to improve the capability of the property encryption feature.
Issues
Changes
In this patch release, we addressed these issues:
How to know if you might be affected
You might be affected if you use Rijndael message property encryption and have multiple keys configured at the same time, or you change your encryption keys over time.
The probability of data corruption increases for failed messages that remain in the error queue when the security key changes. When an old message is retried, get decrypted with the newer key first. If this attempt succeeds, then the decrypted data will get corrupted.
Upgrade guidance
The Encryption key identifiers upgrade
document describes:
Documentation
Background
Every time some value is encrypted we make use of a new random initialization vector (IV). It can happen that an IV in combination with a piece of data can be successfully decrypted with an incorrect key, resulting in corrupted data. In such a case there is no way of knowing if data is corrupt or not.
Connects to Particular/PlatformDevelopment#423
Fixes: #2994 #3017 #3018 #3019