Fix high-severity CodeQL alerts - #169
Merged
Merged
Conversation
- JwtSessionManager: generate the temporary RSA key pair with 2048 bits instead of 1024 (java/insufficient-key-size) - UiAdminHttpApplication: reject jar entries that resolve outside the unpack directory when extracting openig-ui.jar (java/zipslip) - TokenTransformationFilter: do not write the cached issued token to the trace log (java/sensitive-log) - TypoglycemiaDetector: rename the scanned prompt word from `token` to `word` so it is not mistaken for a credential (java/sensitive-log)
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.
Fixes four of the six open
highcode scanning alerts.java/insufficient-key-sizeJwtSessionManager.javakeystoreis configured) is now generated with 2048 bits instead of 1024.java/zipslipUiAdminHttpApplication.javaopenig-ui.jarmoved intounpackJar(InputStream, File); an entry whose canonical path resolves outside the unpack directory now fails withIOException.java/sensitive-logTypoglycemiaDetector.javatoken/tokens→word/wordsinscan().java/sensitive-logTokenTransformationFilter.javaTests added:
JwtSessionManagerTest.shouldGenerateAtLeast2048BitKeyPairWhenNoKeystoreIsConfiguredUiAdminHttpApplicationTest.shouldRejectJarEntryEscapingUnpackDirectory(jar withindex.htmlfollowed by../evil.txt) andshouldUnpackRegularJarEntryIntoUnpackDirectoryNot changed in this PR, to be dismissed in the code scanning UI:
java/weak-cryptographic-algorithminDesKeyGenHandler— Won't fix: the DES key is required for interop with OpenAMReplayPasswd(password capture & replay), which usesSecretKeySpec(key, "DES").java/sensitive-loginTokenTransformationFilter.java:147— False positive: the loggedidTokenis anExpression<String>whosetoString()returns the expression template, not the evaluated token.