Conversation
- Report bad request input as 400/412 instead of a NumberFormatException
500: the ${int:...} query parameter (TableQueries), the update revision
(Generic/Mapped/MSSQL table handlers) and the Activiti priority filter
- Report bad numeric configuration by name: ClusterConfig (also accepts
JSON numbers), InstanceState, ConfigMacroUtil time tokens, CryptoUtil
values and the boot properties read by ClientCertAuthModule,
HealthService, RepoJobStore, TaskScannerService and smartevent Name
- Read the licence file and the Activiti diagrams completely instead of
trusting a single read()/available()
- RemoteCommandScope: report failed rename/mkdir on the console
- DBHelper: use Runtime.version(); Link: add toString() for the sync logs;
print arrays with Arrays.toString
- Rename locals that shadowed fields in ClusterManager, SyncOperation and
SchedulerConfig
Resolves CodeQL alerts #654-#667, #672, #675, #682-#703.
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.
Summary
First of the note-level CodeQL batches — the findings that touch correctness:
uncaught-number-format-exception(39),ignored-error-status-of-call(5),call-to-object-tostring(2),print-array(1),local-shadows-field(3). 38 fixed here, 12 dismissed as false positives.Request input that turned into a 500 (bug)
TableQueries${int:…}query parameter is now aBadRequestExceptionnaming the parameter and the value, instead of an unhandledNumberFormatException.GenericTableHandler,MappedTableHandler,MSSQLTableHandler_revon update is aPreconditionFailedException(it can never match the stored revision) via a sharedparseRevision.TaskInstanceResource,TaskInstanceHistoryResourcepriorityquery filter →IllegalArgumentExceptionnaming the parameter (mapped by the existing handler).Configuration and boot properties: fail with the setting's name
ClusterConfigJsonValueExceptionwith the JSON pointer (previouslyLong.parseLong(value.asString())also rejected genuine numbers with "Expecting a java.lang.String").InstanceStatetimestamp(map, key, default)helper; a corrupt persisted value names the field.ConfigMacroUtil.getTimePeriod${Time.now + …}token.CryptoUtilClientCertAuthModule,HealthService,RepoJobStore,TaskScannerService,smartevent.NameNamedid the parse in a static initialiser, where a typo surfaced as anExceptionInInitializerErrorwith no hint of the cause.Other
ignored-error-status-of-call— bugUpdateManagerImpl,ProcessInstanceResource,ProcessDefinitionResourceInputStream.read(buf)/new byte[is.available()]can return a partial read; the licence file and the process diagrams are now read withFiles.readAllBytes/readAllBytes().RemoteCommandScope(CLI)renameTo/mkdirare reported on the console instead of being ignored.DBHelperDouble.parseDouble(System.getProperty("java.specification.version"))→Runtime.version().feature().Link,TargetSyncOperation,DBHelperLinkgets atoString()(the recon log lines printedLink@1a2b3c); the index-property array is printed withArrays.toString.local-shadows-fieldClusterManager,SyncOperation,SchedulerConfigDismissed as false positives (12): #668–#671, #673, #674, #676–#681 — the paging parameters parsed in
renderQueryFilterare produced byTableQueries.query()viaString.valueOf(int)from the typedQueryRequestaccessors (which also overwrite any same-named additional parameter).Test plan
TableQueriesTest,GenericTableHandlerTest,ClusterConfigTest(incl.InstanceState),ConfigMacroUtilTest;CryptoUtilTest+1 — all failed before the change (wrong exception type, missing name in the message, or did not compile)