Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
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 applicationsUpgrade mysql2 to version 3.25.0 or higher.
mysql2 is a mostly API compatible with mysqljs and supports majority of features.
Affected versions of this package are vulnerable to SQL Injection via Connection.format() and Connection.escape(), which always escape single quotes as \' regardless of the server's SQL mode. When the MySQL server session has NO_BACKSLASH_ESCAPES enabled, the server treats the backslash as a literal character, so the quote closes the string literal and any text following it executes as SQL. An attacker can pass values through ? placeholders in connection.query() to break out of string literals and append arbitrary SQL, enabling data disclosure, authentication bypass, or data modification. connection.execute() (prepared statements) is not affected.
Note: This is only exploitable when the connected MySQL server session has NO_BACKSLASH_ESCAPES in its sql_mode, which is not a MySQL default and must be set by the deployment.
Use connection.execute() (prepared statements) for every statement that carries untrusted input, or remove NO_BACKSLASH_ESCAPES from the server's sql_mode.