CVE-2026-142187: GORM through 1.31.2 SQL Injection via Migrator.CreateView on MySQL and MariaDB

Published Dec 2, 2026
·
Updated

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

1 affected component
go/github.com/go-gorm/gorm<=1.31.2

Event History

Dec 2, 2026
CVE Published
via MITRE·04:51 PM
Data Sourced
via MITRE·04:51 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Applications using GORM through 1.31.2 with MySQL or MariaDB are affected when they use Migrator.CreateView with bound subquery values. The issue concerns creation of database views rather than general query execution.

2

What must an attacker control to exploit it?

An attacker must be able to supply a bound subquery value used by Migrator.CreateView. A value containing a backslash-quote sequence can cause the inlined SQL literal to terminate early and permit alteration of the view definition.

3

What is the likely impact of successful exploitation?

An attacker can alter view definitions, potentially exposing data that the intended view should not reveal. The reported example includes disclosure of columns such as password hashes.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203