Skip to content

Do not support multiple statements for security and API reasons #51

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

Merged
merged 1 commit into from
Jun 15, 2018

Conversation

clue
Copy link
Contributor

@clue clue commented Jun 15, 2018

This PR disables the (broken) support for multiple statements for security and API reasons. Sending multiple statements as a single query could allow for possible SQL injection attacks if the input is not properly escaped. Also, the current API has no (sane) way of exposing multiple results (such as multiple independent result sets).

I do not consider this to be a BC break because the current API has no sane way of exposing multiple results in the first place and the test suite does not contain any mention of this. This PR adds a test to ensure queries with multiple statements are now properly rejected.

We will likely look into this again for a future version, once the current API issues have been worked out. Possible future implementation ideas: Exposing numbered sets à la https://github.com/mysqljs/mysql#multiple-statement-queries or discarding additional sets à la go-sql-driver/mysql#411

@jsor jsor merged commit bb713ac into friends-of-reactphp:master Jun 15, 2018
@clue clue deleted the multi branch June 15, 2018 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants