CVE-2022-21687: DSN Injection in gh-ost

- 1 min


gh-ost is a triggerless online schema migration solution for MySQL. Versions prior to 1.1.3 are subject to an arbitrary file read vulnerability. The attacker must have access to the target host or trick an administrator into executing a malicious gh-ost command on a host running gh-ost, plus network access from host running gh-ost to the attack’s malicious MySQL server. The -database parameter does not properly sanitize user input which can lead to arbitrary file reads.

Proof of Concept

Vulnerable code: go/mysql/connection.go:122