security.rst.txt 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. Security policy
  2. ===============
  3. The phpMyAdmin developer team is putting lot of effort to make phpMyAdmin as
  4. secure as possible. But still web application like phpMyAdmin can be vulnerable
  5. to a number of attacks and new ways to exploit are still being explored.
  6. For every reported vulnerability we issue a phpMyAdmin Security Announcement
  7. (PMASA) and it get's assigne CVE ID as well. We might group similar
  8. vulnerabilities to one PMASA (eg. multiple XSS vulnerabilities can be announced
  9. under one PMASA).
  10. If you think you've found a vulnerability, please see :ref:`reporting-security`.
  11. Typical vulnerabilities
  12. -----------------------
  13. In this secion, we will describe typical vulnerabilities, which can appear in
  14. our code base. This list is by no means complete, it is intended to show
  15. typical attack surface.
  16. Cross-site scripting (XSS)
  17. ++++++++++++++++++++++++++
  18. When phpMyAdmin shows a piece of user data, e.g. something inside a user's
  19. database, all html special chars have to be escaped. When this escaping is
  20. missing somewhere a malicious user might fill a database with specially crafted
  21. content to trick an other user of that database into executing something. This
  22. could for example be a piece of JavaScript code that would do any number of
  23. nasty things.
  24. phpMyAdmin tries to escape all userdata before it is rendered into html for the
  25. browser.
  26. .. seealso::
  27. `Cross-site scripting on Wikipedia <https://en.wikipedia.org/wiki/Cross-site_scripting>`_
  28. Cross-site request forgery (CSRF)
  29. +++++++++++++++++++++++++++++++++
  30. An attacker would trick a phpMyAdmin user into clicking on a link to provoke
  31. some action in phpMyAdmin. This link could either be sent via email or some
  32. random website. If successful this the attacker would be able to perform some
  33. action with the users privileges.
  34. To mitigate this phpMyAdmin requires a token to be sent on sensitive requests.
  35. The idea is that an attacker does not poses the currently valid token to
  36. include in the presented link.
  37. The token is regenerated for every login, so it's generally valid only for
  38. limited time, what makes it harder for attacker to obtain valid one.
  39. .. seealso::
  40. `Cross-site request forgery on Wikipedia <https://en.wikipedia.org/wiki/Cross-site_request_forgery>`_
  41. SQL injection
  42. +++++++++++++
  43. As the whole purpose of phpMyAdmin is to preform sql queries, this is not our
  44. first concern. SQL injection is sensitive to us though when it concerns the
  45. mysql control connection. This controlconnection can have additional privileges
  46. which the logged in user does not poses. E.g. access the :ref:`linked-tables`.
  47. User data that is included in (administrative) queries should always be run
  48. through DatabaseInterface::escapeSring().
  49. .. seealso::
  50. `SQL injection on Wikipedia <https://en.wikipedia.org/wiki/SQL_injection>`_
  51. Brute force attack
  52. ++++++++++++++++++
  53. phpMyAdmin on its own does not rate limit authentication attempts in any way.
  54. This is caused by need to work in stateless environment, where there is no way
  55. to protect against such kind of things.
  56. To mitigate this, you can use Captcha or utilize external tools such as
  57. fail2ban, this is more details described in :ref:`securing`.
  58. .. seealso::
  59. `Brute force attack on Wikipedia <https://en.wikipedia.org/wiki/Brute-force_attack>`_
  60. .. _reporting-security:
  61. Reporting security issues
  62. -------------------------
  63. Should you find a security issue in the phpMyAdmin programming code, please
  64. contact the `phpMyAdmin security team <mailto:security@phpmyadmin.net>`_ in
  65. advance before publishing it. This way we can prepare a fix and release the fix together with your
  66. announcement. You will be also given credit in our security announcement.
  67. You can optionally encrypt your report with PGP key ID
  68. ``DA68AB39218AB947`` with following fingerprint:
  69. .. code-block:: console
  70. pub 4096R/DA68AB39218AB947 2016-08-02
  71. Key fingerprint = 5BAD 38CF B980 50B9 4BD7 FB5B DA68 AB39 218A B947
  72. uid phpMyAdmin Security Team &lt;security@phpmyadmin.net&gt;
  73. sub 4096R/5E4176FB497A31F7 2016-08-02
  74. The key can be either obtained from the keyserver or is available in
  75. `phpMyAdmin keyring <https://files.phpmyadmin.net/phpmyadmin.keyring>`_
  76. available on our download server or using `Keybase <https://keybase.io/phpmyadmin_sec>`_.
  77. Should you have suggestion on improving phpMyAdmin to make it more secure, please
  78. report that to our `issue tracker <https://github.com/phpmyadmin/phpmyadmin/issues>`_.
  79. Existing improvement suggestions can be found by
  80. `hardening label <https://github.com/phpmyadmin/phpmyadmin/labels/hardening>`_.