Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bobby Tables #83

Open
brendanator opened this issue Sep 12, 2017 · 1 comment
Open

Bobby Tables #83

brendanator opened this issue Sep 12, 2017 · 1 comment

Comments

@brendanator
Copy link
Contributor

brendanator commented Sep 12, 2017

I suspect the escaping of constant sql strings is not fully safe

I think \ needs escaping too or else it can be used to escape a single quote
select().from(MyTable).where(MyTable.field === "\\'; drop bobby tables".const)

As long as const strings are not used for user values this shouldn't ever be a problem

Don't know if this is an issue for DB2 but it would be for MySQL: https://dev.mysql.com/doc/refman/5.7/en/string-literals.html

@DavidGregory084
Copy link
Contributor

Yes, it's a bit of an escape hatch. I've been thinking about writing a Scalafix linting rule that checks that the receiver of .constant is a compile-time constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants