You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The security of the OpenSearch Dashboard could be hardened by restricting the information available in a ResponseError. Indeed, it appears that the OpenSearch Dashboards does not perform a filtering in the ResponseError fields, especially Authorizations headers.
This is currently not a security issue in OpenSearch as the Exceptions are not logged, but could further harden the security of the product and prevent any future misusage.
The following test shows that no logging is performed but that the exception class may contain too much information:
it('Check that sensitive headers are filtered out',async()=>{const{server: innerServer, createRouter }=awaitserver.setup(setupDeps);constrouter=createRouter('/');router.get({path: '/',validate: false},(context,req,res)=>{consterror=newError('unauthorized');returnres.custom({statusCode: 401,body: error,headers: {"Authorization": "secret-value"}});});awaitserver.start();constresult=awaitsupertest(innerServer.listener).get('/').expect(401);expect(result.body.message).toBe('unauthorized');expect(loggingSystemMock.collect(logger).error).toHaveLength(0);//expect(result.headers).toBe({}); // <- for the moment, the whole header array is available});
The text was updated successfully, but these errors were encountered:
davidlago
changed the title
[Enhancement] Restrict informations available in ResponseError
[Enhancement] Restrict information available in ResponseErrorJan 17, 2024
davidlago
transferred this issue from opensearch-project/security-dashboards-plugin
Jan 17, 2024
[Triage] Hi @davidlago, thanks for filing this issue. This is a good preemptive measure to keep things above board. We can close this issue when the logging has been changed to redact any of the sensitive information from the response and we have tests to show this.
The security of the OpenSearch Dashboard could be hardened by restricting the information available in a
ResponseError
. Indeed, it appears that the OpenSearch Dashboards does not perform a filtering in theResponseError
fields, especiallyAuthorizations
headers.This is currently not a security issue in OpenSearch as the
Exception
s are not logged, but could further harden the security of the product and prevent any future misusage.The following test shows that no logging is performed but that the exception class may contain too much information:
The text was updated successfully, but these errors were encountered: