Skip to content

prevent inclusion of stack trace in response (leak of detailed error information) #4255

@rursprung

Description

@rursprung

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:

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.

Metadata

Metadata

Assignees

Labels

enhancementEnhancement or improvement to existing feature or requestsecurityAnything security related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions