Disclosed vulnerabilities
CVE-2021-34826 Published: Jun 22, 2021

SQL Injection in Heimdall Gateway - heimdall/getheimdall

9.8 Critical Severity Conductor Tecnologia SA Heimdall SQL Injection
Dor Tumarkin Reported by Checkmarx Zero

Summary

The Heimdall Gateway application is vulnerable to SQL Injection in its API routing mechanism, allowing unauthenticated attackers to inject SQL statements via the API’s URL when downgrading the HTTP protocol.

Product

  • getheimdall/heimdall <= 2.17.0

Impact

An attacker will be able to tamper SQL syntax, allowing them to compromise all data in the Postgres database, as well as execute SQL code.

Steps to reproduce

  1. Get an instance of Heimdall running as per documentation, or via docker-compose
  2. Add any API to the orchestrator; this is part of basic Heimdall functionality
  3. Locate an API endpoint on the Heimdall Gateway – for example, the following samples will assume “user” is an endpoint orchestrated by Heimdall
  4. Note that for the exploit to work, HTTP/1.0 must be used with HTTP/1.1, with an empty host header
  5. Use the following command to induce sleep and demonstrate a SQL command is executed: curl -v -i –http1.0 -H ‘Host:’ “http://heimdall_instance/v2/user/’;SELECT(pg_sleep(10));–a“

Remediation

  • This software is obsolete and no longer maintained; it should be retired.

Credit

This issue was discovered and reported by Checkmarx Security Research Team Leader Dor Tumarkin (@dortumarkin).

Resources

  1. Heimdall Git - archived

Stay connected and never miss a research update!