SQL Injection Affecting nhibernate package, versions [,5.4.9) [5.5.0,5.5.2)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.07% (32nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-DOTNET-NHIBERNATE-7416902
  • published 7 Jul 2024
  • disclosed 3 Jul 2024
  • credit Frédéric Delaporte

How to fix?

Upgrade NHibernate to version 5.4.9, 5.5.2 or higher.

Overview

NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed, fully featured and used in thousands of successful projects.

Affected versions of this package are vulnerable to SQL Injection when passing unescaped user input to ILiteralType.ObjectToSQLString, including discriminator values passed via mappings, HQL queries with references to static fields, and overloading the AddColumn function in SqlInsertBuilder or SqlUpdateBuilder.

Workaround

This vulnerability can be avoided for the discriminator case by eliminating quoted text from values used in discriminator mappings.

CVSS Scores

version 4.0
version 3.1
Expand this section

Snyk

Recommended
6.9 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Attack Requirements (AT)
    None
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Confidentiality (VC)
    None
  • Integrity (VI)
    Low
  • Availability (VA)
    None
  • Confidentiality (SC)
    Low
  • Integrity (SI)
    Low
  • Availability (SA)
    Low