Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
b720d965
Commit
b720d965
authored
Nov 19, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Discuss safe and unsafe APIs in security chapter
parent
2baddc3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
security.rst
docs/en/reference/security.rst
+21
-0
No files found.
docs/en/reference/security.rst
View file @
b720d965
...
...
@@ -137,3 +137,24 @@ by passing the driver option "charset" to Doctrine PDO MySQL driver. Using SET N
'driver' => 'pdo_mysql',
'charset' => 'UTF8',
));
SQL Injection: Safe and Unsafe APIs for User Input
--------------------------------------------------
In general you should assume that APIs in Doctrine are not safe for user input.
There are hoewver some exceptions.
The following APIs are designed to be **SAFE** from SQL injections:
- ``Doctrine\DBAL\Connection#insert($table, $values, $types)``
- ``Doctrine\DBAL\Connection#update($table, $values, $where, $types)``
- ``Doctrine\DBAL\Connection#delete($table, $where, $types)``
- ``Doctrine\DBAL\Query\QueryBuilder#setFirstResult($offset)``
- ``Doctrine\DBAL\Query\QueryBuilder#setMaxResults($limit)``
- ``Doctrine\DBAL\Platforms\AbstractPlatform#modifyLimitQuery($sql, $limit, $offset)`` for the ``$limit`` and ``$offset`` parameters.
Consider **ALL** other APIs to be not safe for user-input:
- Query methods on the Connection
- The QueryBuilder API
- The Platforms and SchemaManager APIs to generate and execute DML/DDL SQL statements
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment