Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(vulnerability): Log Injection (High) #11131

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
pinakipb2 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading