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

2.3.0 rest call error messages became worse #21132

Closed
octopus-prime opened this issue Apr 26, 2020 · 5 comments
Closed

2.3.0 rest call error messages became worse #21132

octopus-prime opened this issue Apr 26, 2020 · 5 comments
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@octopus-prime
Copy link

Version 2.2.6 gives useful error-messages

/kunde-api/kunden/bf73ce21-f91b-4619-8891-1b4b471db3fe (not found)
->
"Kunde not found" (the text used in eception)

/kunde-api/kunden/123 (no UUID)
->
"Failed to convert value of type 'java.lang.String' to required type 'java.util.UUID'; nested exception is java.lang.IllegalArgumentException: Invalid UUID string: 123" (out-of-the-box)

Version 2.3.0 gives worse error-messages

/kunde-api/kunden/bf73ce21-f91b-4619-8891-1b4b471db3fe (not found)
->
"An error occurred while processing the request" (so, what's the problem here??)

/kunde-api/kunden/123 (no UUID)
->
"An error occurred while processing the request" (so, what's the problem here??)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 26, 2020
@wilkinsona
Copy link
Member

Thanks for the report. Unfortunately, without some more context it's hard to be certain about the problem that you're describing. Making an educated guess, assuming that you're referring to the default error controller's output and that you're using 2.3.0 snapshots, this may be due to #20505. Can you please clarify?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Apr 26, 2020
@octopus-prime
Copy link
Author

octopus-prime commented Apr 26, 2020

Hmm... don't know about 'default error page'.
But i know i throw an explicit exception, like
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Kunde not found")

2.2.6:
GET https://localhost/kunde-api/kunden/bf73ce21-f91b-4619-8891-1b4b471db3fe
->

{
  "timestamp": "2020-04-26T18:59:11.692+0000",
  "status": 404,
  "error": "Not Found",
  "message": "Kunde not found",
  "path": "/kunde-api/kunden/bf73ce21-f91b-4619-8891-1b4b471db3fe"
}

2.3.0:
GET https://localhost/kunde-api/kunden/bf73ce21-f91b-4619-8891-1b4b471db3fe
->

{
  "timestamp": "2020-04-26T18:59:11.692+0000",
  "status": 404,
  "error": "Not Found",
  "message": "An error occurred while processing the request",
  "path": "/kunde-api/kunden/bf73ce21-f91b-4619-8891-1b4b471db3fe"
}

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 26, 2020
@octopus-prime
Copy link
Author

okay. got it...

server:
  error:
    include-details: always

shows old behaviour.

@octopus-prime
Copy link
Author

What's the idea behind that change?
Why running with default settings causes eating up explicit error messages?!

@wilkinsona
Copy link
Member

Exception messages can leak implementation details. In your example above, you have leaked the fact that the server is using Java and that the value is being parsed into a UUID. Depending on the circumstances and the information that is being leaked, this could allow an attacker to identify a vulnerability that they can exploit.

#20505 is already labelled as noteworthy so the change will be describe in the release notes for 2.3.0.RC1.

@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

3 participants