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

URL encoding clashes with base64 encoding values for dbCryptConfig [JDBC610] #641

Closed
firebird-automations opened this issue Jan 19, 2020 · 10 comments

Comments

@firebird-automations
Copy link

Submitted by: @mrotteveel

The URL encoding added in JDBC604 conflicts with the base64 encoding support for dbCryptConfig, as URL decoding will transform the + allowed in base64 to a space, which results in an incorrect decoding or a decoding error.

We need to find a way to allow both to coexist.

Options:
1. Do not URL decode values starting with prefix base64: (under the assumption that if the `:` is not encoded as `%3a`, the remainder of the value is also not URL encoded)
2. Reinstate the + after decoding by replacing any ` ` (0x20) with `+`, possibly error prone
3. Switch to Base64.getUrlDecoder() (which would be an incompatible change, and would be problematic with Java 7 compatibility)
4. Explicitly document this, and recommend people to escape the `+` using `%2b`

Option 4 is the simplest and most standard, option 1 is probably the most flexible.

Commits: dd6e601 0b8d483

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 4 [ 10441 ]

Fix Version: Jaybird 4.0.0 [ 10903 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

description: The URL encoding added in JDBC604 conflicts with the base64 encoding support for dbCryptConfig, as URL decoding will transform the + allowed in base64 to a space, which results in an incorrect decoding or a decoding error.

We need to find a way to allow both to coexist.

Options:
1. Do not URL decode values starting with prefix base64: (under the assumption that if the `:` is not encoded as `%3a`, the remainder of the value is also not URL encoded)
2. Reinstate the + after decoding by replacing any ` ` (0x20) with `+`, possibly error prone
3. Switch to Base64.getUrlDecoder() (which would be an incompatible change, and would be problematic with Java 7 compatibility)

Option 1 is probably the least worst option

=>

The URL encoding added in JDBC604 conflicts with the base64 encoding support for dbCryptConfig, as URL decoding will transform the + allowed in base64 to a space, which results in an incorrect decoding or a decoding error.

We need to find a way to allow both to coexist.

Options:
1. Do not URL decode values starting with prefix base64: (under the assumption that if the `:` is not encoded as `%3a`, the remainder of the value is also not URL encoded)
2. Reinstate the + after decoding by replacing any ` ` (0x20) with `+`, possibly error prone
3. Switch to Base64.getUrlDecoder() (which would be an incompatible change, and would be problematic with Java 7 compatibility)
4. Explicitly document this, and recommend people to escape the `+` using `%2b`

Option 4 is the simplest and most standard, option 1 is probably the most flexible.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Chose option 4: documented issue in release notes

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Documentation for 3.0.9 needs to be updated as well.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Reopened [ 4 ]

resolution: Fixed [ 1 ] =>

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 3.0.9 [ 10917 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Updated 3.0.9 release notes

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Reopened [ 4 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment