Metabase Remote Code Execution Vulnerability (CVS 2023-37470)

Metabase Remote Code Execution Vulnerability (CVS 2023-37470)

August 3, 2023 | NSFOCUS

Overview

Recently, NSFOCUS CERT detected a remote code execution vulnerability in Metabase (CVE-2023-37470). Due to a flaw in the vulnerability fix for CVS 2023 38646, attackers can achieve remote code execution through H2 connection string injection. Affected users should take protective measures as soon as possible.

Reference link:

https://github.com/metabase/metabase/security/advisories/GHSA-p7w3-9m58-rq83

Scope of Impact

Affected version

Open source version:

  • Metabase<0.46.6.4
  • Metabase<0.45.4.3
  • Metabase<0.44.7.3
  • Metabase<0.43.7.3

Enterprise version:

  • Metabase<1.46.6.4
  • Metabase<1.45.4.3
  • Metabase<1.44.7.3
  • Metabase<1.43.7.3

Unaffected version

Open source version:

  • Metabase>=0.46.6.4
  • Metabase>=0.45.4.3
  • Metabase>=0.44.7.3
  • Metabase>=0.43.7.3

Enterprise version:

  • Metabase>=1.46.6.4
  • Metabase>=1.45.4.3
  • Metabase>=1.44.7.3
  • Metabase>=1.43.7.3

Vulnerability Detection

Search the metabase log or the load balancer/Reverse proxy log for any API call that returns the status code of 400. In the lifecycle of a metabase instance, the endpoint should only be called once, so there should be no other calls after that. If the endpoint is called at any other time, it should be considered to have been utilized and corresponding measures need to be taken immediately.

Mitigation

Official upgrade

At present, the official has released a new version to fix this vulnerability. It is recommended that affected users update the protection as soon as possible:

https://github.com/metabase/metabase/releases

Temporary measure

If for some reason it is not possible to upgrade immediately, these vulnerabilities can be blocked at the network layer by blocking the following endpoints until they can be upgraded.

POST/API/database

PUT/api/database/: id

POST/API/setup/validate

Attention:

  1. Blocking these endpoints will prevent users from adding new database connections to the metabase.
  2. The above operation only blocks PUT and POST, and GET requests can still be sent to these endpoints. GET requests are not related to vulnerabilities, and if Metabase is blocked, it will not work.
  3. If using H2 as a file-based database, it is recommended that you migrate to SQLite.

Statement

This advisory is only used to describe a potential risk. NSFOCUS does not provide any commitment or promise on this advisory. NSFOCUS and the author will not bear any liability for any direct and/or indirect consequences and losses caused by transmitting and/or using this advisory. NSFOCUS reserves all the rights to modify and interpret this advisory. Please include this statement paragraph when reproducing or transferring this advisory. Do not modify this advisory, add/delete any information to/from it, or use this advisory for commercial purposes without permission from NSFOCUS.

About NSFOCUS

NSFOCUS, Inc., a global network and cyber security leader, protects enterprises and carriers from advanced cyber attacks. The company’s Intelligent Hybrid Security strategy utilizes both cloud and on-premises security platforms, built on a foundation of real-time global threat intelligence, to provide multi-layered, unified and dynamic protection against advanced cyber attacks.

NSFOCUS works with Fortune Global 500 companies, including four of the world’s five largest financial institutions, organizations in insurance, retail, healthcare, critical infrastructure industries as well as government agencies. NSFOCUS has technology and channel partners in more than 60 countries, is a member of both the Microsoft Active Protections Program (MAPP), and the Cloud Security Alliance (CSA).

A wholly owned subsidiary of NSFOCUS Technologies Group Co., Ltd., the company has operations in the Americas, Europe, the Middle East and Asia Pacific.