CVE-2024-39677: NHibernate SQL injection vulnerability in discriminator mappings, static fields referenced in HQL, and some utilities
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.38099%
CWE
Published
7/8/2024
Updated
11/18/2024
KEV Status
No
Technology
C#
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
NHibernate | nuget | < 5.4.9 | 5.4.9 |
NHibernate | nuget | >= 5.5.0, < 5.5.2 | 5.5.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from implementations of ILiteralType.ObjectToSQLString
that failed to properly sanitize input. Pre-patch code in multiple type classes (AbstractStringType
, AbstractCharType
, etc.) directly concatenated values into SQL literals without adequate escaping. The commit diff shows these methods were modified to use dialect.ToStringLiteral
or invariant culture formatting, confirming they were vulnerable to SQL injection via unescaped quotes, culture manipulation, and special character injection. The high confidence comes from explicit security fixes in the referenced patches and commit changes.