$queryRawUnsafe

javascript · standard library
sink✓ Reviewed · 2026-09-04
RoleSink
WeaknessCWE-89
WatchesArgument[0]
Kindsql-injection
Confidencemedium
Corroboration2

Executes a raw query without the parameterization guarantees of a higher-level query builder.

Argument map · what each slot does

The pack does not provide a callable signature for this record; the watched access path is shown directly.

ArgAccess pathPurposeWatched
Argument[0]Argument[0]The access path Atropos marks for this model.▲ sink
The weakness
CWE-89
Weakness mapping

See the linked MITRE definition for the current weakness description.

What goes wrong
Attacker's-eye view · sql-injection

Quotes, operators, or comments in a crafted value alter the query's meaning.

// modeled boundary: Argument[0] $queryRawUnsafe(attacker_influenced_value);
To decide if this call is a bug, check
1Use prepared statements and bound parameters.
2Keep identifiers and clauses allow-listed.
3Review raw-query escape hatches separately.
These checks require the surrounding codebase. The model names the boundary; it does not decide reachability or prove that a guard dominates every path.
Is this a bug in your code?Atropos stops here — by design

Atropos identifies Argument[0] as a sql-injection sink. It cannot see whether untrusted data reaches this call in your repository.

Lachesis is the codebase-level step: it traces reachability and guards for this symbol.

Check this symbol in Lachesis
Reviewed guidance

Safer direction: Use the library's parameterized query form and reserve raw SQL for fixed, reviewed text.

Unsafe shape
db.queryRawUnsafe(`SELECT * FROM users WHERE id=${id}`);
Safer shape
db.user.findUnique({where:{id}});
The family · sql-injection
Model facts · verbatim from the pack
RoleKindAccess pathModel IDConfidence
sinksql-injectionArgument[0]javascript.std.queryrawunsafe.a0medium · corrob. 2
Referencescheatsheetseries.owasp.org