Skip to content

Commit

Permalink
chore(vulnerability): Log Injection (High) (#11131)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinakipb2 authored Aug 20, 2024
1 parent b46a963 commit bc79aec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ public Optional<GetTaskResponse> getTaskStatus(@Nonnull String nodeId, long task
try {
return client.tasks().get(taskRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
log.error(
String.format(
"ERROR: Failed to get task status for %s:%d. See stacktrace for a more detailed error:",
nodeId, taskId));
log.error("ERROR: Failed to get task status: ", e);
e.printStackTrace();
}
return Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ CompletableFuture<ResponseEntity<String>> generateSessionTokenForUser(
try {
bodyJson = mapper.readTree(jsonStr);
} catch (JsonProcessingException e) {
log.error("Failed to parse json while attempting to generate session token {}", jsonStr, e);
log.error("Failed to parse json while attempting to generate session token ", e);
return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
}
if (bodyJson == null) {
Expand Down Expand Up @@ -238,7 +238,7 @@ CompletableFuture<ResponseEntity<String>> signUp(final HttpEntity<String> httpEn
try {
Urn inviteTokenUrn = _inviteTokenService.getInviteTokenUrn(inviteTokenString);
if (!_inviteTokenService.isInviteTokenValid(systemOperationContext, inviteTokenUrn)) {
log.error("Invalid invite token {}", inviteTokenString);
log.error("Invalid invite token");
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
}

Expand Down Expand Up @@ -386,7 +386,7 @@ CompletableFuture<ResponseEntity<String>> track(final HttpEntity<String> httpEnt
try {
bodyJson = mapper.readTree(jsonStr);
} catch (JsonProcessingException e) {
log.error("Failed to parse json while attempting to track analytics event {}", jsonStr);
log.error("Failed to parse json while attempting to track analytics event", e);
return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.BAD_REQUEST));
}
if (bodyJson == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ public ResponseEntity<RegisterSchemaResponse> register(
})
.orElseGet(
() -> {
log.error("Couldn't find topic with name {}.", topicName);
if (topicName.matches("^[a-zA-Z0-9._-]+$")) {
log.error("Couldn't find topic with name {}.", topicName);
} else {
log.error("Couldn't find topic (Malformed topic name)");
}
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
});
}
Expand Down

0 comments on commit bc79aec

Please sign in to comment.