Skip to content
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

fix: EXPOSED-293 Logger prints plaintext value of encryptedVarchar #2009

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

bog-walk
Copy link
Member

@bog-walk bog-walk commented Feb 24, 2024

When using either encryptedVarchar() or encryptedBinary() columns with an enabled logger, the logger output reveals the actual unencrypted string values for the statement parameters, rather than the encrypted value sent to the database.

This occurs because both columns delegate to the default super.nonNullValueToString() which just processes the provided input values without encryption.

// log before
INSERT INTO stringtable (address, city, "name") VALUES ('TestAddress', TestCity, 'TestName')

// log after
INSERT INTO stringtable (address, city, "name") VALUES ('NCoXob9KL2ffCyERcyae5w==', wVGt2pST+xCE8IvkWF4pjxJt1/t13mNJpgJ+VZU9fOc=, 'JIYzcRaeV0rjc7/9BteruZ+LWykJJQ+Nn9Kz18SWuvg0Opi8ZfD0Cw==')

When using either encryptedVarchar() or encryptedBinary() columns with an enabled
logger, the logger output includes the actual unencrypted string values for the
statement parameters.

This occurs because both columns delegate to super.nonNullValueToString() which
just processes the provided string value without encryption.
@bog-walk bog-walk requested review from e5l and joc-a February 26, 2024 01:43
Comment on lines +16 to +19
<logger name="Exposed" level="INFO" additivity="false">
<appender-ref ref="ASYNC"/>
</logger>
</configuration>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has been added to the test directory to set default log level to INFO. Otherwise, creating a LogCaptor in any unit test spams the console with debug logs from all tests in suite.

@bog-walk bog-walk merged commit 39c2267 into main Feb 26, 2024
5 checks passed
@bog-walk bog-walk deleted the bog-walk/fix-encrypted-logs branch February 26, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants