Skip to content

graph.query wont escape params #51

Closed
@avifatal

Description

@avifatal

Hi,
From my experience, query bindings capabilities escape the data before it is being saved to the database. for security reasons and data integrity reasons...

await graph.query("CREATE (n:Person { name: $name })", {name: 'test"abc'});

This will throw an error:

ReplyError: errMsg: Invalid input 'a': expected ';', a statement option, a query hint, a clause or a schema command line: 1, column: 1, offset: 0 errCtx: abc"  CREATE (n:Person { name: $name }) errCtxOffset: 0
    at parseError (/usr/src/app/node_modules/redis-parser/lib/parser.js:179:12)

I think it must be escaped by the framework...

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions