-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Is your feature request related to a problem? Please describe.
there are currently two options to include a stack trace in the server response in case of errors:
- set the
http.detailed_errors.enabledconfig option (undocumented for OpenSearch, documented for ES 7.10.2) - add the
error_trace=trueURL parameter (see the OpenSearch documentation)
the former can only be done by a system administrator, however the latter can be done by anyone who can call OpenSearch.
thus, when an exception is raised, the following parameter can be added to the request URL to include the error stack trace in the response error_trace=true
Example Request:
GET /opensearch/_search?error_trace=true
Such technical details are not supposed to be visible to clients as it does not provide any added value. To an attacker however, this information might give valuable hints as to which frameworks and libraries are used by the web application. Apart from that, technical details can help in the analysis of errors and simplify the search for security issues.
Describe the solution you'd like
Because the client should only receive information that is necessary to handle the error, it should be possible to disable the corresponding parameter globally using a config option.
i could e.g. imagine changing http.detailed_errors.enabled from a boolean parameter to an enum in a backwards compatible way so that it accepts false (by default no trace is printed, the HTTP param is accepted), true (trace printed by default) and disabled (HTTP param is ignored, trace is never printed).
Describe alternatives you've considered
arguing with the security reviewers about the finding is usually not the best alternative 😆
Additional context
scoring acc. to our reviewers:
CVSS 3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N CVSS Base Score: 5.3
note: i'm raising this as a feature request instead reporting it via email as a security issue as it is IMHO not a direct security problem and thus can be discussed openly. in a proper setup OpenSearch should also not be reachable from the outside, i.e. this can only be exploited if the attacker is already in the network.