issue #3958 - replace AES encryption with Hashids#3969
Merged
Conversation
The encryption was used to obscure the incrementing job id and not as a secure cryptographic function. However, it was flagged in CodeQL as insecure and the use of "encryption" in the code made it less clear that repeatable encryption/decryption was expected/desired (and not a vulnerability). Here I replaced the encryption with the use of a separate library called "Hashids" which is fit-for-purpose without implying imaginary security; its just a convenient way to convert between numeric values and short, unique string values for use in URLs. Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
lmsurpre
commented
Sep 13, 2022
Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
in code, sample configs, and docs Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
4aa643d to
258f076
Compare
punktilious
reviewed
Sep 13, 2022
punktilious
reviewed
Sep 13, 2022
punktilious
reviewed
Sep 13, 2022
Now that we can encode and decode the job with minimal effort, the caching done by JobIdEncodingTransformer was overkill. Additionally, because the encoded ids are simpler, I don't think we need to support raw job ids any more. Thus, instead of defaulting to null (i.e. no encoding), the new default will be a string of "" and thus all job ids will always be encoded. Signed-off-by: Lee Surprenant <lmsurpre@merative.com>
39d296a to
accdc10
Compare
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.
The encryption was used to obscure the incrementing job id and not as a secure cryptographic function.
However, it was flagged in CodeQL as insecure and the use of "encryption" in the code made it less clear that repeatable encryption/decryption was expected/desired (and not a vulnerability).
Here I replaced the encryption with the use of a separate library called "Hashids" which is fit-for-purpose without implying imaginary security; its just a convenient way to convert between numeric values and short, unique string values for use in URLs.
Signed-off-by: Lee Surprenant lmsurpre@merative.com