# CVE-2024-39677: NHibernate SQL injection vulnerability in discriminator mappings, static fields referenced in HQL, and some utilities

- Severity: Medium 5.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.58%, higher than 49% of CVEs (2026-12-01)
- Published: 2024-07-08T14:20:33.000Z
- Modified: 2026-09-10T03:50:16.921Z
- Also known as: GHSA-fg4q-ccq8-3r5q
- Weaknesses: CWE-89
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- nhibernate nhibernate-core: < 5.4.9; >= 5.5.0, < 5.5.2; before 5.4.9; from 5.5.0 before 5.5.2
- NHibernate (NuGet): before 5.4.9; from 5.5.0 before 5.5.2

## Every score

- GitHub_M: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:3.1 5.9 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N`
- GitHub: CVSS:4.0 High `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: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/nhibernate/nhibernate-core/security/advisories/GHSA-fg4q-ccq8-3r5q> (vendor-advisory, 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/commit/b4a69d1a5ff5744312478d70308329af496e4ba9> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-39677> (advisory)
- <https://github.com/nhibernate/nhibernate-core> (package)

## Sources

- CVE List: [CVE-2024-39677](https://www.cve.org/CVERecord?id=CVE-2024-39677), CVE Terms of Use, modified 2024-08-02
- GitHub Advisory Database: [GHSA-fg4q-ccq8-3r5q](https://github.com/advisories/GHSA-fg4q-ccq8-3r5q), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-39677](https://nvd.nist.gov/vuln/detail/CVE-2024-39677), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-39677 · Whole record: https://cve.day/CVE-2024-39677.json · Rebuilt by cve.day 2026-11-25T22:58:42.556Z
