Skip to content

Commit d80f6dc

Browse files
author
Yuriy Bezsonov
committed
fix(security): avoid exposing error details in ThreadManagementController
Replace e.getMessage() with generic error messages to prevent leaking internal error information to external users. Resolves code scanning alerts #49 and #50.
1 parent f6e2029 commit d80f6dc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/unicorn-store-spring/src/main/java/com/unicorn/store/controller/ThreadManagementController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private Result tryStartThreads(int count) {
4646
threadGeneratorService.startThreads(count);
4747
return new Success("Successfully started " + count + " threads");
4848
} catch (IllegalStateException e) {
49-
return new Failure(e.getMessage());
49+
return new Failure("Unable to start threads. Threads may already be running.");
5050
}
5151
}
5252

@@ -55,7 +55,7 @@ private Result tryStopThreads() {
5555
threadGeneratorService.stopThreads();
5656
return new Success("Successfully stopped all threads");
5757
} catch (IllegalStateException e) {
58-
return new Failure(e.getMessage());
58+
return new Failure("Unable to stop threads. No active threads found.");
5959
}
6060
}
6161

0 commit comments

Comments
 (0)