Skip to content

Commit 64574cb

Browse files
Add [NonDebuggable] to Cryptography Management encrypt/decrypt procedures
The EncryptText/Encrypt and Decrypt procedures in the Cryptography Management system app (codeunit 1266) and its implementation (codeunit 1279) lacked the [NonDebuggable] flag. This allowed cleartext input and return values to be extracted with a debugger, compromising the confidentiality of encrypted and decrypted data. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 709c74b commit 64574cb

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/System Application/App/Cryptography Management/src/CryptographyManagement.Codeunit.al

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ codeunit 1266 "Cryptography Management"
2525
/// </summary>
2626
/// <param name="InputString">The value to encrypt.</param>
2727
/// <returns>Encrypted value.</returns>
28+
[NonDebuggable]
2829
procedure EncryptText(InputString: Text[215]): Text
2930
begin
3031
exit(CryptographyManagementImpl.Encrypt(InputString));
@@ -35,6 +36,7 @@ codeunit 1266 "Cryptography Management"
3536
/// </summary>
3637
/// <param name="EncryptedString">The value to decrypt.</param>
3738
/// <returns>Plain text.</returns>
39+
[NonDebuggable]
3840
procedure Decrypt(EncryptedString: Text): Text
3941
begin
4042
exit(CryptographyManagementImpl.Decrypt(EncryptedString));

src/System Application/App/Cryptography Management/src/CryptographyManagementImpl.Codeunit.al

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ codeunit 1279 "Cryptography Management Impl."
3131
EncryptionCheckFailErr: Label 'Encryption is either not enabled or the encryption key cannot be found.';
3232
EncryptionIsNotActivatedQst: Label 'Data encryption is not activated. It is recommended that you encrypt data. \Do you want to open the Data Encryption Management window?';
3333

34+
[NonDebuggable]
3435
procedure Encrypt(InputString: Text[215]): Text
3536
begin
3637
AssertEncryptionPossible();
@@ -39,6 +40,7 @@ codeunit 1279 "Cryptography Management Impl."
3940
exit(System.Encrypt(InputString));
4041
end;
4142

43+
[NonDebuggable]
4244
procedure Decrypt(EncryptedString: Text): Text
4345
begin
4446
AssertEncryptionPossible();

0 commit comments

Comments
 (0)