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

Fix ssi sqlis #44

Merged
merged 1 commit into from Jan 16, 2017
Merged

Fix ssi sqlis #44

merged 1 commit into from Jan 16, 2017

Conversation

C3realGuy
Copy link
Contributor

@C3realGuy C3realGuy commented Jan 14, 2017

Many limits got concatenate in SSI.php which is not sql injection safe. If you once miss to parse the limit argument as an int, you can (maybe) perform an sql injection. Better fix em.

@Nao
Copy link
Member

Nao commented Jan 15, 2017

I'm not getting it.. By definition, if you can call a SSI function, it means you have admin-type rights, so you wouldn't need to 'inject' anything via SQL anyway, e.g. you could simply make your own wesql::query call...

As for your code, I noticed at least three breaking errors, so I couldn't do a merge even if I wanted to. ^^

@C3realGuy
Copy link
Contributor Author

C3realGuy commented Jan 15, 2017

I'm not an SMF expert, but those SSI stuff also often got used for additional pages or smaller scripts which should extend SMF. You could require SSI.php und could build you own page with the style of the forum. In the SSI.php there were also some helper functions, and as those I see them. Of course you could always cast the limit as an integer and you would be safe for sql injections. But as soon as you don't do it, there's a possibility of an sql injection.
For example in template_home_topics you never check if it's an true integer, if the value is from the databse (this topics:13 in homepage custom content settings). For sure you need admin access, but still this is something which should get fixed. It's wrong in my understanding to not parameterize any value like this.
Also because this are helper functions, especially developement beginners will use them. Dynamic numbers of posts by getting it via an $_GET parameter is very thinkable. Just not force to cast it to an integer and you have some bad things going on.
I don't think that this will change anything on the performance on those requests.
So this is nothing which is really critical, I don't think that you can exploit it on a normal wedge installation. But maybe a plugin which uses one of those functions and doesn't handle the input for any limits correctly. Still i think wedge is quite safe because of the anti hacking system, which blocked nearly all my attempts to do something bad.

What breaking errors did you notice?

@Nao
Copy link
Member

Nao commented Jan 15, 2017 via email

@C3realGuy
Copy link
Contributor Author

C3realGuy commented Jan 15, 2017

Now I see 🗡️
Changed and rebased.

@C3realGuy C3realGuy force-pushed the fix_ssi_sqlis branch 2 times, most recently from 60ae6ff to 16a32b5 Compare January 15, 2017 13:57
@Nao Nao merged commit 5c40f54 into Wedge:master Jan 16, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants