Conversation
SQL query constructed using JavaScript template literals with dynamic input Addresses utils.custom.sql-injection-template-literal
|
Thanks for the contribution. We reviewed the input flow and are declining this change because the SQL injection finding is a false positive for the current implementation.
If table names become configurable in the future, we should validate them centrally during initialization so every query uses the same validated value. Adding a per-request check only to this handler is unnecessary for the current design. Closing without merging. Thank you for taking the time to review the project. |
|
Thanks for taking the time to trace the input flow. I agree with your assessment that the token is already parameterised and that The useful part of the finding is the unsafe-by-default pattern around interpolating a SQL identifier. If you're open, rather than keeping a per-request validation specifically for this handler, I’ll revise the change to validate the table identifier at initialization/configuration time, where the invariant can be enforced centrally. I’ll also add a regression test covering an invalid table identifier, and update the PR description to frame this as defensive hardening rather than a confirmed vulnerability. If that approach fits the project’s architecture, I’ll prepare a revised PR along those lines. |
Summary
Harden input handling in
web/ogimage.mjs(flagged by semgrep).Vulnerability
utils.custom.sql-injection-template-literalweb/ogimage.mjs:51Description: SQL query constructed using JavaScript template literals with dynamic input. This can lead to SQL injection. Use parameterized queries instead.
Threat Model Context
This is a Node.js library - vulnerabilities affect downstream consumers who use this package.
Changes
web/ogimage.mjsBehavior Preservation
The change is scoped to 1 file on the vulnerable path.
This patch removes an exploit primitive — a code pattern that, while not independently exploitable today, could be chained with other weaknesses by automated exploit-development tooling. Proactive removal of such primitives raises the bar against increasingly capable automated attack tools.
Automated security fix by OrbisAI Security