Skip to main content

GORM CVE-2026-142187

| EUVDEUVD-2026-141518 HIGH
SQL Injection (CWE-89)
2026-12-02 VulnCheck GHSA-4wgc-ch5v-g36c
8.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach app path that calls CreateView
  2. Delivery
    Submit bound value containing backslash
  3. Exploit
    Backslash-quote terminates SQL literal early
  4. Execution
    Injected SQL alters view definition
  5. Impact
    Read exposed columns (password hashes)

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the application invoke GORM's Migrator.CreateView with a subquery containing bound values, AND that at least one of those bound values is attacker-influenceable, AND that the underlying database is MySQL or MariaDB (backslash is a string escape character there) - the VulnCheck advisory scopes the issue to MySQL/MariaDB specifically. The concrete trigger is a bound value containing a backslash immediately before a quote, which logger.ExplainSQL inlines unescaped so the literal terminates early. Limiting factors: view creation is typically a migration/operator-time operation, so attacker-controlled data must actually flow into that path (reflected in CVSS AC:H and AT:P); non-MySQL/MariaDB backends (e.g. PostgreSQL, SQLite) are not indicated as affected; and no special user interaction is required once such a data path exists.

Impact

This is a genuine but conditionally-gated issue rather than a drop-everything emergency. The supplied CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:N/UI:N) scores 8.3 (High): network-reachable and nominally unauthenticated (PR:N), but it carries both AC:H (high attack complexity) and AT:P (a present attack requirement), signaling that successful exploitation depends on conditions outside the attacker's direct control. The impact is skewed to confidentiality (VC:H) with only low integrity (VI:L) and no availability effect - consistent with a CWE-89 SQL injection that rewrites a view definition to surface protected columns such as password hashes. No EPSS score, no CISA KEV entry, and no proof-of-concept were provided in the input, so exploitation status is: no public exploit identified at time of analysis. The vuln.today decision label is 'this_week', and the only cited intelligence source is a VulnCheck advisory plus two GitHub source-line references - there is no independent NVD enrichment or vendor (go-gorm) advisory URL in the data set. Net assessment: real and worth remediating on a near-term (this-week) cadence, but its practical reach is limited by the specific requirement that an application routes attacker-controlled bound values into Migrator.CreateView on MySQL/MariaDB, which the AC:H/AT:P metrics reflect. Note the PR:N claim is debatable: view creation is usually an operator/migration-time operation, so whether an external unauthenticated attacker can reach that code path is deployment-specific - verify the data flow in the affected application.

Exploit ScenarioDerived

An application uses GORM's Migrator.CreateView with a subquery whose bound values are derived from untrusted input; an attacker supplies a value containing a backslash so that logger.ExplainSQL inlines it without escaping, and the backslash-quote sequence terminates the SQL string literal early. The injected fragment rewrites the view definition to include sensitive columns (for example password hashes), which the attacker then reads back through the view. No public proof-of-concept was provided, and the AC:H/AT:P metrics indicate the attacker must get their input into the view-creation path and satisfy MySQL/MariaDB-specific escaping behavior.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Dec 02, 2026

SQL injection in GORM's Migrator.CreateView (through 1.31.2) on MySQL and MariaDB can let an attacker who controls a bound subquery value alter generated view definitions and potentially expose sensitive columns such as password hashes. Exploitation is gated by an application actually passing attacker-influenceable bound values into CreateView, which is typically a migration-time or operator-time operation; PostgreSQL and SQLite are not indicated as affected. The supplied data does not confirm CISA KEV active exploitation and no public exploit code was identified at time of analysis; the VulnCheck-based priority is this_week.

RemediationAI

No vendor-released patch or fixed GORM version is identified in the supplied data; the provided references point to source code at v1.31.2 and the VulnCheck advisory, so monitor https://www.vulncheck.com/advisories/gorm-through-1.31.2-sql-injection-via-migrator-createview-on-mysql-and-mariadb for updated fixed-version guidance. Until a fix is available, the concrete control is to ensure attacker-influenceable values never reach bound parameters passed to Migrator.CreateView: build view definitions from trusted constants or strictly allowlisted identifiers, and run view-creation migrations as a trusted operator task; this removes the vulnerable data path but may require application redesign. If that data flow cannot be eliminated, avoid creating views through GORM on MySQL/MariaDB for that path or use a backend not indicated as affected, such as PostgreSQL or SQLite, accepting the operational cost of a database change. Restricting the database privileges available to migration code reduces what a successful injection could read but does not fix the injection itself.

Affected VersionsENISA

GORM 0 ≤1.31.2

Affected Packages

euvd gorm no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

GORM is a Go ORM, and Migrator.CreateView builds a CREATE VIEW statement from a supplied subquery. The referenced code shows logger.ExplainSQL inlining bound parameter values without escaping backslashes; on MySQL and MariaDB, where backslash is a string escape character, a bound value containing a backslash immediately before a quote can terminate the SQL string literal early and cause following content to be parsed as SQL. This is CWE-89 SQL injection in the view-definition path, with the advisory scoped specifically to MySQL/MariaDB; the independent assessment notes that PostgreSQL and SQLite are not indicated as affected. The trigger requires the application to invoke CreateView with a subquery containing bound values and at least one attacker-influenceable value; because view creation is usually a migration/operator-time action, the assessed CVSS vector's high attack complexity and attack precondition reflect the need for such a data path to exist.

Know when Gorm gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.3 HIGH
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
vuln.today AI 6.5 MEDIUM

AC:H because exploitation needs attacker input routed into CreateView and MySQL/MariaDB escaping behavior; PR:N as no auth is inherent to the SQLi; C:H (reads protected columns), I:L (view definition altered), A:N.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

A high-severity SQL injection vulnerability in GORM's Migrator.CreateView (versions through 1.31.2) on MySQL and MariaDB could allow an attacker who controls bound subquery values to alter database view definitions and expose sensitive columns like password hashes. Applications that pass attacker-influenceable values into CreateView during migrations or operator actions are at risk, potentially leading to unauthorized data disclosure. Leadership should prioritize remediation because this could compromise credential integrity and require incident response.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include input validation and parameterization of CreateView arguments, restricting database permissions to prevent unauthorized view creation, auditing and monitoring view definition changes, and avoiding CreateView with attacker-influenceable bound values.

Threat Intelligence Overview

Prevalence
High
GORM is the de facto standard ORM across the Go ecosystem
Data Quality
4 sources
Confidence: Medium
EUVD NVD CVE.org Vulnrichment GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS N/A
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy