github-advanced-security[bot] commented on code in PR #17576:
URL:
https://github.com/apache/dolphinscheduler/pull/17576#discussion_r2428247686
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowDefinitionServiceImpl.java:
##########
@@ -459,12 +459,22 @@
private List<TaskDefinitionLog> generateTaskDefinitionList(String
taskDefinitionJson) {
try {
List<TaskDefinitionLog> taskDefinitionLogs =
JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class);
+
if (CollectionUtils.isEmpty(taskDefinitionLogs)) {
log.error("Generate task definition list failed, the given
taskDefinitionJson is invalided: {}",
taskDefinitionJson);
throw new ServiceException(Status.DATA_IS_NOT_VALID,
taskDefinitionJson);
}
+
+ Set<String> taskNameSet = new HashSet<>();
for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) {
+ if (!taskNameSet.add(taskDefinitionLog.getName())) {
+ log.error(
+ "Generate task definition list failed, the given
task definition name is duplicate, taskName: {}, taskDefinition: {}",
+ taskDefinitionLog.getName(), taskDefinitionLog);
Review Comment:
## Log Injection
This log entry depends on a [user-provided value](1).
This log entry depends on a [user-provided value](2).
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/5557)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]