Skip to content

Security Issue: Change stringifyObjects default value to true #4051

@mantrainfosec

Description

@mantrainfosec

Alarm bells were raised about this in 2022 [1], 2024 [2] and 2025 [3]. The stringifyObjects default is set to false, which makes literally thousands of applications susceptible to SQL Injection.

If the default value had been set to true instead of the current default false, it would have protected all new applications from this vulnerability, which was introduced in node-mysql and later replicated in node-mysql2.

All technical details can be found in [1] and [2]. It is alarming that, although this issue was raised, it has not been fixed since.

[1] https://flattsecurity.medium.com/finding-an-unseen-sql-injection-by-bypassing-escape-functions-in-mysqljs-mysql-90b27f6542b4
[2] #1247 (comment)
[3] https://blog.mantrainfosec.com/blog/18/prepared-statements-prepared-to-be-vulnerable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions