CVE-2024-39677
CRITICAL 9.8CVSS 3.1NHibernate SQL injection vulnerability in discriminator mappings, static fields referenced in HQL, and some utilities
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.
- Published
- 8 Jul 2024
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-89
- Also known as
- GHSA-fg4q-ccq8-3r5q
- Sources
- NVDJSONOSV GHSA-fg4q-ccq8-3r5qJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | nhibernate | nhibernate-corecpe:2.3:a:nhibernate:nhibernate-core:*:*:*:*:*:*:*:* |
< 5.4.9 | 5.4.9 |
| NVD | nhibernate | nhibernate-corecpe:2.3:a:nhibernate:nhibernate-core:*:*:*:*:*:*:*:* |
>= 5.5.0, < 5.5.2 | 5.5.2 |
| OSV | NuGet | NHibernate | < 5.4.9 | 5.4.9 |
| OSV | NuGet | NHibernate | >= 5.5.0, < 5.5.2 | 5.5.2 |
References
- https://github.com/nhibernate/nhibernate-core/commit/b4a69d1a5ff5744312478d70308329af496e4ba9 · Patch, WEB
- https://github.com/nhibernate/nhibernate-core/issues/3516 · Issue Tracking, WEB
- https://github.com/nhibernate/nhibernate-core/pull/3517 · Issue Tracking, WEB
- https://github.com/nhibernate/nhibernate-core/pull/3547 · Issue Tracking, Patch, WEB
- https://github.com/nhibernate/nhibernate-core/security/advisories/GHSA-fg4q-ccq8-3r5q · Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-39677 · ADVISORY
- https://github.com/nhibernate/nhibernate-core · PACKAGE
History
- 25 Nov 2026 20:55 UTC · NVD: first stored (published 8 Jul 2024)
- 25 Nov 2026 20:13 UTC · OSV: first stored (published 8 Jul 2024)