Skip to content

Conversation

@jasonhildebrand
Copy link

Recently we audited an internal Webware app for security. We found that there is no mechanism in MiddleKit to pass user-submitted args separately. Due to this, our approach had been to use string concatenation to build queries - however, this is vulnerable to SQL injection attacks.

We implemented this improvement which supports passing separate arguments to Store.fetchObjectsOfClass(), so that it is possible to build queries safely.

We have tested under MySQL.

@Cito
Copy link
Member

Cito commented Mar 8, 2018

Right, it's always better to use bound parameters that are passed separately. Your solution looks good to me, as it should be backward compatible. Maybe we should not pass the commit flag explicitly though, but rely on the default value?

@jasonhildebrand
Copy link
Author

Thanks for the feedback. Yes, I agree about the commit flag. We'll update the branch not the pass the commit flag explicitly.

@jasonhildebrand
Copy link
Author

OK, should be good to go now.

@Cito Cito merged commit cfe2447 into WebwareForPython:master Mar 13, 2018
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.

3 participants