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

BE: Make it possible to hide stacktraces in HTTP responses #536

Open
2 tasks done
PhilGrayson-flutterint opened this issue Sep 2, 2024 · 3 comments
Open
2 tasks done
Labels
good first issue Up for grabs hacktoberfest Issues good for hacktoberfest goal scope/backend Related to backend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature type/security Pull requests that address a security vulnerability

Comments

@PhilGrayson-flutterint
Copy link

Issue submitter TODO list

  • I've searched for an already existing issues here
  • I'm running a supported version of the application which is listed here and the feature is not present there

Is your proposal related to a problem?

No response

Describe the feature you're interested in

When you visit an API path that does not exist like /api/foobar, Kafka-UI prints a JSON response containing a stackTrace field.

I'd like to be able to prevent the stacktrace from being printed as a defence in depth strategy to limit exposing implementation detail that could be used to scan for known vulnerabilities. This is to address https://owasp.org/www-community/Improper_Error_Handling.

I appreciate that Kafka-UI displays the currently-deployed git commit short hash in the header, and since Kafka-UI is open-source, that can also be used to discover the library dependency tree. However, I think addressing that is outside the scope of this request.

Describe alternatives you've considered

I tried to use Spring web native property server.error.include-stacktrace to prevent this, but that didn't work.

I see the stacktrace is always being added in GlobalErrorWebExceptionHandler.java class.

Version you're running

8c70126

Additional context

No response

@PhilGrayson-flutterint PhilGrayson-flutterint added status/triage Issues pending maintainers triage type/feature A brand new feature labels Sep 2, 2024
@kapybro kapybro bot added status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Sep 2, 2024
@Haarolean Haarolean added good first issue Up for grabs type/enhancement En enhancement/improvement to an already existing feature scope/backend Related to backend changes and removed type/feature A brand new feature status/triage/manual Manual triage in progress labels Sep 3, 2024
@Haarolean Haarolean changed the title Add option to not print stacktrace on non-successful API HTTP responses BE: Make it possible to hide stacktraces in HTTP responses Sep 3, 2024
@Haarolean Haarolean moved this to Todo in Up for grabs Sep 3, 2024
@mrlittle113
Copy link

I would like to work on this!

@Haarolean
Copy link
Member

@mrlittle113 sure, the desired approach is to have a configuration property that will hide the stack traces in the aforementioned GlobalExceptionHandler

@Haarolean Haarolean moved this from Todo to In Development in Up for grabs Sep 4, 2024
mrlittle113 pushed a commit to mrlittle113/kafka-ui that referenced this issue Sep 4, 2024
@mrlittle113
Copy link

I have created https://github.com/kafbat/kafka-ui/pull/537. Also I have some questions:

  • Where should I documented the new config.
  • I am using mac, as the document say that some test fail on mac, so how could I check if my code break any tests.

@Haarolean Haarolean added the type/security Pull requests that address a security vulnerability label Sep 27, 2024
@Haarolean Haarolean linked a pull request Sep 27, 2024 that will close this issue
13 tasks
@Haarolean Haarolean added the hacktoberfest Issues good for hacktoberfest goal label Oct 4, 2024
@Haarolean Haarolean moved this from In Development to In Review in Up for grabs Oct 4, 2024
@Haarolean Haarolean moved this from In Review to Todo in Up for grabs Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Up for grabs hacktoberfest Issues good for hacktoberfest goal scope/backend Related to backend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature type/security Pull requests that address a security vulnerability
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

3 participants