Vulnerability · Published Jul 8, 2024 · Assigned by GitHub_M
CVE-2024-39677NHibernate SQL injection vulnerability in discriminator mappings, static fields referenced in HQL, and some utilities
Medium 5.9
In plain English
A medium-severity SQL injection in nhibernate-core from nhibernate. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 48% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
NHibernate is an object-relational mapper for the .NET framework. A SQL injection vulnerability exists in some types implementing ILiteralType.ObjectToSQLString. Callers of these methods are exposed to the vulnerability, which includes mappings using inheritance with discriminator values; HQL queries referencing a static field of the application; users of the SqlInsertBuilder and SqlUpdateBuilder utilities, calling their AddColumn overload taking a literal value; and any direct use of the ObjectToSQLString methods for building SQL queries on the user side. This vulnerability is fixed in 5.4.9 and 5.5.2.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| NuGet | nhibernate | 5.4.9 | GHSA-fg4q-ccq8-3r5q |
| NuGet | nhibernate | 5.5.2 | GHSA-fg4q-ccq8-3r5q |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| nhibernate | nhibernate-core | < 5.4.9>= 5.5.0, < 5.5.2 |
Weakness: CWE-89 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
References
- https://github.com/nhibernate/nhibernate-core/security/advisories/GHSA-fg4q-ccq8-3r5q x_refsource_CONFIRM
- https://github.com/nhibernate/nhibernate-core/issues/3516 x_refsource_MISC
- https://github.com/nhibernate/nhibernate-core/pull/3517 x_refsource_MISC
- https://github.com/nhibernate/nhibernate-core/pull/3547 x_refsource_MISC
- https://github.com/nhibernate/nhibernate-core/commit/b4a69d1a5ff5744312478d70308329af496e4ba9 x_refsource_MISC