Repository navigation
Conversation
Disallow setting proto descriptors via a local file path to prevent arbitrary file reads on the host filesystem. The `SET PROTO_DESCRIPTORS_FILE_PATH` and `SHOW VARIABLE PROTO_DESCRIPTORS_FILE_PATH` client-side statements allowed reading arbitrary files from the local filesystem of the host executing the application. This posed a security risk of local file inclusion, unintended information disclosure, and potential out-of-memory errors from large files. Attempting to execute `SET PROTO_DESCRIPTORS_FILE_PATH` or `SHOW VARIABLE PROTO_DESCRIPTORS_FILE_PATH` will now fail with an `INVALID_ARGUMENT` error explaining the alternative options. Workaround for existing users: Applications that need to register proto descriptors can load the descriptor file in their application and use one of the following alternatives: 1. Encode the descriptor bytes as a base64 string and execute the `SET PROTO_DESCRIPTORS = '<base64_encoded_proto_descriptors>'` statement instead. 2. If using the Java Connection API directly, pass the descriptor bytes to `connection.setProtoDescriptors(byte[])`.
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes support for setting and showing proto descriptors via a file path (PROTO_DESCRIPTORS_FILE_PATH), updating the connection implementation to throw an INVALID_ARGUMENT exception and advising users to use base64-encoded strings instead. The review feedback points out formatting issues in ClientSideStatementsTest.sql where @expect EXCEPTION annotations are separated from their target statements by several blank lines, which could cause test parser issues or reduce readability.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disallow setting proto descriptors via a local file path to prevent arbitrary file reads on the host filesystem.
The
SET PROTO_DESCRIPTORS_FILE_PATHandSHOW VARIABLE PROTO_DESCRIPTORS_FILE_PATHclient-side statements allowed reading arbitrary files from the local filesystem of the host executing the application. This posed a security risk of local file inclusion, unintended information disclosure, and potential out-of-memory errors from large files.Attempting to execute
SET PROTO_DESCRIPTORS_FILE_PATHorSHOW VARIABLE PROTO_DESCRIPTORS_FILE_PATHwill now fail with anINVALID_ARGUMENTerror explaining the alternative options.Workaround for existing users:
Applications that need to register proto descriptors can load the descriptor file in their application and use one of the following alternatives:
SET PROTO_DESCRIPTORS = '<base64_encoded_proto_descriptors>'statement instead.connection.setProtoDescriptors(byte[]).