Go
CVE-2026-142187
GORM through 1.31.2 SQL Injection via Migrator.CreateView on MySQL and MariaDB
- Severity
- High 8.3
- Published
- 2 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Weakness
- SQL injection (CWE-89)
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Read data · Change some data
- CVSS vector
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N- Sources
- CVE Program
Description
GORM through 1.31.2 contains an sql injection vulnerability in Migrator.CreateView that allows attackers to inject SQL by supplying bound subquery values containing backslashes. Because logger.ExplainSQL inlines values without escaping backslashes, a backslash-quote sequence terminates the literal early, letting attackers alter view definitions to expose columns like password hashes.
Affected software
| Software | Affected versions |
|---|---|
gorm.io/gormGo · osv:Go:gorm.io/gorm |
|
About gorm.io/gorm
This is the only vulnerability in gorm.io/gorm in our list.
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-142187