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

"if not" gets folded into bareword #114

Closed
sshayb opened this issue Oct 18, 2016 · 3 comments
Closed

"if not" gets folded into bareword #114

sshayb opened this issue Oct 18, 2016 · 3 comments

Comments

@sshayb
Copy link

sshayb commented Oct 18, 2016

The following payload:

'; if not((select serverproperty('isintegratedsecurityonly')) <> 1) waitfor delay '0:0:2' --

was tokenized previously into "s;To(E" and detected. After the latest change in syntax_merge_words
function and addition of "a->type == TYPE_TSQL", the "To" tokens are merged into "n" token; no detection as a result. Was that the intention? Seems like a side-effect of begin-try change.

@hongpinglin
Copy link

Just curious, what would be the attack for this pattern in the web applications' context.

My understanding is that statement after ";" must be TSQL (insert, drop, or update) in order to form a syntax correct sql. Any idea?

@sshayb
Copy link
Author

sshayb commented Oct 18, 2016

Yeah, not sure about that. But I'm pretty sure the "To" to "n" merging occurs regardless of the previous context, so it doesn't have to be specifically ";" there.

@client9
Copy link
Owner

client9 commented May 21, 2017

this was a good one! thanks for the report. This is fixed on HEAD and will be out in next release.

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

3 participants